From c90f42702b056664dbb3502a14041ba902273665 Mon Sep 17 00:00:00 2001
From: 1 <1>
Date: 星期四, 27 十一月 2025 18:31:29 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/controller/MobileController.java |  235 +++++++++++++++++++++++++++-------------------------------
 1 files changed, 109 insertions(+), 126 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index 81c633e..e10b4c3 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -38,10 +38,6 @@
     @Autowired
     private LocDetlService locDetlService;
     @Autowired
-    private OrderService orderService;
-    @Autowired
-    private OrderDetlService orderDetlService;
-    @Autowired
     private DocTypeService docTypeService;
     @Autowired
     private WrkMastService wrkMastService;
@@ -137,148 +133,135 @@
         return R.ok("涓嬫灦鎴愬姛");
     }
 
-
-
-    // 缁勬墭 ----------------------------------------------------------------------------------------------------
-
-    /**
-     * 鏍规嵁鍗曞彿妫�绱㈠崟鎹暟鎹�
-     * http://localhost:8081/jkwms/mobile/order/serach/orderNo/auth?orderNo=123123
-     */
-//    @RequestMapping("/order/search/orderNo/auth")
-//    @ManagerAuth
-//    public R orderSearchByBarcode(@RequestParam String orderNo){
-//        Order order = orderService.selectByNo(orderNo);
-//        if (order == null) {
-//            return R.ok();
-//        }
-//        DocType docType = docTypeService.selectById(order.getDocType());
-//        if (docType.getPakin() == null || docType.getPakin() != 1) {
-//            return R.ok();
-//        }
-//        if (order.getSettle() > 2) {
-//            return R.ok();
-//        }
-//        List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId());
-//        if (Cools.isEmpty(orderDetls)) {
-//            return R.ok();
-//        }
-//        return R.ok().add(orderDetls);
-//    }
-
-
-//    @RequestMapping("/order/search/orderNo/auth")
-//    @ManagerAuth
-//    public R orderSearchByBarcode(@RequestParam String orderNo){
-//        if (Cools.isEmpty(orderNo)){
-//            orderNo=null;
-//        }
-////        List<Order> orders = orderService.selectorderNoL(orderNo);
-//        List<Order> orders = OrderInAndOutUtil.selectOrderNoL(null, orderNo);
-//        if (Cools.isEmpty(orders)){
-//            return R.ok();
-//        }
-//        LinkedList<CombParam> combParams = new LinkedList<>();
-//        if (!Cools.isEmpty(orders)){
-//            for (Order order:orders){
-//                CombParam combParam=new CombParam();
-//                if (order == null) {
-//                    continue;
-//                }
-//                DocType docType = docTypeService.selectById(order.getDocType());
-//                if (docType.getPakin() == null || docType.getPakin() != 1) {
-//                    continue;
-//                }
-//                if (order.getSettle() > 2) {
-//                    continue;
-//                }
-////                List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId());
-//                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectWorkingDetls(order.getPakinPakoutStatus$(), order.getId());
-//                if (!Cools.isEmpty(orderDetls)) {
-//                    LinkedList<CombParam.CombMat> combMats = new LinkedList<>();
-//                    for (OrderDetl orderDetl:orderDetls){
-//                        CombParam.CombMat combMat = new CombParam.CombMat();
-//                        combMat.setMatnr(orderDetl.getMatnr());
-//                        combMat.setBatch(orderDetl.getBatch());
-//                        combMat.setAnfme(orderDetl.getAnfme()-orderDetl.getWorkQty());
-//                        combMat.setMaktx(orderDetl.getMaktx());
-//                        combMat.setSpecs(orderDetl.getSpecs());
-//                        combMats.add(combMat);
-//                    }
-//                    combParam.setCombMats(combMats);
-//                }
-//                combParam.setOrderNo(order.getOrderNo());
-//                combParams.add(combParam);
-//            }
-//        }
-//        return R.ok().add(combParams);
-//    }
     @RequestMapping("/order/search/orderNo/auth")
     @ManagerAuth
     public R orderSearchByBarcode(@RequestParam String orderNo){
         if (Cools.isEmpty(orderNo)){
-            orderNo=null;
+            orderNo = null;
         }
-//        List<Order> orders = orderService.selectorderNoL(orderNo);
+
         List<Order> orders = OrderInAndOutUtil.selectOrderNoL(null, orderNo);
         if (Cools.isEmpty(orders)){
-            return R.ok();
+            return R.ok().add(new LinkedList<>());
         }
-        LinkedList<CombParam> combParams = new LinkedList<>();
-        if (!Cools.isEmpty(orders)){
-            for (Order order:orders){
-                CombParam combParam=new CombParam();
-                if (order == null) {
-                    continue;
-                }
-                DocType docType = docTypeService.selectById(order.getDocType());
-                if (docType.getPakin() == null || docType.getPakin() != 1) {
-                    continue;
-                }
-                if (order.getSettle() > 2) {
-                    continue;
-                }
-//                List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId());
-                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectWorkingDetls(order.getPakinPakoutStatus$(), order.getId());
-                if (!Cools.isEmpty(orderDetls)) {
-                    LinkedList<CombParam.CombMat> combMats = new LinkedList<>();
-                    for (OrderDetl orderDetl:orderDetls){
-                        CombParam.CombMat combMat = new CombParam.CombMat();
-                        combMat.setMatnr(orderDetl.getMatnr());
-                        combMat.setBatch(orderDetl.getBatch());
-                        combMat.setAnfme(orderDetl.getAnfme()-orderDetl.getWorkQty());
-                        combMat.setMaktx(orderDetl.getMaktx());
-                        combMat.setSpecs(orderDetl.getSpecs());
-                        combMat.setBrand(orderDetl.getBrand());
-                        combMat.setSku(orderDetl.getSku());
-                        combMat.setMemo(orderDetl.getMemo());
-                        combMat.setBoxType1(orderDetl.getBoxType1());
-                        combMat.setBoxType2(orderDetl.getBoxType2());
-                        combMat.setBoxType3(orderDetl.getBoxType3());
-                        combMat.setStandby1(orderDetl.getStandby1());
-                        combMat.setStandby2(orderDetl.getStandby2());
-                        combMat.setStandby3(orderDetl.getStandby3());
-                        combMats.add(combMat);
-                    }
-                    combParam.setCombMats(combMats);
-                }
-                combParam.setOrderNo(order.getOrderNo());
-                return R.ok().add(combParam);
 
-//                combParams.add(combParam);
+        LinkedList<CombParam> combParams = new LinkedList<>();
+
+        for (Order order : orders) {
+            if (order == null) {
+                continue;
             }
+
+            DocType docType = docTypeService.selectById(order.getDocType());
+            if (docType.getPakin() == null || docType.getPakin() != 1) {
+                continue;
+            }
+            if (order.getSettle() > 2) {
+                continue;
+            }
+
+            List<OrderDetl> orderDetls =
+                    OrderInAndOutUtil.selectWorkingDetls(order.getPakinPakoutStatus$(), order.getId());
+
+            CombParam combParam = new CombParam();
+
+            if (!Cools.isEmpty(orderDetls)) {
+                LinkedList<CombParam.CombMat> combMats = new LinkedList<>();
+
+                for (OrderDetl od : orderDetls) {
+                    CombParam.CombMat mat = new CombParam.CombMat();
+                    mat.setMatnr(od.getMatnr());
+                    mat.setBatch(od.getBatch());
+                    mat.setAnfme(od.getAnfme() - od.getWorkQty());
+                    mat.setMaktx(od.getMaktx());
+                    mat.setSpecs(od.getSpecs());
+                    mat.setBrand(od.getBrand());
+                    mat.setSku(od.getSku());
+                    mat.setMemo(od.getMemo());
+                    mat.setSupp(od.getSupp());
+                    mat.setBoxType1(od.getBoxType1());
+                    mat.setBoxType2(od.getBoxType2());
+                    mat.setBoxType3(od.getBoxType3());
+                    mat.setStandby1(od.getStandby1());
+                    mat.setStandby2(od.getStandby2());
+                    mat.setStandby3(od.getStandby3());
+                    combMats.add(mat);
+                }
+                combParam.setCombMats(combMats);
+            }
+
+            combParam.setOrderNo(order.getOrderNo());
+            combParams.add(combParam);
         }
+
         return R.ok().add(combParams);
     }
 
+
     @RequestMapping("/comb/auth")
-//    @ManagerAuth(memo = "缁勬墭")
+    @ManagerAuth(memo = "缁勬墭")
     public R comb(@RequestBody CombParam combParam){
 //        mobileService.comb(combParam, getUserId());
-        mobileService.comb(combParam, 9999L);
+        mobileService.comb(combParam, getUserId());
         return R.ok("缁勬墭鎴愬姛");
     }
 
+    @RequestMapping("/combAuto/auth")
+    @ManagerAuth(memo = "缁勬墭")
+    public R combAuto(@RequestBody CombParam combParam){
+//        mobileService.comb(combParam, getUserId());
+        mobileService.comb(combParam, getUserId());
+        return R.ok("缁勬墭鎴愬姛");
+    }
+
+    @RequestMapping("/combAuto/wcs/auth")
+//    @ManagerAuth(memo = "缁勬墭")
+    public R combAutoWcs(@RequestBody CombParam combParam){
+//        mobileService.comb(combParam, getUserId());
+        mobileService.combAuto(combParam, 7777L);
+        return R.ok("缁勬墭鎴愬姛");
+    }
+
+    @RequestMapping("/kitting/query/auth")
+    @ManagerAuth(memo = "榻愬鍏ュ簱鏌ヨ")
+    public R kittingQuery(@RequestBody CombParam combParam){
+        try {
+            return mobileService.kittingQuery(combParam, getUserId());
+        } catch (Exception e){
+
+        }
+//        return R.ok("榻愬鍏ュ簱鏌ヨ鎴愬姛");
+        return R.error("榻愬鍏ュ簱鏌ヨ澶辫触");
+    }
+
+    @RequestMapping("/kitting/call/auth")
+    @ManagerAuth(memo = "榻愬鍏ュ簱鍛煎彨")
+    public R kittingCall(@RequestParam("locNo") String locNo){
+        mobileService.kittingCall(locNo, getUserId());
+        return R.ok("榻愬鍏ュ簱鍛煎彨鎴愬姛");
+    }
+
+    @RequestMapping("/kitting/call/all/auth")//瀵�  鍓嶇鏀逛笉浜嗕竴鐐�
+    @ManagerAuth(memo = "榻愬鍏ュ簱鍛煎彨")
+    public R kittingCall(@RequestBody CombParam combParam){
+        List<CombParam.CombMat> combMats = combParam.getCombMats();
+        for (CombParam.CombMat locDetl : combMats) {
+            mobileService.kittingCall(locDetl.getMemo(), getUserId());
+        }
+        return R.ok("榻愬鍏ュ簱鍛煎彨鎴愬姛");
+    }
+    @RequestMapping("/loc/origin/query/auth")
+    @ManagerAuth(memo = "搴撳瓨鏌ヨ")
+    public R locOriginQuery(@RequestParam("barcode") String barcode){
+        List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("zpallet", barcode));
+        return R.ok("鍦ㄥ簱鏍囪淇敼鎴愬姛").add(locDetlList);
+    }
+    @RequestMapping("/loc/origin/in/out/auth")
+    @ManagerAuth(memo = "鍦ㄥ簱鏍囪淇敼")
+    public R locOriginInOut(@RequestBody LocDetl locDetl){
+        return mobileService.locOriginInOut(locDetl, getUserId());
+    }
+
     @RequestMapping("/pack/get/auth")
     @ManagerAuth
     public R packGet(@RequestParam String barcode){

--
Gitblit v1.9.1