From 1369c87ddcc0e76e17d01208ef66261ee0cd27da Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期五, 27 二月 2026 18:13:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutRecordService.java |  347 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 316 insertions(+), 31 deletions(-)

diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutRecordService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutRecordService.java
index 52281a5..6413c9d 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutRecordService.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutRecordService.java
@@ -4,8 +4,10 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fzzy.igds.bill.InoutBill;
 import com.fzzy.igds.constant.Constant;
+import com.fzzy.igds.constant.FoodLevel;
 import com.fzzy.igds.constant.FoodVariety;
 import com.fzzy.igds.constant.RedisConst;
+import com.fzzy.igds.data.IgdsBaseParam;
 import com.fzzy.igds.data.InoutData;
 import com.fzzy.igds.data.InoutParam;
 import com.fzzy.igds.data.InoutPrintBill;
@@ -23,6 +25,7 @@
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
+
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
@@ -51,14 +54,15 @@
 
     /**
      * 鍒嗛〉鏌ヨ鏁版嵁
+     *
      * @param page
      * @param param
      */
     public void listPageInout(Page<InoutRecord> page, InoutParam param) {
-        if(StringUtils.isBlank(param.getCompanyId())){
+        if (StringUtils.isBlank(param.getCompanyId())) {
             param.setCompanyId(ContextUtil.getCompanyId());
         }
-        if(StringUtils.isBlank(param.getDeptId())){
+        if (StringUtils.isBlank(param.getDeptId())) {
             param.setDeptId(ContextUtil.subDeptId(null));
         }
         QueryWrapper<InoutRecord> queryWrapper = getQueryWrapper(param);
@@ -67,13 +71,14 @@
 
     /**
      * 鏌ヨ鏁版嵁闆嗗悎
+     *
      * @param param
      */
     public List<InoutRecord> listInout(InoutParam param) {
-        if(StringUtils.isBlank(param.getCompanyId())){
+        if (StringUtils.isBlank(param.getCompanyId())) {
             param.setCompanyId(ContextUtil.getCompanyId());
         }
-        if(StringUtils.isBlank(param.getDeptId())){
+        if (StringUtils.isBlank(param.getDeptId())) {
             param.setDeptId(ContextUtil.subDeptId(null));
         }
         QueryWrapper<InoutRecord> queryWrapper = getQueryWrapper(param);
@@ -83,6 +88,7 @@
 
     /**
      * 灏佽鏌ヨ鏉′欢
+     *
      * @param param
      */
     public QueryWrapper<InoutRecord> getQueryWrapper(InoutParam param) {
@@ -130,25 +136,49 @@
             queryWrapper.eq("settle_tag", param.getSettleTag());
         }
         if (null != param.getStart()) {
-            queryWrapper.ge("create_time", DateUtil.getCurZero(param.getStart()));
+            queryWrapper.ge("complete_time", DateUtil.getCurZero(param.getStart()));
         }
         if (null != param.getEnd()) {
-            queryWrapper.le("create_time", DateUtil.getNextZero(param.getEnd()));
+            queryWrapper.le("complete_time", DateUtil.getNextZero(param.getEnd()));
         }
         queryWrapper.ne("record_status", Constant.RECORD_STATUS_DEL); //涓嶆槸鍒犻櫎鐨勫崟瀛愶紝鍗虫甯哥殑鍗曞瓙
-        queryWrapper.orderByDesc("create_time");
+        queryWrapper.orderByDesc("complete_time");
 
         return queryWrapper;
     }
 
+    /**
+     * 鏍规嵁鏃堕棿绫诲瀷锛岃幏鍙栧凡瀹屾垚鐨勬甯稿崟鎹�
+     *
+     * @param timeType
+     * @param param
+     * @return
+     */
+    public List<InoutRecord> getCompleteInoutByTime(String timeType, IgdsBaseParam param) {
+        if (StringUtils.isBlank(timeType)) {
+            return null;
+        }
+
+        QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>();
+
+        queryWrapper.likeRight("dept_id", param.getDeptId());
+        queryWrapper.likeRight("progress", Constant.PROGRESS_RECORD); //宸插畬鎴愮殑鍗曟嵁
+        queryWrapper.ne("record_status", Constant.RECORD_STATUS_DEL); //涓嶆槸鍒犻櫎鐨勫崟瀛愶紝鍗虫甯哥殑鍗曞瓙
+        queryWrapper.ge(timeType, param.getStart());
+        queryWrapper.le(timeType, param.getEnd());
+        queryWrapper.orderByAsc("complete_time");
+
+        return inoutRecordMapper.selectList(queryWrapper);
+    }
 
     /**
      * 鏌ヨ鏁版嵁
+     *
      * @param param
      * @return
      */
     public InoutRecord selectOne(InoutParam param) {
-        if(StringUtils.isBlank(param.getCompanyId())){
+        if (StringUtils.isBlank(param.getCompanyId())) {
             param.setCompanyId(ContextUtil.getCompanyId());
         }
         QueryWrapper<InoutRecord> queryWrapper = getQueryWrapper(param);
@@ -158,6 +188,7 @@
 
     /**
      * 楠岃瘉杞︾墝鍙锋槸鍚﹀湪娴佺▼涓�
+     *
      * @param companyId
      * @param plateNum
      * @return
@@ -171,15 +202,13 @@
         queryWrapper.eq("company_id", companyId);
         queryWrapper.eq("plate_num", plateNum);
         queryWrapper.ne("progress", Constant.PROGRESS_RECORD);
-        queryWrapper.eq("record_status", "NORMAL");
-        queryWrapper.or();
-        queryWrapper.eq("record_status", Constant.RECORD_STATUS_ADD); //琛ュ綍鍗曞瓙鐨勫崟瀛�
 
         return inoutRecordMapper.selectCount(queryWrapper);
     }
 
     /**
      * 鎵嬪姩琛ュ崟
+     *
      * @param data
      * @return
      */
@@ -188,7 +217,7 @@
         //琛ュ崟鏁版嵁鐩存帴鍒扮粨鏋滅姸鎬�
         data.setRecordStatus(Constant.RECORD_STATUS_ADD);
         data.setProgress(Constant.PROGRESS_RECORD);
-        if(null != data.getPerWet() && data.getPerWet() > 0){
+        if (null != data.getPerWet() && data.getPerWet() > 0) {
             data.setCheckStatus(Constant.STATUS_CHECK);
         }
         String loginUser = ContextUtil.getLoginUserName();
@@ -230,6 +259,24 @@
     /**
      * 鏂板鍑哄叆搴撹褰�
      *
+     * @param list
+     * @return
+     */
+    public String addInoutRecordList(List<InoutRecord> list) {
+        if (null == list || list.isEmpty()) {
+            return "鏂板澶辫触";
+        }
+
+        for (InoutRecord inoutRecord : list) {
+            addInoutRecord(inoutRecord);
+        }
+
+        return null;
+    }
+
+    /**
+     * 鏂板鍑哄叆搴撹褰�
+     *
      * @param data
      * @return
      */
@@ -241,7 +288,7 @@
                 data.setId("R_" + id);
             } else if (Constant.TYPE_OUT.equals(data.getType())) {
                 data.setId("C_" + id);
-            }else {
+            } else {
                 data.setId("M_" + id);
             }
         }
@@ -252,9 +299,9 @@
 
         int num = inoutRecordMapper.insert(data);
         //TODO 鏇存柊缂撳瓨
-        //updateInoutCache(data);
+
         return num;
-        
+
     }
 
     /**
@@ -276,7 +323,241 @@
     }
 
     /**
+     * 鏁版嵁淇敼锛屼繚鐣欎慨鏀硅褰�
+     *
+     * @param updateData
+     * @return
+     */
+    public int checkAndUpdate(InoutRecord updateData) {
+
+        //鑾峰彇鍘熸潵鐨勬暟鎹�
+        InoutParam param = new InoutParam();
+        param.setId(updateData.getId());
+        InoutRecord record = this.selectOne(param);
+
+        String updateLog = checkRemarks(updateData, record);
+        updateData.setUpdateLog(updateLog);
+
+        return updateInoutRecord(updateData);
+    }
+
+    /**
+     * 鏍¢獙淇敼淇℃伅
+     *
+     * @param updateData 淇敼鏁版嵁
+     * @param record     鍘熷鏁版嵁
+     * @return
+     */
+    public String checkRemarks(InoutRecord updateData, InoutRecord record) {
+
+        String updateLog0 = "銆�" + ContextUtil.getLoginUserName() + "銆戜簬[" + DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss") + "]淇敼鏁版嵁锛�";
+        String updateLog = "";
+
+        boolean updateTag = false;
+        //鏍¢獙浠撳簱淇℃伅
+        if (null != updateData.getDepotId() && null != record.getDepotId()) {
+            updateTag = !updateData.getDepotId().equals(record.getDepotId());
+            if (updateTag) {
+                updateLog += "[浠撳簱缂栫爜](" + record.getDepotId() + ")淇敼涓�(" + updateData.getDepotId() + "),";
+            }
+        }
+
+        //鏍¢獙鍝佺淇℃伅
+        if (null != updateData.getFoodVariety() && null != record.getFoodVariety()) {
+            updateTag = !updateData.getFoodVariety().equals(record.getFoodVariety());
+            if (updateTag) {
+                updateLog += "[鍝佺](" + FoodVariety.getMsg(record.getFoodVariety()) + ")淇敼涓�(" + FoodVariety.getMsg(updateData.getFoodVariety()) + "),";
+            }
+        }
+
+        //绮浜у湴
+        if (null != updateData.getFoodLocation() && null != record.getFoodLocation()) {
+            updateTag = !updateData.getFoodLocation().equals(record.getFoodLocation());
+            if (updateTag) {
+                updateLog += "[绮浜у湴](" + record.getFoodLocation() + ")淇敼涓�(" + updateData.getFoodLocation() + "),";
+            }
+        }
+
+        //绮绛夌骇
+        if (null != updateData.getFoodLevel() && null != record.getFoodLevel()) {
+            updateTag = !updateData.getFoodLevel().equals(record.getFoodLevel());
+            if (updateTag) {
+                updateLog += "[绮绛夌骇](" + FoodLevel.getMsg(record.getFoodLevel()) + ")淇敼涓�(" + FoodLevel.getMsg(updateData.getFoodLevel()) + "),";
+            }
+        }
+
+        //绮骞翠唤
+        if (null != updateData.getFoodYear() && null != record.getFoodYear()) {
+            updateTag = !updateData.getFoodYear().equals(record.getFoodYear());
+            if (updateTag) {
+                updateLog += "[绮骞翠唤](" + record.getFoodYear() + ")淇敼涓�(" + updateData.getFoodYear() + "),";
+            }
+        }
+
+        //鎵胯繍浜�
+        if (null != updateData.getUserName() && null != record.getUserName()) {
+            updateTag = !updateData.getUserName().equals(record.getUserName());
+            if (updateTag) {
+                updateLog += "[鎵胯繍浜篯(" + record.getUserName() + ")淇敼涓�(" + updateData.getUserName() + "),";
+            }
+        }
+
+        //鏍¢獙閫氱煡鍗曚俊鎭�
+        if (null != updateData.getNoticeId() && null != record.getNoticeId()) {
+            updateTag = !updateData.getNoticeId().equals(record.getNoticeId());
+            if (updateTag) {
+                updateLog += "[閫氱煡鍗曠紪鐮乚(" + record.getNoticeId() + ")淇敼涓�(" + updateData.getNoticeId() + "),";
+            }
+        }
+
+        //鏍¢獙寰�鏉ュ崟浣嶄俊鎭�
+        if (null != updateData.getCustomerName() && null != record.getCustomerName()) {
+            updateTag = !updateData.getCustomerName().equals(record.getCustomerName());
+            if (updateTag) {
+                updateLog += "[寰�鏉ュ崟浣峕(" + record.getCustomerName() + ")淇敼涓�(" + updateData.getCustomerName() + "),";
+            }
+        }
+
+        //鍗曚环
+        if (null != updateData.getPrice() && null != record.getPrice()) {
+            updateTag = !updateData.getPrice().equals(record.getPrice());
+            if (updateTag) {
+                updateLog += "[鍗曚环](" + record.getPrice() + ")淇敼涓�(" + updateData.getPrice() + "),";
+            }
+        }
+
+        //缁撶畻閲戦
+        if (null != updateData.getSettleMoney() && null != record.getSettleMoney()) {
+            updateTag = !updateData.getSettleMoney().equals(record.getSettleMoney());
+            if (updateTag) {
+                updateLog += "[缁撶畻閲戦](" + record.getSettleMoney() + ")淇敼涓�(" + updateData.getSettleMoney() + "),";
+            }
+        }
+
+        //姘村垎
+        if (null != updateData.getPerWet() && null != record.getPerWet()) {
+            updateTag = !updateData.getPerWet().equals(record.getPerWet());
+            if (updateTag) {
+                updateLog += "[姘村垎](" + record.getPerWet() + ")淇敼涓�(" + updateData.getPerWet() + "),";
+            }
+        }
+
+        //鏉傝川
+        if (null != updateData.getPerImpurity() && null != record.getPerImpurity()) {
+            updateTag = !updateData.getPerImpurity().equals(record.getPerImpurity());
+            if (updateTag) {
+                updateLog += "[鏉傝川](" + record.getPerImpurity() + ")淇敼涓�(" + updateData.getPerImpurity() + "),";
+            }
+        }
+
+        //姣涢噸
+        if (null != updateData.getFullWeight() && null != record.getFullWeight()) {
+            updateTag = !updateData.getFullWeight().equals(record.getFullWeight());
+            if (updateTag) {
+                updateLog += "[姣涢噸](" + record.getFullWeight() + ")淇敼涓�(" + updateData.getFullWeight() + "),";
+            }
+        }
+
+        //鐨噸
+        if (null != updateData.getEmptyWeight() && null != record.getEmptyWeight()) {
+            updateTag = !updateData.getEmptyWeight().equals(record.getEmptyWeight());
+            if (updateTag) {
+                updateLog += "[鐨噸](" + record.getEmptyWeight() + ")淇敼涓�(" + updateData.getEmptyWeight() + "),";
+            }
+        }
+
+        //鎵i噸
+        if (null != updateData.getDeOther() && null != record.getDeOther()) {
+            updateTag = !updateData.getDeOther().equals(record.getDeOther());
+            if (updateTag) {
+                updateLog += "[鎵i噸](" + record.getDeOther() + ")淇敼涓�(" + updateData.getDeOther() + "),";
+            }
+        }
+
+        //缁撶畻閲嶉噺
+        if (null != updateData.getSettleWeight() && null != record.getSettleWeight()) {
+            updateTag = !updateData.getSettleWeight().equals(record.getSettleWeight());
+            if (updateTag) {
+                updateLog += "[缁撶畻閲嶉噺](" + record.getSettleWeight() + ")淇敼涓�(" + updateData.getSettleWeight() + "),";
+            }
+        }
+
+        //鍑哄叆搴撻噸閲�
+        if (null != updateData.getRecordWeight() && null != record.getRecordWeight()) {
+            updateTag = !updateData.getRecordWeight().equals(record.getRecordWeight());
+            if (updateTag) {
+                updateLog += "[鍑哄叆搴撻噸閲廬(" + record.getRecordWeight() + ")淇敼涓�(" + updateData.getRecordWeight() + "),";
+            }
+        }
+
+        //鐧昏鏃堕棿
+        if (null != updateData.getRegisterTime() && null != record.getRegisterTime()) {
+            updateTag = !updateData.getRegisterTime().equals(record.getRegisterTime());
+            if (updateTag) {
+                updateLog += "[鐧昏鏃堕棿](" + DateFormatUtils.format(record.getRegisterTime(), "yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getRegisterTime(), "yyyy-MM-dd HH:mm:ss") + "),";
+            }
+        }
+
+        //婊¤溅鏃堕棿
+        if (null != updateData.getFullWeightTime() && null != record.getFullWeightTime()) {
+            updateTag = !updateData.getFullWeightTime().equals(record.getFullWeightTime());
+            if (updateTag) {
+                updateLog += "[婊¤溅鏃堕棿](" + DateFormatUtils.format(record.getFullWeightTime(), "yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getFullWeightTime(), "yyyy-MM-dd HH:mm:ss") + "),";
+            }
+        }
+
+        //绌鸿溅鏃堕棿
+        if (null != updateData.getEmptyWeightTime() && null != record.getEmptyWeightTime()) {
+            updateTag = !updateData.getEmptyWeightTime().equals(record.getEmptyWeightTime());
+            if (updateTag) {
+                updateLog += "[绌鸿溅鏃堕棿](" + DateFormatUtils.format(record.getEmptyWeightTime(), "yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getEmptyWeightTime(), "yyyy-MM-dd HH:mm:ss") + "),";
+            }
+        }
+
+        //瀹屾垚鏃堕棿
+        if (null != updateData.getCompleteTime() && null != record.getCompleteTime()) {
+            updateTag = !updateData.getCompleteTime().equals(record.getCompleteTime());
+            if (updateTag) {
+                updateLog += "[瀹屾垚鏃堕棿](" + DateFormatUtils.format(record.getCompleteTime(), "yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getCompleteTime(), "yyyy-MM-dd HH:mm:ss") + "),";
+            }
+        }
+
+        //婊¤溅绉伴噸浜�
+        if (null != updateData.getFullWeightUser() && null != record.getFullWeightUser()) {
+            updateTag = !updateData.getFullWeightUser().equals(record.getFullWeightUser());
+            if (updateTag) {
+                updateLog += "[婊¤溅绉伴噸浜篯(" + record.getFullWeightUser() + ")淇敼涓�(" + updateData.getFullWeightUser() + "),";
+            }
+        }
+
+        //绌鸿溅绉伴噸浜�
+        if (null != updateData.getEmptyWeightUser() && null != record.getEmptyWeightUser()) {
+            updateTag = !updateData.getEmptyWeightUser().equals(record.getEmptyWeightUser());
+            if (updateTag) {
+                updateLog += "[绌鸿溅绉伴噸浜篯(" + record.getEmptyWeightUser() + ")淇敼涓�(" + updateData.getEmptyWeightUser() + "),";
+            }
+        }
+
+        //澶囨敞璇存槑
+        if (null != updateData.getRemarks() && null != record.getRemarks()) {
+            updateTag = !updateData.getRemarks().equals(record.getRemarks());
+            if (updateTag) {
+                updateLog += "[澶囨敞璇存槑](" + record.getRemarks() + ")淇敼涓�(" + updateData.getRemarks() + "),";
+            }
+        }
+
+        if (StringUtils.isBlank(updateLog)) {
+            return record.getUpdateLog() == null ? "" : record.getUpdateLog();
+        }
+
+        updateLog0 = updateLog0 + updateLog;
+
+        return record.getUpdateLog() == null ? updateLog0 : (record.getUpdateLog() + "锛�" + updateLog0);
+    }
+
+    /**
      * 寮傚父缁堟
+     *
      * @param data
      * @return
      */
@@ -300,15 +581,16 @@
 
         //TODO 鍒犻櫎缂撳瓨
 
-        if(i > 0){
+        if (i > 0) {
             return null;
-        }else {
+        } else {
             return "鎿嶄綔澶辫触锛�";
         }
     }
 
     /**
      * 鍑哄叆搴撴祦绋婭D鍒涘缓 202001030001 202001030001
+     *
      * @param registerTime
      * @param companyId
      * @return
@@ -372,6 +654,7 @@
 
     /**
      * 鏌ヨ鏈�澶d鍙凤紝涓虹┖鍒欒繑鍥瀗ull
+     *
      * @param companyId
      * @param timeKey
      * @return
@@ -388,9 +671,9 @@
         queryWrapper.orderByDesc("create_time");
 
         List<InoutRecord> inoutRecords = inoutRecordMapper.selectList(queryWrapper);
-        if(null == inoutRecords || inoutRecords.isEmpty()){
+        if (null == inoutRecords || inoutRecords.isEmpty()) {
             return null;
-        }else {
+        } else {
             return inoutRecords.get(0).getId();
         }
     }
@@ -404,10 +687,10 @@
     public String inWeightBill(InoutRecord data) {
 
         // 鑾峰彇琛ㄥ崟鏁版嵁
-        InoutPrintBill bill = this.createBillData(data, "鍏ュ簱鍒掔爜鍗�");
+        InoutPrintBill bill = this.createBillData(data, "鍏ュ簱鍗�");
 
         // 璋冩暣妯$増鏁版嵁骞惰繑鍥�
-        String htmlStr = InoutBill.IN_WEIGHT_DEFAULT;
+        String htmlStr = InoutBill.IN_WEIGHT_DEFAULT_NEW;
 
         htmlStr = htmlStr.replace("billTitle", bill.getBillTitle());
 
@@ -456,7 +739,7 @@
         htmlStr = htmlStr.replace("impurity", bill.getImpurity() + "");
 
         htmlStr = htmlStr.replace("checkStatus", bill.getCheckStatus());
-        htmlStr = htmlStr.replace("remark", bill.getRemark());
+        htmlStr = htmlStr.replace("remark", "");
         htmlStr = htmlStr.replace("moneyName", bill.getMoneyName());
 
         htmlStr = htmlStr.replace("unitName", bill.getUnitName());
@@ -465,7 +748,7 @@
         htmlStr = htmlStr.replace("handleEnd", "");
         htmlStr = htmlStr.replace("noticeId", bill.getNoticeId() == null ? "" : bill.getNoticeId());
         htmlStr = htmlStr.replace("phone", data.getUserContact() == null ? "" : data.getUserContact() + "");
-        htmlStr = htmlStr.replace("printTime", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"));
+        htmlStr = htmlStr.replace("printTime", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
 
         htmlStr = htmlStr.replaceAll("weightUser",
                 bill.getWeightUser() == null ? "" : bill.getWeightUser());
@@ -473,7 +756,7 @@
                 bill.getHandleUser() == null ? "" : bill.getHandleUser());
         htmlStr = htmlStr.replaceAll("keeperName",
                 bill.getKeeperUser() == null ? "" : bill.getKeeperUser());
-
+        htmlStr = htmlStr.replaceAll("createUser",ContextUtil.getLoginUserName());
 
         return htmlStr;
     }
@@ -486,10 +769,10 @@
      */
     public String outWeightBill(InoutRecord data) {
         // 鑾峰彇琛ㄥ崟鏁版嵁
-        InoutPrintBill bill = this.createBillData(data, "鍑哄簱鍒掔爜鍗�");
+        InoutPrintBill bill = this.createBillData(data, "鍑哄簱鍗�");
 
         //榛樿妯$増
-        String htmlStr = InoutBill.OUT_WEIGHT_DEFAULT;
+        String htmlStr = InoutBill.OUT_WEIGHT_DEFAULT_NEW;
 
         htmlStr = htmlStr.replace("billTitle", bill.getBillTitle());
 
@@ -519,7 +802,7 @@
                 new DecimalFormat("0.00").format(bill.getNetWeight()));
         htmlStr = htmlStr.replace("dePackage",
                 new DecimalFormat("0.00").format(bill.getDePackage()));
-        htmlStr = htmlStr.replace("remark", bill.getRemark());
+        htmlStr = htmlStr.replace("remark", "");
 
         htmlStr = htmlStr.replace("settleWeight",
                 new DecimalFormat("0.00").format(bill.getSettleWeight()));
@@ -538,11 +821,13 @@
         htmlStr = htmlStr.replace("handleEnd", "");
         htmlStr = htmlStr.replace("noticeId", bill.getNoticeId() == null ? "" : bill.getNoticeId());
         htmlStr = htmlStr.replace("phone", data.getUserContact() == null ? "" : data.getUserContact() + "");
-        htmlStr = htmlStr.replace("printTime", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"));
+        htmlStr = htmlStr.replace("printTime", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
 
         htmlStr = htmlStr.replaceAll("weightUser", getValue(bill.getWeightUser()));
         htmlStr = htmlStr.replace("handleUser", getValue(bill.getHandleUser()));
         htmlStr = htmlStr.replaceAll("keeperName", getValue(bill.getKeeperUser()));
+        htmlStr = htmlStr.replaceAll("createUser",ContextUtil.getLoginUserName());
+
         return htmlStr;
     }
 
@@ -578,13 +863,13 @@
             data.setRegisterTime(new Date());
         }
         bill.setRegisterTime(DateFormatUtils.format(data.getRegisterTime(),
-                "yyyy-MM-dd HH:mm"));
+                "yyyy-MM-dd HH:mm:ss"));
 
         if (null == data.getCompleteTime()) {
             data.setCompleteTime(new Date());
         }
         bill.setCompleteTime(DateFormatUtils.format(data.getCompleteTime(),
-                "yyyy-MM-dd HH:mm"));
+                "yyyy-MM-dd HH:mm:ss"));
 
         bill.setEmptyTime(DateFormatUtils.format(data.getEmptyWeightTime(),
                 "yyyy-MM-dd HH:mm:ss"));
@@ -638,7 +923,7 @@
                 data.setSettleMoney(NumberUtil.keepPrecision(data.getPrice() * data.getRecordWeight(), 2));
             }
         }
-        bill.setSettleMoney(data.getSettleMoney() == null ? "" : data.getSettleMoney() + "");
+        bill.setSettleMoney(data.getSettleMoney() == null ? "" : String.format("%.2f", data.getSettleMoney()));
         bill.setRemark(data.getRemarks() == null ? "" : data.getRemarks());
 
         if (Constant.TYPE_IN.equals(data.getType())) {

--
Gitblit v1.9.3