From e17db1a57b9788ab16c805e44b54a0324fea7da0 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期三, 21 六月 2023 17:54:20 +0800
Subject: [PATCH] 倒仓和粮食性质变更

---
 igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java |   84 ++++++++++++++++++++++++++++--------------
 1 files changed, 56 insertions(+), 28 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 c5d050f..af8e291 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
@@ -18,6 +18,7 @@
 import com.ld.igds.models.Depot;
 import com.ld.igds.models.DicTrigger;
 import com.ld.igds.models.InoutConf;
+import com.ld.igds.models.InoutPrice;
 import com.ld.igds.util.ContextUtil;
 import com.ld.igds.util.DateUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -238,7 +239,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();
 
@@ -262,15 +268,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;
@@ -613,13 +617,26 @@
     @Transactional
     public PageResponse<InoutData> submitWeight(@RequestBody InoutData data) throws Exception {
 
-        if(null == data.getJjlx()) data.setJjlx("0");
+        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);
     }
 
     /**
@@ -633,22 +650,22 @@
         return inoutManager.inoutBack(data);
     }
 
-    /**
-     * 鍖栭獙椤甸潰鏁版嵁鎻愪氦
-     *
-     * @param data
-     * @return
-     */
-    @RequestMapping("/update-check")
-    public PageResponse<InoutData> updateCheck(@RequestBody InoutData data) {
-        try {
-            return inoutManager.updateCheck(data);
-        } catch (Exception e) {
-            log.error("鍚庡彴寮傚父:{}", e);
-            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
-                    "鍚庡彴寮傚父锛�" + e.getMessage(), null);
-        }
-    }
+//    /**
+//     * 鍖栭獙椤甸潰鏁版嵁鎻愪氦
+//     *
+//     * @param data
+//     * @return
+//     */
+//    @RequestMapping("/update-check")
+//    public PageResponse<InoutData> updateCheck(@RequestBody InoutData data) {
+//        try {
+//            return inoutManager.updateCheck(data);
+//        } catch (Exception e) {
+//            log.error("鍚庡彴寮傚父:{}", e);
+//            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
+//                    "鍚庡彴寮傚父锛�" + e.getMessage(), null);
+//        }
+//    }
 
     /**
      * 鏍规嵁鍗″彿鍜岀被鍨嬶紝鐩存帴瀹屾垚褰撳墠娴佺▼
@@ -836,7 +853,7 @@
      */
     @RequestMapping("/get-check-item")
     public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutCheckParam param) {
-            return inoutManager.getCheckItemData(param);
+        return inoutManager.getCheckItemData(param);
     }
 
     /**
@@ -845,9 +862,20 @@
      * @param data
      * @return
      */
-    @RequestMapping("/update-check1")
+    @RequestMapping("/update-check")
     public PageResponse<InoutCheckData> updateCheck1(@RequestBody InoutCheckData data) {
 
         return inoutManager.updateCheckData(data);
     }
+
+    /**
+     * 鏍规嵁绮绛夌骇鍙婄伯椋熷搧绉嶈幏鍙栫伯椋熷畾浠�
+     * @param param
+     * @return
+     */
+    @RequestMapping("/get-price")
+    public PageResponse<InoutPrice> getPrice(@RequestBody InoutCheckParam param) {
+
+        return inoutManager.getPrice(param);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3