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/controller/InoutController.java |  217 ++++++++++++++++++++++++++++++-----------------------
 1 files changed, 122 insertions(+), 95 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 759bdcc..6c34071 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
@@ -25,7 +25,6 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -94,15 +93,75 @@
         InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_10, InoutConstant.PROGRESS_REGISTER, 1);
         view.addObject("lprDto", conf);
 
-        //鍒濆鍖栬溅鐗岃瘑鍒�
-        inoutManager.initLpr(conf);
+        //鐧昏鍒濆鍖�
+        inoutManager.initInoutRegister(conf);
 
         view.setViewName("admin/inout/in-register");
         return view;
     }
 
+
     /**
-     * 鎵︽牱鍖栭獙椤甸潰
+     * 鎵︽牱椤甸潰
+     *
+     * @param sort 琛ㄧず浣跨敤鐨勫嚭鍏ュ簱璁惧閰嶅鍙凤紝涓嶄紶閫掗粯璁や负1
+     * @return
+     */
+    @RequestMapping("/in-sample")
+    public ModelAndView inSample(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
+        if (StringUtils.isEmpty(sort)) {
+            sort = commonManager.getInoutWeightByClient(httpRequest);
+        }
+        ModelAndView view = new ModelAndView();
+        // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
+        List<Depot> listDepot = commonManager.listDepot(true);
+        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
+
+        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("type", InoutConstant.TYPE_IN);
+        view.addObject("deptId", deptId);
+        DefaultDept dept = commonManager.getSubDept(user, deptId);
+        view.addObject("deptName", dept.getName());
+
+        //鍏ュ簱娴佺▼
+        String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN);
+        view.addObject("inoutProgress", inoutProgress);
+
+        // 褰撳墠娴佺▼鑺傜偣
+        view.addObject("progress", InoutConstant.PROGRESS_CHECK);
+
+        // 绮鍝佺涓嬫媺妗�
+        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
+                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
+        view.addObject("listFoodVariety", listFoodVariety);
+
+        // 绮绛夌骇涓嬫媺妗�
+        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
+                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
+        view.addObject("listFoodLevel", listFoodLevel);
+
+        view.addObject("endTime",
+                DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
+        view.addObject("startTime", DateFormatUtils.format(
+                DateUtil.getNewByDay(null, -10), "yyyy-MM-dd"));
+
+        // 鑾峰彇鍑哄叆搴撻厤缃俊鎭�
+        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
+
+        // 鑾峰彇鎵︽牱鏈轰俊鎭�
+        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_20, InoutConstant.PROGRESS_CHECK, 1);
+        view.addObject("checkDto", conf);
+        view.setViewName("admin/inout/in-sample");
+        return view;
+    }
+
+    /**
+     * 璐ㄦ椤甸潰
      *
      * @param sort 琛ㄧず浣跨敤鐨勫嚭鍏ュ簱璁惧閰嶅鍙凤紝涓嶄紶閫掗粯璁や负1
      * @return
@@ -137,6 +196,10 @@
         List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                 Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
         view.addObject("listFoodVariety", listFoodVariety);
+
+        // 绮鎬ц川涓嬫媺妗�
+        List<DicTrigger> listFoodType = inoutCommonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_TYPE, user.getCompanyId());
+        view.addObject("listFoodType", listFoodType);
 
         // 绮绛夌骇涓嬫媺妗�
         List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
@@ -228,6 +291,8 @@
         if (null != conf) conf.setSort(sort);
         view.addObject("cardDto", conf);
 
+        //绉伴噸椤甸潰鍒濆鍖�
+        inoutManager.initInoutWeight(listInoutConf, sort);
 
         view.setViewName("admin/inout/in-weight");
         return view;
@@ -309,15 +374,6 @@
         // 褰撳墠娴佺▼鑺傜偣
         view.addObject("progress", InoutConstant.PROGRESS_CARD_BACK);
 
-        // 绮鍝佺涓嬫媺妗�
-        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
-                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
-        view.addObject("listFoodVariety", listFoodVariety);
-
-        // 绮绛夌骇涓嬫媺妗�
-        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
-                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
-        view.addObject("listFoodLevel", listFoodLevel);
 
         view.setViewName("admin/inout/in-card-back");
         return view;
@@ -355,7 +411,7 @@
         view.addObject("lprDto", conf);
 
         //鍒濆鍖栬溅鐗岃瘑鍒�
-        inoutManager.initLpr(conf);
+        inoutManager.initInoutRegister(conf);
 
         view.setViewName("admin/inout/out-register");
         return view;
@@ -574,6 +630,18 @@
     }
 
     /**
+     * 鎵︽牱椤甸潰鎻愪氦鏇存柊
+     *
+     * @param data
+     * @return
+     */
+    @RequestMapping("/submit-sample")
+    @Transactional
+    public PageResponse<InoutCheckData> submitSample(@RequestBody InoutCheckData data) throws Exception {
+        return inoutManager.submitSample(data);
+    }
+
+    /**
      * 鍑哄叆搴撶О閲嶇幆鑺傛彁浜�
      *
      * @param data
@@ -601,6 +669,8 @@
     @RequestMapping("/submit-handle")
     @Transactional
     public PageResponse<InoutData> submitHandle(@RequestBody InoutData data) throws Exception {
+
+        log.debug("-------------submitHandle------------------");
         return inoutManager.submitHandle(data);
     }
 
@@ -626,6 +696,44 @@
     @Transactional
     public PageResponse<InoutData> submitComplete(@RequestBody InoutData data) throws Exception {
         return inoutManager.submitComplete(data);
+    }
+
+    /**
+     * 鏍规嵁璐ㄦ鍗曞彿鑾峰彇鍑哄叆搴撲俊鎭�
+     *
+     * @param param
+     * @return
+     */
+    @RequestMapping("/inout-check-scan-code")
+    public PageResponse<InoutCheckData> inoutDataByCheckId(@RequestBody InoutCheckParam param) {
+        if (null == param.getCompanyId()) {
+            param.setCompanyId(ContextUtil.getCompanyId());
+        }
+        return inoutManager.inoutDataByCheckId(param);
+    }
+
+    /**
+     * 璐ㄦ椤甸潰浠呮彁浜や繚瀛樺寲楠屼俊鎭�
+     *
+     * @param data
+     * @return
+     */
+    @RequestMapping("/submit-checkItem")
+    @Transactional
+    public PageResponse<InoutCheckData> submitCheckItem(@RequestBody InoutCheckData data) throws Exception {
+        return inoutManager.submitCheckData(data);
+    }
+
+    /**
+     * 璐ㄦ椤甸潰鎻愪氦涓嬩竴娴佺▼
+     *
+     * @param data
+     * @return
+     */
+    @RequestMapping("/submit-check")
+    @Transactional
+    public PageResponse<InoutCheckData> submitCheck(@RequestBody InoutCheckData data) throws Exception {
+        return inoutManager.submitCheck(data);
     }
 
     /**
@@ -655,65 +763,6 @@
 
 
     /**
-     * 鎵︽牱椤甸潰
-     *
-     * @param sort 琛ㄧず浣跨敤鐨勫嚭鍏ュ簱璁惧閰嶅鍙凤紝涓嶄紶閫掗粯璁や负1
-     * @return
-     */
-    @RequestMapping("/in-sample")
-    public ModelAndView inSample(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) {
-        if (StringUtils.isEmpty(sort)) {
-            sort = commonManager.getInoutWeightByClient(httpRequest);
-        }
-        ModelAndView view = new ModelAndView();
-        // 浠撳簱鍒楄〃鍋氫笅鎷夋浣跨敤
-        List<Depot> listDepot = commonManager.listDepot(true);
-        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
-
-        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("type", InoutConstant.TYPE_IN);
-        view.addObject("deptId", deptId);
-        DefaultDept dept = commonManager.getSubDept(user, deptId);
-        view.addObject("deptName", dept.getName());
-
-        //鍏ュ簱娴佺▼
-        String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN);
-        view.addObject("inoutProgress", inoutProgress);
-
-        // 褰撳墠娴佺▼鑺傜偣
-        view.addObject("progress", InoutConstant.PROGRESS_CHECK);
-
-        // 绮鍝佺涓嬫媺妗�
-        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
-                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
-        view.addObject("listFoodVariety", listFoodVariety);
-
-        // 绮绛夌骇涓嬫媺妗�
-        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
-                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
-        view.addObject("listFoodLevel", listFoodLevel);
-
-        view.addObject("endTime",
-                DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
-        view.addObject("startTime", DateFormatUtils.format(
-                DateUtil.getNewByDay(null, -10), "yyyy-MM-dd"));
-
-        // 鑾峰彇鍑哄叆搴撻厤缃俊鎭�
-        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId);
-
-        // 鑾峰彇鎵︽牱鏈轰俊鎭�
-        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_20, InoutConstant.PROGRESS_CHECK, 1);
-        view.addObject("checkDto", conf);
-        view.setViewName("admin/inout/in-sample");
-        return view;
-    }
-
-    /**
      * 鍒嗛〉鑾峰彇鎵︽牱鏁版嵁
      *
      * @param param
@@ -724,17 +773,6 @@
         return inoutManager.pageSampleData(param);
     }
 
-    /**
-     * 鎵︽牱椤甸潰鎻愪氦鏇存柊
-     *
-     * @param data
-     * @return
-     */
-    @RequestMapping("/update-sample")
-    public PageResponse<InoutCheckData> updateSample(@RequestBody InoutCheckData data) {
-
-        return inoutManager.updateSampleData(data);
-    }
 
     /**
      * 鍒嗛〉鑾峰彇鍖栭獙鏁版嵁
@@ -758,17 +796,6 @@
         return inoutManager.getCheckItemData(param);
     }
 
-    /**
-     * 鍖栭獙椤甸潰鎻愪氦鏇存柊
-     *
-     * @param data
-     * @return
-     */
-    @RequestMapping("/update-check")
-    public PageResponse<InoutCheckData> updateCheck1(@RequestBody InoutCheckData data) {
-
-        return inoutManager.updateCheckData(data);
-    }
 
     /**
      * 鏍规嵁绮绛夌骇鍙婄伯椋熷搧绉嶈幏鍙栫伯椋熷畾浠�

--
Gitblit v1.9.3