From 7e2a72d1a9c73320b0f4b7e7a580372f7af55e04 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期三, 16 八月 2023 10:28:24 +0800
Subject: [PATCH] 损益管理页面优化

---
 igds-inout/src/main/java/com/ld/igds/m/service/HVarietyChangeService.java |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/igds-inout/src/main/java/com/ld/igds/m/service/HVarietyChangeService.java b/igds-inout/src/main/java/com/ld/igds/m/service/HVarietyChangeService.java
index 6a8c3bc..2c4043f 100644
--- a/igds-inout/src/main/java/com/ld/igds/m/service/HVarietyChangeService.java
+++ b/igds-inout/src/main/java/com/ld/igds/m/service/HVarietyChangeService.java
@@ -79,12 +79,10 @@
 
         try {
             if (null == data.getId()) {
-                String id = createId(data.getChangeTime(), ContextUtil.getCompanyId(), data.getHwdm());
+                String id = createId(data.getChangeTime(), ContextUtil.getCompanyId());
                 data.setId(id);
-                data.setCzbz("i");
                 session.save(data);
             } else {
-                data.setCzbz("u");
                 session.update(data);
             }
         } catch (Exception e) {
@@ -141,7 +139,7 @@
         return this.query(hql, args);
     }
 
-    public String createId(Date date, String companyId, String freightId) {
+    public String createId(Date date, String companyId) {
         // 鏃堕棿鎴虫爣绛�
         String timeKey = DateFormatUtils.format(date, "yyyyMMdd");
 
@@ -151,18 +149,18 @@
 
         String cacheId = (String) redisUtil.get(cacheKey);
 
-        if (null != cacheId && cacheId.indexOf(freightId + timeKey) >= 0) {
+        if (null != cacheId && cacheId.indexOf(timeKey) >= 0) {
             String temp = cacheId.substring(cacheId.length() - 3);
             Integer i = Integer.valueOf(temp);
             i++;
-            cacheId = freightId + timeKey + String.format("%03d", i);
+            cacheId = timeKey + String.format("%03d", i);
         } else {
             Map<String, Object> args = new HashMap<>();
-            args.put("timeKey", freightId + timeKey + "%");
+            args.put("timeKey", timeKey + "%");
             List<InoutVarietyChange> result = getMaxId(args);
 
             if (null == result || result.size() == 0) {
-                cacheId = freightId + timeKey + "001";
+                cacheId = timeKey + "001";
             } else {
                 int max = 0;
                 int num;
@@ -170,7 +168,7 @@
                     num = Integer.parseInt(varietyChange.getId().substring(varietyChange.getId().length() - 3));
                     max = Math.max(max, num);
                 }
-                cacheId = freightId + timeKey + String.format("%03d", ++max);
+                cacheId = timeKey + String.format("%03d", ++max);
             }
         }
         // 鏇存柊缂撳瓨

--
Gitblit v1.9.3