From 585e878b169bdeb2bc8cc452b9d2e640d00caa6d Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期二, 04 七月 2023 09:00:35 +0800
Subject: [PATCH] 质检报告

---
 igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java |  284 ++++++++++++++++++--------------------------------------
 1 files changed, 94 insertions(+), 190 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 e37641b..a7629be 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;
@@ -100,9 +99,69 @@
         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
@@ -309,15 +368,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;
@@ -537,7 +587,7 @@
     }
 
     /**
-     * 鍗″洖鏀舵暟鎹煡璇紝娌℃湁娴佺▼鐘舵�佺殑鏁版嵁鐩存帴杩斿洖
+     * 鍑哄簱鏀跺崱淇℃伅鏌ヨ
      *
      * @param param
      * @return
@@ -545,41 +595,7 @@
     @RequestMapping("/inout-query-back")
     public PageResponse<InoutData> inoutQueryBack(@RequestBody InoutParam param) {
         param.setProgress(null);
-        return inoutManager.inoutQuery(param);
-    }
-
-    /**
-     * 鍑哄叆搴撴暟鎹洿鏂帮紝鎻愪氦鍒颁笅涓祦绋�
-     *
-     * @param data
-     * @return
-     */
-    @RequestMapping("/inout-next-step")
-    @Transactional
-    public PageResponse<InoutData> inoutNextStep(@RequestBody InoutData data) {
-        try {
-            IUser user = ContextUtil.getLoginUser();
-            if (StringUtils.isEmpty(data.getCompanyId())) {
-                data.setCompanyId(user.getCompanyId());
-            }
-            if (StringUtils.isEmpty(data.getDeptId())) {
-                data.setDeptId(ContextUtil.subDeptId(user));
-            }
-
-            if (InoutConstant.TYPE_IN.equals(data.getType())) {
-                return inoutManager.inNextStep(data);
-            } else {
-                return inoutManager.outNextStep(data);
-            }
-        } catch (Exception e) {
-            log.error("鍚庡彴寮傚父:{}", e);
-
-            //鎵嬪姩鍥炴粴
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-
-            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
-                    "鍚庡彴寮傚父锛�" + e.getMessage());
-        }
+        return inoutManager.inoutQueryBack(param);
     }
 
     /**
@@ -605,6 +621,18 @@
         }
 
         return inoutManager.submitRegisterInout(data);
+    }
+
+    /**
+     * 鎵︽牱椤甸潰鎻愪氦鏇存柊
+     *
+     * @param data
+     * @return
+     */
+    @RequestMapping("/submit-sample")
+    @Transactional
+    public PageResponse<InoutCheckData> submitSample(@RequestBody InoutCheckData data) throws Exception {
+        return inoutManager.submitSample(data);
     }
 
     /**
@@ -635,36 +663,22 @@
     @RequestMapping("/submit-handle")
     @Transactional
     public PageResponse<InoutData> submitHandle(@RequestBody InoutData data) throws Exception {
+    	
+    	log.debug("-------------submitHandle------------------");
         return inoutManager.submitHandle(data);
     }
 
     /**
-     * 鍗″洖鏀堕〉闈㈡彁浜わ紝濡傛灉鏄甯告祦绋嬪崱鍥炴敹鍒欒蛋姝e父瀹屾垚娴佺▼锛屽惁鍒欐墽琛屽垹闄ら�昏緫骞跺洖鏀跺崱
+     * 鍑哄叆搴撳崱鍥炴敹鎻愪氦锛屽鏋滄暟鎹凡缁忔槸瀹屾垚锛岀洿鎺ヤ笉鍋氭洿鏂帮紝濡傛灉鏈畬鎴愬垯鎵ц瀹屾垚
      *
      * @param data
      * @return
      */
