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 |  111 +++++++++++++++++++++++++++++++++----------------------
 1 files changed, 67 insertions(+), 44 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index 42d7241..e10b4c3 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -137,59 +137,66 @@
     @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 = "缁勬墭")
@@ -199,6 +206,22 @@
         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){

--
Gitblit v1.9.1