From 69cd9f59a0fabf12f8c9147fcba7f69817a870b3 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期一, 06 十一月 2023 23:40:59 +0800
Subject: [PATCH] 更新仓内抓拍2

---
 igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java |   68 +++++++++++++++++----------------
 1 files changed, 35 insertions(+), 33 deletions(-)

diff --git a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
index dc26b86..eae9542 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
@@ -1,15 +1,14 @@
 package com.ld.igds.inout.manager;
 
+import com.ld.igds.constant.Constant;
 import com.ld.igds.inout.InoutConstant;
 import com.ld.igds.inout.dto.InoutData;
 import com.ld.igds.inout.service.InoutService;
-import com.ld.igds.io.dto.WeightDto;
 import com.ld.igds.m.service.InoutCommonService;
 import com.ld.igds.models.DicTrigger;
 import com.ld.igds.models.InoutConf;
 import com.ld.igds.models.InoutSysConf;
 import com.ld.igds.sys.service.DicTriggerService;
-import com.ld.igds.util.ContextUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
@@ -31,6 +30,8 @@
     private DicTriggerService dicTriggerService;
     @Resource
     private InoutService inoutService;
+    @Resource
+    private InoutEventControlManager inoutEventControl;
 
     /**
      * 鑾峰彇鍑哄叆搴撶殑鏁翠釜娴佺▼淇℃伅
@@ -76,7 +77,7 @@
      * @return 杞︾墝璁惧閰嶇疆锛屾病鏈夊垯杩斿洖NULL
      */
     public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort, String type, String inoutProgress, int inOrder) {
-        if (null == listInoutConf) return null;
+        if (null == listInoutConf) return new InoutConf(sort);
         if (StringUtils.isEmpty(sort)) sort = "1";
 
         InoutConf result = null;
@@ -89,9 +90,32 @@
             }
         }
 
-        if (null == result) return null;
+        if (null == result) return new InoutConf(sort);
 
         return result;
+    }
+
+    public List<InoutConf> getInoutConf(List<InoutConf> listInoutConf, String type) {
+        List<InoutConf> result = new ArrayList<>();
+        if (null == listInoutConf) return result;
+        for (InoutConf conf : listInoutConf) {
+            if (type.equals(conf.getType())) {
+                result.add(conf);
+            }
+        }
+        return result;
+    }
+
+    public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort, String type) {
+        if (null == listInoutConf) return new InoutConf(sort);
+        if (StringUtils.isEmpty(sort)) sort = "1";
+
+        for (InoutConf conf : listInoutConf) {
+            if (sort.equals(conf.getSort()) && type.equals(conf.getType())) {
+                return conf;
+            }
+        }
+        return new InoutConf(sort);
     }
 
 
@@ -116,34 +140,13 @@
     public String getWeightEditTag(String companyId, String deptId) {
         // 浠庣紦瀛樹腑鑾峰彇鍑哄叆搴撶郴缁熼厤缃俊鎭�
         InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(companyId, deptId);
-        String weightEditTag = null;
+        String weightEditTag = Constant.YN_N;
         if (inoutSysConf != null) {
             weightEditTag = inoutSysConf.getWeightEditTag();
         }
+        if (null == weightEditTag) weightEditTag = Constant.YN_N;
+
         return weightEditTag;
-    }
-
-    public List<WeightDto> getInoutWeightAll(List<InoutConf> listInoutConf, String type) {
-        List<WeightDto> result = new ArrayList<>();
-        if (null == listInoutConf) return result;
-
-        for (InoutConf conf : listInoutConf) {
-            if (type.equals(conf.getType())) {
-                result.add(new WeightDto(conf));
-            }
-        }
-        return result;
-    }
-
-    public WeightDto getInoutCurWeight(List<WeightDto> listWeight, String sort) {
-        if (null == listWeight || listWeight.isEmpty()) return new WeightDto();
-
-        if (listWeight.size() == 1) return listWeight.get(0);
-
-        for (WeightDto weight : listWeight) {
-            if (weight.getSort().equals(sort)) return weight;
-        }
-        return new WeightDto();
     }
 
 
@@ -152,15 +155,14 @@
      *
      * @param deptId
      */
-    public void initInoutScreen(String deptId) {
-        if (StringUtils.isEmpty(deptId))
-            deptId = ContextUtil.subDeptId(null);
-        inoutService.initInoutScreen(deptId);
+    public void initInoutScreen(String companyId, String deptId) {
+        if (StringUtils.isEmpty(companyId)) return;
+        if (StringUtils.isEmpty(deptId)) return;
+        inoutEventControl.initInoutScreen(companyId, deptId, null);
     }
 
     public List<InoutData> getListInoutCache(String deptId) {
         return inoutService.getListInoutCache(deptId);
-
     }
 
     public List<InoutData> getCompleteListInoutCache(String deptId) {

--
Gitblit v1.9.3