From 08cea428e888b6fdd2a3c3783e87e4f828385783 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期四, 08 六月 2023 08:55:47 +0800
Subject: [PATCH] 出入库优化-提交优化

---
 igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java |   67 +++++++++++++++++++++++++--------
 1 files changed, 51 insertions(+), 16 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 72a7b16..e71e477 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
@@ -1,6 +1,5 @@
 package com.ld.igds.inout.controller;
 
-import ch.qos.logback.classic.pattern.ClassNameOnlyAbbreviator;
 import com.bstek.bdf2.core.business.IUser;
 import com.bstek.bdf2.core.model.DefaultDept;
 import com.ld.igds.check.dto.CheckItemData;
@@ -239,7 +238,12 @@
      * @return
      */
     @RequestMapping("/in-handle")
-    public ModelAndView inHandle() {
+    public ModelAndView inHandle(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
+
+        //濡傛灉娌℃湁鎸囧畾鍦扮锛屼粠鐢ㄦ埛涓婁竴涓�夋嫨涓幏鍙�
+        if (StringUtils.isEmpty(sort)) {
+            sort = commonManager.getInoutWeightByClient(httpRequest);
+        }
 
         ModelAndView view = new ModelAndView();
 
@@ -263,15 +267,13 @@
         // 褰撳墠娴佺▼鑺傜偣
         view.addObject("progress", InoutConstant.PROGRESS_HANDLE);
 
-        // 绮鍝佺涓嬫媺妗�
-        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
-                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
-        view.addObject("listFoodVariety", listFoodVariety);
+        // 杩滅▼鏅烘収鍗�
+        // 鑾峰彇鍑哄叆搴撹澶囬厤缃俊鎭�
+        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
+        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_80, InoutConstant.PROGRESS_WEIGHT_TAG, 1);
+        if (null != conf) conf.setSort(sort);
+        view.addObject("cardDto", conf);
 
-        // 绮绛夌骇涓嬫媺妗�
-        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
-                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
-        view.addObject("listFoodLevel", listFoodLevel);
 
         view.setViewName("admin/inout/in-handle");
         return view;
@@ -322,6 +324,7 @@
 
     /**
      * 鍑哄簱鐧昏
+     *
      * @param sort 琛ㄧず浣跨敤鐨勫嚭鍏ュ簱璁惧閰嶅鍙凤紝涓嶄紶閫掗粯璁や负1
      * @return
      */
@@ -449,7 +452,7 @@
         view.addObject("type", InoutConstant.TYPE_OUT);
 
         // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId);
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId);
         view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
         //鍑哄簱娴佺▼
@@ -486,15 +489,15 @@
 
         IUser user = ContextUtil.getLoginUser();
 
-        String deptId =  ContextUtil.subDeptId(user);
+        String deptId = ContextUtil.subDeptId(user);
         view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
         view.addObject("bizType", BizType.INOUT_OUT.getCode());
-        view.addObject("deptId",deptId);
+        view.addObject("deptId", deptId);
         view.addObject("type", InoutConstant.TYPE_OUT);
 
 
         // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId);
+        List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId);
         view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
 
@@ -528,7 +531,7 @@
      */
     @RequestMapping("/inout-query")
     public PageResponse<InoutData> inoutQuery(@RequestBody InoutParam param) {
-        if(null == param.getCompanyId()) param.setCompanyId(ContextUtil.getCompanyId());
+        if (null == param.getCompanyId()) param.setCompanyId(ContextUtil.getCompanyId());
         return inoutManager.inoutQuery(param);
     }
 
@@ -601,6 +604,38 @@
         }
 
         return inoutManager.submitRegisterInout(data);
+    }
+
+    /**
+     * 鍑哄叆搴撶О閲嶇幆鑺傛彁浜�
+     *
+     * @param data
+     * @return
+     */
+    @RequestMapping("/submit-weight")
+    @Transactional
+    public PageResponse<InoutData> submitWeight(@RequestBody InoutData data) throws Exception {
+
+        if (null == data.getJjlx()) data.setJjlx("0");
+
+        if (InoutConstant.TYPE_IN.equals(data.getType())) {
+            return inoutManager.submitWeightIn(data);
+        } else {
+            return inoutManager.submitWeightOut(data);
+        }
+    }
+
+    /**
+     * 鍑哄叆搴撶О閲嶇幆鑺傛彁浜わ紝璇锋敞鎰忥細鍊间粨鎸戞彁浜ょ殑鏁版嵁闈炲嚭鍏ュ簱娴佹按瀹屾暣淇℃伅锛屼笉鑳界洿鎺ヨ皟鐢╱pdate鏂规硶
+     *
+     * @param data
+     * @return
+     */
+    @RequestMapping("/submit-handle")
+    @Transactional
+    public PageResponse<InoutData> submitHandle(@RequestBody InoutData data) throws Exception {
+
+        return inoutManager.submitHandle(data);
     }
 
     /**
@@ -817,7 +852,7 @@
      */
     @RequestMapping("/get-check-item")
     public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutCheckParam param) {
-            return inoutManager.getCheckItemData(param);
+        return inoutManager.getCheckItemData(param);
     }
 
     /**

--
Gitblit v1.9.3