From 1eddf64a7104dcd06065e8ac309eebc42c24fb05 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期五, 27 三月 2026 14:29:56 +0800
Subject: [PATCH] 出入库记录导入,判重兜底校验纠正

---
 fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutRecordService.java |  257 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 156 insertions(+), 101 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 fed06e6..d4b0335 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,6 +4,7 @@
 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;
@@ -23,7 +24,6 @@
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.beans.BeanUtils;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -136,26 +136,27 @@
             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;
+        if (StringUtils.isBlank(timeType)) {
+            return null;
         }
 
         QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>();
@@ -262,7 +263,7 @@
      * @return
      */
     public String addInoutRecordList(List<InoutRecord> list) {
-        if(null == list || list.isEmpty()){
+        if (null == list || list.isEmpty()) {
             return "鏂板澶辫触";
         }
 
@@ -323,6 +324,7 @@
 
     /**
      * 鏁版嵁淇敼锛屼繚鐣欎慨鏀硅褰�
+     *
      * @param updateData
      * @return
      */
@@ -333,220 +335,224 @@
         param.setId(updateData.getId());
         InoutRecord record = this.selectOne(param);
 
-        String remarks = checkRemarks(updateData, record);
-        updateData.setRemarks(remarks);
+        String updateLog = checkRemarks(updateData, record);
+        updateData.setUpdateLog(updateLog);
 
         return updateInoutRecord(updateData);
     }
 
     /**
      * 鏍¢獙淇敼淇℃伅
-     * @param updateData  淇敼鏁版嵁
-     * @param record      鍘熷鏁版嵁
+     *
+     * @param updateData 淇敼鏁版嵁
+     * @param record     鍘熷鏁版嵁
      * @return
      */
     public String checkRemarks(InoutRecord updateData, InoutRecord record) {
 
-        String remarks = "銆�" + ContextUtil.getLoginUserName() + "銆戜簬["+DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")+"]淇敼鏁版嵁锛�";
+        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()){
+        if (null != updateData.getDepotId() && null != record.getDepotId()) {
             updateTag = !updateData.getDepotId().equals(record.getDepotId());
-            if(updateTag){
-                remarks += "[浠撳簱缂栫爜](" + record.getDepotId() + ")淇敼涓�(" + updateData.getDepotId() + "),";
+            if (updateTag) {
+                updateLog += "[浠撳簱缂栫爜](" + record.getDepotId() + ")淇敼涓�(" + updateData.getDepotId() + "),";
             }
         }
 
         //鏍¢獙鍝佺淇℃伅
-        if(null != updateData.getFoodVariety() && null != record.getFoodVariety()){
+        if (null != updateData.getFoodVariety() && null != record.getFoodVariety()) {
             updateTag = !updateData.getFoodVariety().equals(record.getFoodVariety());
-            if(updateTag){
-                remarks += "[鍝佺](" + record.getFoodVariety() + ")淇敼涓�(" + updateData.getFoodVariety() + "),";
+            if (updateTag) {
+                updateLog += "[鍝佺](" + FoodVariety.getMsg(record.getFoodVariety()) + ")淇敼涓�(" + FoodVariety.getMsg(updateData.getFoodVariety()) + "),";
             }
         }
 
         //绮浜у湴
-        if(null != updateData.getFoodLocation() && null != record.getFoodLocation()){
+        if (null != updateData.getFoodLocation() && null != record.getFoodLocation()) {
             updateTag = !updateData.getFoodLocation().equals(record.getFoodLocation());
-            if(updateTag){
-                remarks += "[绮浜у湴](" + record.getFoodLocation() + ")淇敼涓�(" + updateData.getFoodLocation() + "),";
+            if (updateTag) {
+                updateLog += "[绮浜у湴](" + record.getFoodLocation() + ")淇敼涓�(" + updateData.getFoodLocation() + "),";
             }
         }
 
         //绮绛夌骇
-        if(null != updateData.getFoodLevel() && null != record.getFoodLevel()){
+        if (null != updateData.getFoodLevel() && null != record.getFoodLevel()) {
             updateTag = !updateData.getFoodLevel().equals(record.getFoodLevel());
-            if(updateTag){
-                remarks += "[绮绛夌骇](" + record.getFoodLevel() + ")淇敼涓�(" + updateData.getFoodLevel() + "),";
+            if (updateTag) {
+                updateLog += "[绮绛夌骇](" + FoodLevel.getMsg(record.getFoodLevel()) + ")淇敼涓�(" + FoodLevel.getMsg(updateData.getFoodLevel()) + "),";
             }
         }
 
         //绮骞翠唤
-        if(null != updateData.getFoodYear() && null != record.getFoodYear()){
+        if (null != updateData.getFoodYear() && null != record.getFoodYear()) {
             updateTag = !updateData.getFoodYear().equals(record.getFoodYear());
-            if(updateTag){
-                remarks += "[绮骞翠唤](" + record.getFoodYear() + ")淇敼涓�(" + updateData.getFoodYear() + "),";
+            if (updateTag) {
+                updateLog += "[绮骞翠唤](" + record.getFoodYear() + ")淇敼涓�(" + updateData.getFoodYear() + "),";
             }
         }
 
         //鎵胯繍浜�
-        if(null != updateData.getUserName() && null != record.getUserName()){
+        if (null != updateData.getUserName() && null != record.getUserName()) {
             updateTag = !updateData.getUserName().equals(record.getUserName());
-            if(updateTag){
-                remarks += "[鎵胯繍浜篯(" + record.getUserName() + ")淇敼涓�(" + updateData.getUserName() + "),";
+            if (updateTag) {
+                updateLog += "[鎵胯繍浜篯(" + record.getUserName() + ")淇敼涓�(" + updateData.getUserName() + "),";
             }
         }
 
         //鏍¢獙閫氱煡鍗曚俊鎭�
-        if(null != updateData.getNoticeId() && null != record.getNoticeId()){
+        if (null != updateData.getNoticeId() && null != record.getNoticeId()) {
             updateTag = !updateData.getNoticeId().equals(record.getNoticeId());
-            if(updateTag){
-                remarks += "[閫氱煡鍗曠紪鐮乚(" + record.getNoticeId() + ")淇敼涓�(" + updateData.getNoticeId() + "),";
+            if (updateTag) {
+                updateLog += "[閫氱煡鍗曠紪鐮乚(" + record.getNoticeId() + ")淇敼涓�(" + updateData.getNoticeId() + "),";
             }
         }
 
         //鏍¢獙寰�鏉ュ崟浣嶄俊鎭�
-        if(null != updateData.getCustomerName() && null != record.getCustomerName()){
+        if (null != updateData.getCustomerName() && null != record.getCustomerName()) {
             updateTag = !updateData.getCustomerName().equals(record.getCustomerName());
-            if(updateTag){
-                remarks += "[寰�鏉ュ崟浣峕(" + record.getCustomerName() + ")淇敼涓�(" + updateData.getCustomerName() + "),";
+            if (updateTag) {
+                updateLog += "[寰�鏉ュ崟浣峕(" + record.getCustomerName() + ")淇敼涓�(" + updateData.getCustomerName() + "),";
             }
         }
 
         //鍗曚环
-        if(null != updateData.getPrice() && null != record.getPrice()){
+        if (null != updateData.getPrice() && null != record.getPrice()) {
             updateTag = !updateData.getPrice().equals(record.getPrice());
-            if(updateTag){
-                remarks += "[鍗曚环](" + record.getPrice() + ")淇敼涓�(" + updateData.getPrice() + "),";
+            if (updateTag) {
+                updateLog += "[鍗曚环](" + record.getPrice() + ")淇敼涓�(" + updateData.getPrice() + "),";
             }
         }
 
         //缁撶畻閲戦
-        if(null != updateData.getSettleMoney() && null != record.getSettleMoney()){
+        if (null != updateData.getSettleMoney() && null != record.getSettleMoney()) {
             updateTag = !updateData.getSettleMoney().equals(record.getSettleMoney());
-            if(updateTag){
-                remarks += "[缁撶畻閲戦](" + record.getSettleMoney() + ")淇敼涓�(" + updateData.getSettleMoney() + "),";
+            if (updateTag) {
+                updateLog += "[缁撶畻閲戦](" + record.getSettleMoney() + ")淇敼涓�(" + updateData.getSettleMoney() + "),";
             }
         }
 
         //姘村垎
-        if(null != updateData.getPerWet() && null != record.getPerWet()){
+        if (null != updateData.getPerWet() && null != record.getPerWet()) {
             updateTag = !updateData.getPerWet().equals(record.getPerWet());
-            if(updateTag){
-                remarks += "[姘村垎](" + record.getPerWet() + ")淇敼涓�(" + updateData.getPerWet() + "),";
+            if (updateTag) {
+                updateLog += "[姘村垎](" + record.getPerWet() + ")淇敼涓�(" + updateData.getPerWet() + "),";
             }
         }
 
         //鏉傝川
-        if(null != updateData.getPerImpurity() && null != record.getPerImpurity()){
+        if (null != updateData.getPerImpurity() && null != record.getPerImpurity()) {
             updateTag = !updateData.getPerImpurity().equals(record.getPerImpurity());
-            if(updateTag){
-                remarks += "[鏉傝川](" + record.getPerImpurity() + ")淇敼涓�(" + updateData.getPerImpurity() + "),";
+            if (updateTag) {
+                updateLog += "[鏉傝川](" + record.getPerImpurity() + ")淇敼涓�(" + updateData.getPerImpurity() + "),";
             }
         }
 
         //姣涢噸
-        if(null != updateData.getFullWeight() && null != record.getFullWeight()){
+        if (null != updateData.getFullWeight() && null != record.getFullWeight()) {
             updateTag = !updateData.getFullWeight().equals(record.getFullWeight());
-            if(updateTag){
-                remarks += "[姣涢噸](" + record.getFullWeight() + ")淇敼涓�(" + updateData.getFullWeight() + "),";
+            if (updateTag) {
+                updateLog += "[姣涢噸](" + record.getFullWeight() + ")淇敼涓�(" + updateData.getFullWeight() + "),";
             }
         }
 
         //鐨噸
-        if(null != updateData.getEmptyWeight() && null != record.getEmptyWeight()){
+        if (null != updateData.getEmptyWeight() && null != record.getEmptyWeight()) {
             updateTag = !updateData.getEmptyWeight().equals(record.getEmptyWeight());
-            if(updateTag){
-                remarks += "[鐨噸](" + record.getEmptyWeight() + ")淇敼涓�(" + updateData.getEmptyWeight() + "),";
+            if (updateTag) {
+                updateLog += "[鐨噸](" + record.getEmptyWeight() + ")淇敼涓�(" + updateData.getEmptyWeight() + "),";
             }
         }
 
         //鎵i噸
-        if(null != updateData.getDeOther() && null != record.getDeOther()){
+        if (null != updateData.getDeOther() && null != record.getDeOther()) {
             updateTag = !updateData.getDeOther().equals(record.getDeOther());
-            if(updateTag){
-                remarks += "[鎵i噸](" + record.getDeOther() + ")淇敼涓�(" + updateData.getDeOther() + "),";
+            if (updateTag) {
+                updateLog += "[鎵i噸](" + record.getDeOther() + ")淇敼涓�(" + updateData.getDeOther() + "),";
             }
         }
 
         //缁撶畻閲嶉噺
-        if(null != updateData.getSettleWeight() && null != record.getSettleWeight()){
+        if (null != updateData.getSettleWeight() && null != record.getSettleWeight()) {
             updateTag = !updateData.getSettleWeight().equals(record.getSettleWeight());
-            if(updateTag){
-                remarks += "[缁撶畻閲嶉噺](" + record.getSettleWeight() + ")淇敼涓�(" + updateData.getSettleWeight() + "),";
+            if (updateTag) {
+                updateLog += "[缁撶畻閲嶉噺](" + record.getSettleWeight() + ")淇敼涓�(" + updateData.getSettleWeight() + "),";
             }
         }
 
         //鍑哄叆搴撻噸閲�
-        if(null != updateData.getRecordWeight() && null != record.getRecordWeight()){
+        if (null != updateData.getRecordWeight() && null != record.getRecordWeight()) {
             updateTag = !updateData.getRecordWeight().equals(record.getRecordWeight());
-            if(updateTag){
-                remarks += "[鍑哄叆搴撻噸閲廬(" + record.getRecordWeight() + ")淇敼涓�(" + updateData.getRecordWeight() + "),";
+            if (updateTag) {
+                updateLog += "[鍑哄叆搴撻噸閲廬(" + record.getRecordWeight() + ")淇敼涓�(" + updateData.getRecordWeight() + "),";
             }
         }
 
         //鐧昏鏃堕棿
-        if(null != updateData.getRegisterTime() && null != record.getRegisterTime()){
+        if (null != updateData.getRegisterTime() && null != record.getRegisterTime()) {
             updateTag = !updateData.getRegisterTime().equals(record.getRegisterTime());
-            if(updateTag){
-                remarks += "[鐧昏鏃堕棿](" + DateFormatUtils.format(record.getRegisterTime(),"yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getRegisterTime(),"yyyy-MM-dd HH:mm:ss") + "),";
+            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()){
+        if (null != updateData.getFullWeightTime() && null != record.getFullWeightTime()) {
             updateTag = !updateData.getFullWeightTime().equals(record.getFullWeightTime());
-            if(updateTag){
-                remarks += "[婊¤溅鏃堕棿](" + DateFormatUtils.format(record.getFullWeightTime(),"yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getFullWeightTime(),"yyyy-MM-dd HH:mm:ss") + "),";
+            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()){
+        if (null != updateData.getEmptyWeightTime() && null != record.getEmptyWeightTime()) {
             updateTag = !updateData.getEmptyWeightTime().equals(record.getEmptyWeightTime());
-            if(updateTag){
-                remarks += "[绌鸿溅鏃堕棿](" + DateFormatUtils.format(record.getEmptyWeightTime(),"yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getEmptyWeightTime(),"yyyy-MM-dd HH:mm:ss") + "),";
+            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()){
+        if (null != updateData.getCompleteTime() && null != record.getCompleteTime()) {
             updateTag = !updateData.getCompleteTime().equals(record.getCompleteTime());
-            if(updateTag){
-                remarks += "[瀹屾垚鏃堕棿](" + DateFormatUtils.format(record.getCompleteTime(),"yyyy-MM-dd HH:mm:ss") + ")淇敼涓�(" + DateFormatUtils.format(updateData.getCompleteTime(),"yyyy-MM-dd HH:mm:ss") + "),";
+            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()){
+        if (null != updateData.getFullWeightUser() && null != record.getFullWeightUser()) {
             updateTag = !updateData.getFullWeightUser().equals(record.getFullWeightUser());
-            if(updateTag){
-                remarks += "[婊¤溅绉伴噸浜篯(" + record.getFullWeightUser() + ")淇敼涓�(" + updateData.getFullWeightUser() + "),";
+            if (updateTag) {
+                updateLog += "[婊¤溅绉伴噸浜篯(" + record.getFullWeightUser() + ")淇敼涓�(" + updateData.getFullWeightUser() + "),";
             }
         }
 
         //绌鸿溅绉伴噸浜�
-        if(null != updateData.getEmptyWeightUser() && null != record.getEmptyWeightUser()){
+        if (null != updateData.getEmptyWeightUser() && null != record.getEmptyWeightUser()) {
             updateTag = !updateData.getEmptyWeightUser().equals(record.getEmptyWeightUser());
-            if(updateTag){
-                remarks += "[绌鸿溅绉伴噸浜篯(" + record.getEmptyWeightUser() + ")淇敼涓�(" + updateData.getEmptyWeightUser() + "),";
+            if (updateTag) {
+                updateLog += "[绌鸿溅绉伴噸浜篯(" + record.getEmptyWeightUser() + ")淇敼涓�(" + updateData.getEmptyWeightUser() + "),";
             }
         }
 
         //澶囨敞璇存槑
-        if(null != updateData.getRemarks() && null != record.getRemarks()){
+        if (null != updateData.getRemarks() && null != record.getRemarks()) {
             updateTag = !updateData.getRemarks().equals(record.getRemarks());
-            if(updateTag){
-                remarks += "[澶囨敞璇存槑](" + record.getRemarks() + ")淇敼涓�(" + updateData.getRemarks() + "),";
+            if (updateTag) {
+                updateLog += "[澶囨敞璇存槑](" + record.getRemarks() + ")淇敼涓�(" + updateData.getRemarks() + "),";
             }
         }
 
-        if(StringUtils.isNotBlank(record.getRemarks())){
-            remarks = record.getRemarks() + ";" + remarks;
+        if (StringUtils.isBlank(updateLog)) {
+            return record.getUpdateLog() == null ? "" : record.getUpdateLog();
         }
 
-        return remarks;
+        updateLog0 = updateLog0 + updateLog;
+
+        return record.getUpdateLog() == null ? updateLog0 : (record.getUpdateLog() + "锛�" + updateLog0);
     }
 
     /**
@@ -640,10 +646,57 @@
             }
         }
 
+
+        // 鏁版嵁搴� ID 閲嶅鏍¢獙锛岀‘淇濇柊鐢熸垚鐨� ID 鍦ㄦ暟鎹簱涓笉瀛樺湪
+        while (this.checkIdExists(companyId, cacheId)) {
+            String temp = cacheId.substring(cacheId.length() - 4);
+            Integer i = Integer.valueOf(temp);
+            i++;
+            temp = String.valueOf(i);
+            if (temp.length() == 1) {
+                cacheId = timeKey + "000" + temp;
+            }
+            if (temp.length() == 2) {
+                cacheId = timeKey + "00" + temp;
+            }
+            if (temp.length() == 3) {
+                cacheId = timeKey + "0" + temp;
+            }
+            if (temp.length() == 4) {
+                cacheId = timeKey + temp;
+            }
+        }
+
         // 鏇存柊缂撳瓨
         redisCache.setCacheObject(cacheKey, cacheId);
 
         return cacheId;
+    }
+
+    /**
+     * 妫�鏌� ID 鏄惁鍦ㄦ暟鎹簱涓凡瀛樺湪
+     *
+     * @param companyId
+     * @param id
+     * @return true-宸插瓨鍦紝false-涓嶅瓨鍦�
+     */
+    public boolean checkIdExists(String companyId, String id) {
+        QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("company_id", companyId);
+        queryWrapper.and(wrapper ->
+                wrapper.eq("id", id)
+                        .or()
+                        .eq("id", "R_" + id)
+                        .or()
+                        .eq("id", "C_" + id)
+                        .or()
+                        .eq("id", "M_" + id)
+        );
+        List<InoutRecord> inoutRecords = inoutRecordMapper.selectList(queryWrapper);
+        if( null != inoutRecords && inoutRecords.size() > 0){
+            return true;
+        }
+        return false;
     }
 
     /**
@@ -662,8 +715,8 @@
 
         queryWrapper.eq("company_id", companyId);
         queryWrapper.like("id", timeKey);
-        queryWrapper.orderByDesc("create_time");
-
+        queryWrapper.orderByDesc("register_time");
+        queryWrapper.orderByDesc("id");
         List<InoutRecord> inoutRecords = inoutRecordMapper.selectList(queryWrapper);
         if (null == inoutRecords || inoutRecords.isEmpty()) {
             return null;
@@ -681,10 +734,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());
 
@@ -733,7 +786,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());
@@ -742,7 +795,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());
@@ -750,7 +803,7 @@
                 bill.getHandleUser() == null ? "" : bill.getHandleUser());
         htmlStr = htmlStr.replaceAll("keeperName",
                 bill.getKeeperUser() == null ? "" : bill.getKeeperUser());
-
+        htmlStr = htmlStr.replaceAll("createUser",ContextUtil.getLoginUserName());
 
         return htmlStr;
     }
@@ -763,10 +816,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());
 
@@ -796,7 +849,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()));
@@ -815,11 +868,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;
     }
 
@@ -855,13 +910,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"));
@@ -915,7 +970,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