From 607e62cd6ec91d53bac549299d986c23e5143d28 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期三, 31 五月 2023 15:06:47 +0800
Subject: [PATCH] 出入库优化-称重相关方法

---
 igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java |   70 +++++++++++++++++------------------
 1 files changed, 34 insertions(+), 36 deletions(-)

diff --git a/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java b/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java
index f3f1ee1..709beec 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java
@@ -9,11 +9,11 @@
 import com.ld.igds.data.BaseParam;
 import com.ld.igds.data.Page;
 import com.ld.igds.data.PageResponse;
+import com.ld.igds.data.SimpleDepot;
 import com.ld.igds.inout.InoutConstant;
 import com.ld.igds.inout.dto.*;
 import com.ld.igds.inout.manager.InoutCommonManager;
 import com.ld.igds.inout.manager.InoutManager;
-import com.ld.igds.io.dto.WeightDto;
 import com.ld.igds.models.Depot;
 import com.ld.igds.models.DicTrigger;
 import com.ld.igds.models.InoutConf;
@@ -171,7 +171,6 @@
         }
 
         ModelAndView view = new ModelAndView();
-
         IUser user = ContextUtil.getLoginUser();
         view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
@@ -181,59 +180,52 @@
         view.addObject("deptId", deptId);
 
         // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<Depot> listDepot = commonManager.listInDepot();
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId);
         view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
         // 褰撳墠娴佺▼鏍囩
         view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG);
 
-        //鍏ュ簱娴佺▼
+        //鍏ュ簱娴佺▼閰嶇疆
         String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN);
         view.addObject("inoutProgress", inoutProgress);
 
-        //绉伴噸缁撴灉鏄惁鍙慨鏀�
-        String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), ContextUtil.subDeptId(user));
+        //绉伴噸鏄惁鍙紪杈戞爣绛�
+        String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), deptId);
         view.addObject("weightEditTag", weightEditTag);
 
         // 绮鍝佺涓嬫媺妗�
         List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
         view.addObject("listFoodVariety", listFoodVariety);
 
-        // 鑾峰彇鍑哄叆搴撻厤缃俊鎭�
+        // 鑾峰彇鍑哄叆搴撹澶囬厤缃俊鎭�
         List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
 
-        //鑾峰彇鎵�鏈夌殑鍦扮鍒楄〃鐢ㄤ簬椤甸潰鐢ㄦ埛閫夋嫨
-        List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30);
+        //鏍规嵁鍑哄叆搴撹澶囦俊鎭瓫閫夊湴纾呴厤缃俊鎭紝鎵�鏈夊湴纾咃紝鏀寔鐢ㄦ埛鎵嬪姩閫夋嫨
+        List<InoutConf> listWeight = inoutCommonManager.getInoutConf(listInoutConf, InoutConstant.CONF_TYPE_30);
         view.addObject("listWeight", listWeight);
 
-        // 鑾峰彇褰撳墠鍦扮淇℃伅
-        WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort);
+        // 鑾峰彇褰撳墠鍦扮
+        InoutConf weightDto = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30);
         view.addObject("weightDto", weightDto);
 
         // 杩囩▼鎽勫儚澶�1
-        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
-                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
+        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 1);
         view.addObject("snapDto1", conf);
 
         // 杩囩▼鎽勫儚澶�2
-        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
-                InoutConstant.PROGRESS_WEIGHT_TAG, 2);
+        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 2);
         view.addObject("snapDto2", conf);
 
         // 杩囩▼鎽勫儚澶�3
-        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
-                InoutConstant.PROGRESS_WEIGHT_TAG, 3);
+        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 3);
         view.addObject("snapDto3", conf);
 
-        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_70,
-                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
-
-        view.addObject("gateDto", conf);
-        // 鏅烘収鍗�
+        // 杩滅▼鏅烘収鍗�
         conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_80, InoutConstant.PROGRESS_WEIGHT_TAG, 1);
         if (null != conf) conf.setSort(sort);
-
         view.addObject("cardDto", conf);
+
 
         view.setViewName("admin/inout/in-weight");
         return view;
@@ -252,12 +244,13 @@
         IUser user = ContextUtil.getLoginUser();
         view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
+        String deptId = ContextUtil.subDeptId(user);
         view.addObject("bizType", BizType.INOUT_IN.getCode());
-        view.addObject("deptId", ContextUtil.subDeptId(user));
+        view.addObject("deptId", deptId);
         view.addObject("type", InoutConstant.TYPE_IN);
 
         // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<Depot> listDepot = commonManager.listInDepot();
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId);
         view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
         //鍏ュ簱娴佺▼
@@ -294,12 +287,13 @@
         IUser user = ContextUtil.getLoginUser();
         view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
+        String deptId = ContextUtil.subDeptId(user);
         view.addObject("bizType", BizType.INOUT_IN.getCode());
-        view.addObject("deptId", ContextUtil.subDeptId(user));
+        view.addObject("deptId", deptId);
         view.addObject("type", InoutConstant.TYPE_IN);
 
         // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<Depot> listDepot = commonManager.listInDepot();
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId);
         view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
         //鍏ュ簱娴佺▼
@@ -387,7 +381,7 @@
         view.addObject("deptId", deptId);
 
         // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<Depot> listDepot = commonManager.listInDepot();
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId);
         view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
         // 褰撳墠娴佺▼鏍囩
@@ -409,11 +403,11 @@
         List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
 
         //鑾峰彇鎵�鏈夌殑鍦扮鍒楄〃鐢ㄤ簬椤甸潰鐢ㄦ埛閫夋嫨
-        List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30);
+        List<InoutConf> listWeight = inoutCommonManager.getInoutConf(listInoutConf, InoutConstant.CONF_TYPE_30);
         view.addObject("listWeight", listWeight);
 
         // 鑾峰彇褰撳墠鍦扮淇℃伅
-        WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort);
+        InoutConf weightDto = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30);
         view.addObject("weightDto", weightDto);
 
         // 杩囩▼鎽勫儚澶�1
@@ -454,7 +448,7 @@
         view.addObject("type", InoutConstant.TYPE_OUT);
 
         // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<Depot> listDepot = commonManager.listOutDepot();
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId);
         view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
         //鍑哄簱娴佺▼
@@ -489,16 +483,20 @@
 
         ModelAndView view = new ModelAndView();
 
-        // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<Depot> listDepot = commonManager.listOutDepot();
-        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
-
         IUser user = ContextUtil.getLoginUser();
+
+        String deptId =  ContextUtil.subDeptId(user);
         view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
         view.addObject("bizType", BizType.INOUT_OUT.getCode());
-        view.addObject("deptId", ContextUtil.subDeptId(user));
+        view.addObject("deptId",deptId);
         view.addObject("type", InoutConstant.TYPE_OUT);
 
+
+        // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId);
+        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
+
+
         //鍑哄簱娴佺▼
         String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
                 ContextUtil.subDeptId(user), InoutConstant.TYPE_OUT);

--
Gitblit v1.9.3