From ddaf128bd75d0d46f1c70986bc6690a42c8e6d65 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 22 一月 2026 16:52:42 +0800
Subject: [PATCH] 出库组托功能优化

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   44 ++++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index db179b3..d998706 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -605,9 +605,6 @@
         if (Objects.isNull(container)) {
             throw new CoolException("鏁版嵁閿欒锛氬鍣ㄧ爜涓嶅瓨鍦紒锛�");
         }
-        // if (param.getBarcode().length() != 8) {
-        // throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode());
-        // }
 
         if (Objects.isNull(param.getType())) {
             param.setType("0");
@@ -689,7 +686,10 @@
                 OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                         .eq("order_id", order.getId())
                         .eq("matnr", elem.getMatnr()));
-
+                if (Objects.isNull(elem.getBoxType1())) {
+                    throw new CoolException("鏍煎眰缂栫爜涓嶈兘涓虹┖锛侊紒");
+                }
+                detls.setBoxType1(elem.getBoxType1());
                 if (Objects.isNull(detls)) {
                     throw new CoolException("鏁版嵁閿欒锛氬崟鎹槑缁嗕笉瀛樺湪锛侊紒");
                 }
@@ -699,7 +699,7 @@
                 }
                 OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(),
                         elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
-                        elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
+                        "1", elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
                 DetlDto detlDto = new DetlDto(order.getOrderNo(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(),
                         elem.getStandby2(), elem.getStandby3(),
                         elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme(),
@@ -762,6 +762,7 @@
                 waitPakin.setThreeCode(detlDto.getThreeCode());
                 waitPakin.setSuppCode(detlDto.getStandby1());
                 waitPakin.setStandby1(detlDto.getStandby1());
+                waitPakin.setBoxType1(detlDto.getBoxType1());
                 waitPakin.setIoStatus("N"); // 鍏ュ嚭鐘舵��
                 waitPakin.setAnfme(detlDto.getAnfme()); // 鏁伴噺
                 waitPakin.setStatus("Y"); // 鐘舵��
@@ -999,11 +1000,11 @@
                     if (jsonObject.getInteger("code").equals(200)) {
                         success = true;
                     } else if (jsonObject.getInteger("code").equals(500)) {
-                        log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.PACK_DOWN_URL,
+                        log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT,
                                 JSON.toJSONString(mesCombParam), response);
                         throw new CoolException(jsonObject.getString("msg"));
                     } else {
-                        log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.PACK_DOWN_URL,
+                        log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT,
                                 JSON.toJSONString(mesCombParam), response);
                         throw new CoolException("涓婃姤mes绯荤粺澶辫触");
                     }
@@ -1015,7 +1016,7 @@
                         // 淇濆瓨鎺ュ彛鏃ュ織
                         apiLogService.save(
                                 "鎵撳寘涓嬬嚎甯墭涓婃姤",
-                                MesConstant.URL + MesConstant.PACK_DOWN_URL,
+                                MesConstant.URL + MesConstant.IN_DISPATCH_RESULT,
                                 null,
                                 "127.0.0.1",
                                 JSON.toJSONString(mesCombParam),
@@ -1066,7 +1067,7 @@
                 // }
                 OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(),
                         detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3(),
-                        detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme());
+                        "1", detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme());
                 // 淇濆瓨鍏ュ簱閫氱煡妗�
                 Mat mat = matService.selectByMatnr(detlDto.getMatnr());
                 if (Cools.isEmpty(mat)) {
@@ -1179,7 +1180,7 @@
     @Override
     @Transactional
     public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl,
-            Double curOutQty, Integer ioType, Long userId, Date now) {
+                         Double curOutQty, Integer ioType, Long userId, Date now) {
         // 鑾峰彇搴撲綅
         LocMast locMast = locMastService.selectById(locDetl.getLocNo());
         // 鑾峰彇璺緞
@@ -1810,10 +1811,11 @@
 
     /**
      * SO/EO 鍖虹粍鎵�
-     * @author Ryan
-     * @date 2025/12/18 15:19
+     *
      * @param params
      * @return com.core.common.R
+     * @author Ryan
+     * @date 2025/12/18 15:19
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -1866,7 +1868,6 @@
                 if (!basStationDetlService.insert(basStationDetl)) {
                     throw new CoolException("鎻掑叆鏄庣粏澶辫触");
                 }
-
             } else {
                 BigDecimal anfme = new BigDecimal(basStationDetl.getAnfme().toString()).add(combMat.getWorkQty());
                 basStationDetl.setAnfme(anfme.doubleValue());
@@ -1924,6 +1925,10 @@
                 && wrkMast.getIoType().equals(TaskIOType.PICK_OUT.type)) {
             throw new CoolException("浜虹墿绫诲瀷閿欒");
         }
+
+        wrkDetlService.selectList(new EntityWrapper<WrkDetl>()
+                .eq(!Objects.isNull(params.getMatnr()), "matnr", params.getMatnr())
+                .eq("wrk_no", wrkMast.getWrkNo()));
 
         List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
         if (Cools.isEmpty(wrkDetls)) {
@@ -2053,7 +2058,6 @@
                 throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
             }
         });
-
 
 
 //        // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
@@ -2228,7 +2232,7 @@
             WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_loc_no", locMast.getLocNo()));
             // 鐢熸垚宸ヤ綔鍙�
             int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));
-            if (Cools.isEmpty(wrkMast1)){
+            if (Cools.isEmpty(wrkMast1)) {
                 Integer outSta = devp.getDevNo();
                 // 鑾峰彇璺緞
                 StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta);
@@ -2260,14 +2264,13 @@
                 if (!wrkMastService.insert(wrkMast)) {
                     throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐ワ紝鍑哄簱搴撲綅鍙凤細" + locMast.getLocNo());
                 }
-            }else {
+            } else {
                 workNo = wrkMast1.getWrkNo();
             }
             // 鐢熸垚宸ヤ綔妗f槑缁�
             for (LocDetl detlDto : crnTaskDetlDTO.getLocDetlList()) {
                 WrkDetl wrkDetl = new WrkDetl();
                 BeanUtils.copyProperties(detlDto, wrkDetl);
-                wrkDetl.setOrderNo(""); // 鎵嬪姩鍑哄簱涓嶉渶瑕佸甫鍑哄簱瀛樹腑鐨勫崟鎹紪鍙�
                 wrkDetl.setWrkNo(workNo);
                 wrkDetl.setIoTime(now);
                 wrkDetl.setZpallet(null);
@@ -2540,10 +2543,11 @@
 
     /**
      * 鍛煎彨AGV绌哄彴杞﹁繑鍥�
-     * @author Ryan
-     * @date 2025/9/24
+     *
      * @param callAgvBackParam
      * @return com.core.common.R
+     * @author Ryan
+     * @date 2025/9/24
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -2554,7 +2558,7 @@
 
         // 鎸夊綋鍓嶆煡鎵惧簱浣嶉『搴忥紝鏌ュ埌涓�涓悗锛屼笉鍐嶅線涓嬫煡璇�
         LocCache locCache = findPriorityLocCache();
-        
+
         if (Objects.isNull(locCache)) {
             return R.error("鏈煡璇㈠埌鍙敤搴撲綅");
         }

--
Gitblit v1.9.1