-    @RequestMapping("/inout-back-submit")
-    public PageResponse<InoutData> inoutBackSubmit(@RequestBody InoutData data) {
-        return inoutManager.inoutBack(data);
+    @RequestMapping("/submit-card-back")
+    @Transactional
+    public PageResponse<InoutData> submitCardBack(@RequestBody InoutData data) throws Exception {
+        return inoutManager.submitCardBack(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);
-//        }
-//    }
 
     /**
      * 鏍规嵁鍗″彿鍜岀被鍨嬶紝鐩存帴瀹屾垚褰撳墠娴佺▼
@@ -672,57 +686,23 @@
      * @param data
      * @return
      */
-    @RequestMapping("/inout-to-complete")
-    public PageResponse<InoutData> inoutComplete(@RequestBody InoutData data) {
-        try {
-            return inoutManager.inoutComplete(data);
-        } catch (Exception e) {
-            log.error("鍚庡彴寮傚父:{}", e);
-            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
-                    "鍚庡彴寮傚父锛�" + e.getMessage(), data);
-        }
+    @RequestMapping("/submit-complete")
+    @Transactional
+    public PageResponse<InoutData> submitComplete(@RequestBody InoutData data) throws Exception {
+        return inoutManager.submitComplete(data);
     }
 
-//    /**
-//     * 鏍规嵁鍏ュ簱鏁版嵁淇℃伅锛岃幏鍙栨鏌ラ」淇℃伅锛屽鏋滃綋鍓嶆暟鎹凡缁忔娴嬪畬鎴愶紝鏌ヨ妫�娴嬬粨鏋滐紝濡傛灉娌℃湁妫�娴嬪畬鎴愬垯鏍规嵁妫�娴嬮」閰嶇疆鑾峰彇闇�瑕佹娴嬬殑椤圭洰淇℃伅
-//     *
-//     * @param data
-//     * @return
-//     */
-//    @RequestMapping("/get-check-item")
-//    public PageResponse<List<CheckItemData>> getCheckItem(@RequestBody InoutData data) {
-//        try {
-//            return inoutManager.getCheckItem(data);
-//        } catch (Exception e) {
-//            log.error("鍚庡彴寮傚父:{}", e);
-//            return new PageResponse<List<CheckItemData>>(
-//                    RespCodeEnum.CODE_1111.getCode(), "鍚庡彴寮傚父锛�" + e.getMessage());
-//        }
-//    }
-
-//    /**
-//     * 鍒嗛〉鑾峰彇鏁版嵁淇℃伅
-//     *
-//     * @param param
-//     * @return
-//     */
-//    @RequestMapping("/page-check-data")
-//    public PageResponse<Page<InoutData>> pageCheckData(
-//            @RequestBody InoutParam param) {
-//        return inoutManager.pageCheckData(param);
-//    }
 
     /**
-     * 閬撻椄鎺у埗
+     * 璐ㄦ椤甸潰鎻愪氦
      *
-     * @param param
+     * @param data
      * @return
      */
-    @RequestMapping("/gate-ctrl")
-    public PageResponse<String> gateCtrl(
-            @RequestBody InoutGateDto param) {
-
-        return null;
+    @RequestMapping("/submit-check")
+    @Transactional
+    public PageResponse<InoutCheckData> submitCheck(@RequestBody InoutCheckData data)throws Exception {
+        return inoutManager.submitCheck(data);
     }
 
     /**
@@ -751,64 +731,7 @@
     }
 
 
-    /**
-     * 鎵︽牱椤甸潰
-     *
-     * @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;
-    }
+   
 
     /**
      * 鍒嗛〉鑾峰彇鎵︽牱鏁版嵁
@@ -821,17 +744,7 @@
         return inoutManager.pageSampleData(param);
     }
 
-    /**
-     * 鎵︽牱椤甸潰鎻愪氦鏇存柊
-     *
-     * @param data
-     * @return
-     */
-    @RequestMapping("/update-sample")
-    public PageResponse<InoutCheckData> updateSample(@RequestBody InoutCheckData data) {
 
-        return inoutManager.updateSampleData(data);
-    }
 
     /**
      * 鍒嗛〉鑾峰彇鍖栭獙鏁版嵁
@@ -855,20 +768,11 @@
         return inoutManager.getCheckItemData(param);
     }
 
-    /**
-     * 鍖栭獙椤甸潰鎻愪氦鏇存柊
-     *
-     * @param data
-     * @return
-     */
-    @RequestMapping("/update-check")
-    public PageResponse<InoutCheckData> updateCheck1(@RequestBody InoutCheckData data) {
 
-        return inoutManager.updateCheckData(data);
-    }
 
     /**
      * 鏍规嵁绮绛夌骇鍙婄伯椋熷搧绉嶈幏鍙栫伯椋熷畾浠�
+     *
      * @param param
      * @return
      */

--
Gitblit v1.9.3