From a4d556ff6f8191637be669e7884fc3e500021516 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期四, 22 六月 2023 01:15:28 +0800
Subject: [PATCH] 测试入库流程

---
 igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java |  153 ++++++++++++++++++++++++--------------------------
 1 files changed, 74 insertions(+), 79 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..8c1031d 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;
@@ -574,6 +624,18 @@
     }
 
     /**
+     * 鎵︽牱椤甸潰鎻愪氦鏇存柊
+     *
+     * @param data
+     * @return
+     */
+    @RequestMapping("/submit-sample")
+    @Transactional
+    public PageResponse<InoutCheckData> submitSample(@RequestBody InoutCheckData data) throws Exception {
+        return inoutManager.submitSample(data);
+    }
+
+    /**
      * 鍑哄叆搴撶О閲嶇幆鑺傛彁浜�
      *
      * @param data
@@ -654,64 +716,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;
-    }
+   
 
     /**
      * 鍒嗛〉鑾峰彇鎵︽牱鏁版嵁
@@ -724,17 +729,7 @@
         return inoutManager.pageSampleData(param);
     }
 
-    /**
-     * 鎵︽牱椤甸潰鎻愪氦鏇存柊
-     *
-     * @param data
-     * @return
-     */
-    @RequestMapping("/update-sample")
-    public PageResponse<InoutCheckData> updateSample(@RequestBody InoutCheckData data) {
 
-        return inoutManager.updateSampleData(data);
-    }
 
     /**
      * 鍒嗛〉鑾峰彇鍖栭獙鏁版嵁

--
Gitblit v1.9.3