From 1b60f1df51e1824154018a5b6a7159b09b44c8b1 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期一, 12 六月 2023 14:23:26 +0800
Subject: [PATCH] 化验页面--数据提交更新

---
 igds-core/src/main/java/com/ld/igds/common/impl/CommonDataServiceImpl.java |   50 +++++++++++++++++++++-----------------------------
 1 files changed, 21 insertions(+), 29 deletions(-)

diff --git a/igds-core/src/main/java/com/ld/igds/common/impl/CommonDataServiceImpl.java b/igds-core/src/main/java/com/ld/igds/common/impl/CommonDataServiceImpl.java
index 92803af..1cf5c88 100644
--- a/igds-core/src/main/java/com/ld/igds/common/impl/CommonDataServiceImpl.java
+++ b/igds-core/src/main/java/com/ld/igds/common/impl/CommonDataServiceImpl.java
@@ -7,7 +7,6 @@
 import com.ld.igds.common.dto.THDto;
 import com.ld.igds.common.mapper.CommonMapper;
 import com.ld.igds.constant.Constant;
-import com.ld.igds.constant.DepotStatus;
 import com.ld.igds.constant.RedisConst;
 import com.ld.igds.inout.InoutConstant;
 import com.ld.igds.inout.dto.InoutData;
@@ -51,7 +50,6 @@
 
     @Override
     public List<Depot> getCacheDepotList(String companyId) {
-
         String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT);
 
         Set<String> keys = redisUtil.keys(patten);
@@ -72,6 +70,7 @@
     public List<Depot> getCacheDepotList(String companyId, String deptId) {
         if (null == deptId) return null;
         String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT);
+
         Set<String> keys = redisUtil.keys(patten);
         if (null == keys) return null;
 
@@ -318,40 +317,34 @@
     @Override
     public void initInoutDepotStore(InoutData data) {
 
-        String depotStatus = DepotStatus.STATUS_03.getCode();
-        if (InoutConstant.TYPE_OUT.equals(data.getType())) {
-            depotStatus = DepotStatus.STATUS_04.getCode();
-        }
-
         //鍏堜粠缂撳瓨涓幏鍙栦笅淇℃伅锛屾煡鐪嬫槸鍚﹀凡缁忓垵濮嬪寲杩囨暟鎹紝濡傛灉鏈夊垯鐩存帴璺宠繃锛屽鏋滄病鏈夊垯閲嶆柊楠岃瘉
-        String key = RedisConst.buildKey(data.getDepotId(), "DEPOT_STORE", depotStatus);
-        String tag = (String) redisUtil.get(key);
-        if (null != tag) return;
+       // String key = RedisConst.buildKey(data.getDepotId(), "DEPOT_STORE", depotStatus);
+//        String tag = (String) redisUtil.get(key);
+//        if (null != tag) return;
 
 
         //鑾峰彇褰撳墠浠撳簱鏈�鍚庝竴涓簱瀛樿褰�
         DepotStore depotStore = getLastDepotStore(data.getDepotId());
 
         //濡傛灉鏈夋暟鎹紝骞朵笖鐘舵�佺被涓�鑷达紝琛ㄧず缂撳瓨娌℃湁浜嗭紝浣嗘槸宸茬粡鍋氳繃鍒濆鍖�
-        if (null != depotStore && depotStatus.equals(depotStore.getDepotStatus())) {
-            redisUtil.set(key, depotStatus, 5 * 24 * 60 * 60);
-            return;
-        }
+//        if (null != depotStore && depotStatus.equals(depotStore.getDepotStatus())) {
+//            redisUtil.set(key, depotStatus, 5 * 24 * 60 * 60);
+//            return;
+//        }
 
         //浠庢潵娌℃湁鍋氫釜搴撳瓨绠$悊璋冩暣
-        if (null == depotStore) {
-            Depot depot = this.getCacheDepot(data.getCompanyId(), data.getDepotId());
-            depotStore = new DepotStore(depot, depotStatus);
-            if (null != data.getFoodYear()) {
-                depotStore.setFoodYear(data.getFoodYear());
-            }
-
-        } else { //鏈夎褰曪紝浣嗘槸鐘舵�佷笌褰撳墠浣滀笟涓嶄竴鑷达紝涔熼渶瑕佸垵濮嬪寲
-            depotStore.setDepotStatus(depotStatus);
-            depotStore.setUpdateDate(new Date());
-            depotStore.setCreateDate(new Date());
-            depotStore.setUpdateUser(null);
-        }
+//        if (null == depotStore) {
+//            Depot depot = this.getCacheDepot(data.getCompanyId(), data.getDepotId());
+//            depotStore = new DepotStore(depot, depotStatus);
+//            if (null != data.getFoodYear()) {
+//                depotStore.setFoodYear(data.getFoodYear());
+//            }
+//
+//        } else { //鏈夎褰曪紝浣嗘槸鐘舵�佷笌褰撳墠浣滀笟涓嶄竴鑷达紝涔熼渶瑕佸垵濮嬪寲
+//            depotStore.setDepotStatus(depotStatus);
+//            depotStore.setUpdateDate(new Date());
+//            depotStore.setUpdateUser(null);
+//        }
 
         depotStore.setId(null);
         if (InoutConstant.TYPE_OUT.equals(data.getType())) {
@@ -368,7 +361,7 @@
         addDepotStore(depotStore, false);
         commonMapper.updateDepotStatus(depotStore.getCompanyId(), depotStore.getDepotId(), depotStore.getDepotStatus());
 
-        redisUtil.set(key, depotStatus, 5 * 24 * 60 * 60);
+       // redisUtil.set(key, depotStatus, 5 * 24 * 60 * 60);
     }
 
     @Override
@@ -378,7 +371,6 @@
 
     @Override
     public void addDepotStore(DepotStore store, boolean updateDepot) {
-        if (null == store.getCreateDate()) store.setCreateDate(new Date());
         if (null == store.getUpdateDate()) store.setUpdateDate(new Date());
         if (null == store.getId()) store.setId(ContextUtil.getUUID());
 

--
Gitblit v1.9.3