From 05466547c913ad2cd29944e5444dd387ce64b25f Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 18 十二月 2025 16:07:48 +0800
Subject: [PATCH] bug修复

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 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 2eb3bf8..09ec30e 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -599,6 +599,12 @@
         if (Objects.isNull(param.getBarcode())) {
             throw new CoolException("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�");
         }
+
+        BasContainer container = basContainerService
+                .selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
+        if (Objects.isNull(container)) {
+            throw new CoolException("鏁版嵁閿欒锛氬鍣ㄧ爜涓嶅瓨鍦紒锛�");
+        }
         // if (param.getBarcode().length() != 8) {
         // throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode());
         // }
@@ -1534,7 +1540,7 @@
             station.setModiTime(new Date());
             station.setModiUser(userId);
             if (!basStationService.updateById(station)) {
-                throw new CoolException("鏇存柊鐩爣搴撲綅鐘舵�佸け璐�");
+                throw new CoolException("鏇存柊鐩爣绔欑偣鐘舵�佸け璐�");
             }
         } else {
             throw new CoolException("绉昏浆澶辫触锛岀洰鏍囧簱浣嶇姸鎬侊細" + station.getLocSts());
@@ -1604,6 +1610,7 @@
         if (Objects.isNull(param.getBarcode())) {
             throw new CoolException("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�");
         }
+
         if (Objects.isNull(param.getCombMats()) || param.getCombMats().isEmpty()) {
             throw new CoolException("缁勬墭鏄庣粏涓嶈兘涓虹┖锛侊紒");
         }
@@ -1734,6 +1741,7 @@
                     throw new CoolException("鏁版嵁閿欒锛岀珯鐐逛笉瀛樺湪锛侊紒");
                 }
                 station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
+                station.setBarcode(null);
                 if (!basStationService.updateById(station)) {
                     throw new CoolException("绔欑偣鐘舵�佹洿鏂板け璐ワ紒锛�");
                 }
@@ -1778,6 +1786,7 @@
         }
 
         station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
+        station.setBarcode(null);
         if (!basStationService.updateById(station)) {
             throw new CoolException("绔欑偣鐘舵�佷慨鏀瑰け璐�!");
         }
@@ -1799,6 +1808,13 @@
         generateCrnInTask(waitPakins, station, param.getLocType1(), userId);
     }
 
+    /**
+     * SO/EO 鍖虹粍鎵�
+     * @author Ryan
+     * @date 2025/12/18 15:19
+     * @param params
+     * @return com.core.common.R
+     */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R collectionPakin(CollectionPakinParams params, Long userId) {
@@ -2171,8 +2187,8 @@
 
         // 鍒ゆ柇鏍规嵁鍒嗘嫞鍑哄簱鍚�,杩橀渶瑕佸嚭澶氬皯鎵樼洏鎴栨枡绠�;濡傛灉浣欐枡澶т簬0, 鍑烘柊鎵樼洏鎴栨枡绠�
         if (totalOut.get().compareTo(0.0) > 0) {
-            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
-            //TODO 缁嗗寲鍖哄垎锛屽綋鍓嶅嚭搴撴墭鐩樻槸婊炴弧瓒虫嫞璐ф暟閲�
+            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId, station);
+            //TODO 缁嗗寲鍖哄垎锛屽綋鍓嶅嚭搴撴墭鐩樻槸婊¤冻鎷h揣鏁伴噺
         } else {
             LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                     // todo 鏍规嵁鐗╂枡绉嶇被,鍖哄垎搴撳尯绫诲瀷
@@ -2182,7 +2198,7 @@
             CrnTaskDetlDTO crnTaskDetlDTO = new CrnTaskDetlDTO().setLocNo(locMast.getLocNo()).setLocDetlList(locDetls);
             locMasts.add(crnTaskDetlDTO);
             // 绌烘澘鍑哄簱
-            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
+            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId, station);
         }
     }
 
@@ -2190,11 +2206,12 @@
      * 鐢熸垚鍫嗗灈鏈哄嚭搴撲换鍔�
      *
      * @param locMasts
+     * @param station
      * @author Ryan
      * @date 2025/12/6 14:44
      */
     @Transactional(rollbackFor = Exception.class)
-    public void generateTask(List<CrnTaskDetlDTO> locMasts, Integer ioType, BasDevp devp, Long userId) {
+    public void generateTask(List<CrnTaskDetlDTO> locMasts, Integer ioType, BasDevp devp, Long userId, BasStation station) {
         Date now = new Date();
 
         for (CrnTaskDetlDTO crnTaskDetlDTO : locMasts) {
@@ -2221,6 +2238,9 @@
                 wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 婧愮珯
                 wrkMast.setStaNo(staDesc.getStnNo() + ""); // 鐩爣绔�
                 wrkMast.setSourceLocNo(locMast.getLocNo()); // 婧愬簱浣�
+                //灏忔澗椤圭洰锛岀紦瀛樺嚭搴揂GV绔欑偣锛岀敤浜庢竻绌虹紦瀛樺尯搴撳瓨
+                wrkMast.setPauseMk(station.getDevNo());
+//                wrkMast.setAvgSta(station.getDevNo());;
                 wrkMast.setFullPlt("Y"); // 婊℃澘锛歒
                 wrkMast.setPicking("N"); // 鎷f枡
                 wrkMast.setExitMk("N"); // 閫�鍑�
@@ -2244,6 +2264,8 @@
                 wrkDetl.setOrderNo(""); // 鎵嬪姩鍑哄簱涓嶉渶瑕佸甫鍑哄簱瀛樹腑鐨勫崟鎹紪鍙�
                 wrkDetl.setWrkNo(workNo);
                 wrkDetl.setIoTime(now);
+                wrkDetl.setZpallet(null);
+                wrkDetl.setBarcode(null);
                 wrkDetl.setAppeTime(now);
                 wrkDetl.setAppeUser(userId);
                 wrkDetl.setModiTime(now);
@@ -2443,7 +2465,7 @@
 
         if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
             station.setLocSts("R"); // S.鍏ュ簱棰勭害
-            station.setBarcode(barcode);
+//            station.setBarcode(barcode);
             station.setModiTime(new Date());
             station.setModiUser(userId);
             if (!basStationService.updateById(station)) {

--
Gitblit v1.9.1