From 1b3cb17b50e9f0bca21d19c7d621d94e3e6270ed Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期五, 12 十二月 2025 15:32:21 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   94 ++++++++++++++++++++--------------------------
 1 files changed, 41 insertions(+), 53 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 3848d97..d001640 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -656,6 +656,7 @@
                 waitPakin.setAnfme(detlDto.getAnfme());
                 waitPakin.setThreeCode(detlDto.getThreeCode());
                 waitPakin.setStatus("Y");
+                waitPakin.setSuppCode(detlDto.getStandby1());
                 waitPakin.setStandby1(detlDto.getStandby1());
                 waitPakin.setStandby2(detlDto.getStandby2());
                 waitPakin.setStandby3(detlDto.getStandby3());
@@ -1332,22 +1333,10 @@
     @Transactional(rollbackFor = Exception.class)
     public R OutCallAgv(AgvCallParams params, Long userId) {
 
-        BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
-                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
-                .eq("dev_no", params.getTarSite()));
-        if (Objects.isNull(station)) {
-            throw new CoolException("璇锋鏌ョ珯鐐逛俊鎭紒");
-        }
-
-        /** 鑾峰彇鍏ュ簱鏈�鏃╃殑涓�鏉℃暟鎹� **/
+        /**鑾峰彇鍏ュ簱鏈�鏃╃殑涓�鏉℃暟鎹�**/
         List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>()
                 .eq("loc_sts", LocStsType.LOC_STS_TYPE_F.type)
                 .eq("frozen", 0)
-                .in("loc_no", new EntityWrapper<LocDetl>()
-                        .setSqlSelect("DISTINCT loc_no")
-                        .in("matnr", new EntityWrapper<Mat>()
-                                .setSqlSelect("matnr")
-                                .eq("tag_id", station.getCtnType())))
                 .orderDesc(Arrays.asList("sort", "first_time")));
 
         if (locCaches.isEmpty()) {
@@ -1355,9 +1344,8 @@
         }
 
         for (LocCache locCache : locCaches) {
-            // 鑾峰彇缂撳瓨鍖轰俊鎭�
-            BasAreas basAreas = basAreasService.selectOne(
-                    new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
+            //鑾峰彇缂撳瓨鍖轰俊鎭�
+            BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
             if (Objects.isNull(basAreas)) {
                 throw new CoolException("搴撳尯涓嶅瓨鍦紒锛�");
             }
@@ -1381,19 +1369,18 @@
 
             Mat mat = matList.stream().findFirst().get();
 
-//            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
-//                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
-//                    .eq("ctn_type", mat.getTagId())
-//                    .eq("dev_no", params.getTarSite()));
-
-            if (mat.getTagId() != station.getCtnType().longValue()){
+            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
+                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
+                    .eq("ctn_type", mat.getTagId())
+                    .eq("dev_no", params.getTarSite()));
+            if (Objects.isNull(station)) {
                 continue;
             }
 
-            /** 鐢熸垚缂撳瓨鍖哄嚭搴撲换鍔� */
+            /**鐢熸垚缂撳瓨鍖哄嚭搴撲换鍔�*/
             generateCacheOutTask(station, locCache, userId);
 
-            /** 鐢熸垚绔嬪簱鍑哄簱浠诲姟 */
+            /**鐢熸垚绔嬪簱鍑哄簱浠诲姟*/
             generateCRNOutTask(station, locCache, userId);
 
             return R.ok();
@@ -1758,21 +1745,21 @@
         if (Objects.isNull(param.getStation())) {
             throw new CoolException("绔欑偣涓嶈兘涓虹┖!!");
         }
-        // TODO 淇敼缂撳瓨绔欑偣鐘舵�佸強鏁版嵁
-        Task task = taskService.selectOne(new EntityWrapper<Task>()
-                .eq("wrk_sts", 14L)
-                .eq("barcode", param.getCarBarcode()));
-        if (Objects.isNull(task)) {
-            throw new CoolException("鏁版嵁閿欒,浠诲姟涓嶅瓨鍦�!!");
-        }
-        List<TaskDetl> taskDetls = taskDetlService
-                .selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo()));
-        if (Objects.isNull(taskDetls) || taskDetls.isEmpty()) {
-            throw new CoolException("鏁版嵁閿欒,浠诲姟鏄庣粏涓嶅瓨鍦�!!");
-        }
+//        // TODO 淇敼缂撳瓨绔欑偣鐘舵�佸強鏁版嵁
+//        Task task = taskService.selectOne(new EntityWrapper<Task>()
+//                .eq("wrk_sts", 14L)
+//                .eq("barcode", param.getCarBarcode()));
+//        if (Objects.isNull(task)) {
+//            throw new CoolException("鏁版嵁閿欒,浠诲姟涓嶅瓨鍦�!!");
+//        }
+//        List<TaskDetl> taskDetls = taskDetlService
+//                .selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo()));
+//        if (Objects.isNull(taskDetls) || taskDetls.isEmpty()) {
+//            throw new CoolException("鏁版嵁閿欒,浠诲姟鏄庣粏涓嶅瓨鍦�!!");
+//        }
 
         BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
-                .eq("dev_no", task.getStaNo()));
+                .eq("dev_no", param.getStation()));
         if (Objects.isNull(station)) {
             throw new CoolException("绔欑偣涓嶅瓨鍦�!!");
         }
@@ -1783,12 +1770,12 @@
         }
         basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
 
-        // 浠诲姟瀹屾垚
-        task.setWrkSts(15L);
-
-        if (!taskService.updateById(task)) {
-            throw new CoolException("AGV浠诲姟瀹屾垚澶辫触!!");
-        }
+//        // 浠诲姟瀹屾垚
+//        task.setWrkSts(15L);
+//
+//        if (!taskService.updateById(task)) {
+//            throw new CoolException("AGV浠诲姟瀹屾垚澶辫触!!");
+//        }
 
         List<WaitPakin> waitPakins = waitPakinService
                 .selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
@@ -1838,6 +1825,7 @@
                 Mat mat = matService.selectByMatnr(combMat.getMatnr());
                 BeanUtils.copyProperties(mat, basStationDetl);
                 basStationDetl
+                        .setId(null)
                         .setOrderNo(orderPakin.getOrderNo())
                         .setDevNo(basStation.getDevNo())
                         .setBarcode(params.getTarBarcode())
@@ -1982,16 +1970,16 @@
                 throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
             }
         });
-        // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
-        Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
-                .eq("zpallet", pakin.getZpallet());
-        WaitPakin setParam = new WaitPakin();
-        setParam.setLocNo(dto.getLocNo());
-        setParam.setIoStatus("Y");
-        setParam.setModiTime(now);
-        if (!waitPakinService.update(setParam, wrapper)) {
-            throw new CoolException("鏇存柊閫氱煡妗eけ璐�");
-        }
+//        // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
+//        Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
+//                .eq("zpallet", pakin.getZpallet());
+//        WaitPakin setParam = new WaitPakin();
+//        setParam.setLocNo(dto.getLocNo());
+//        setParam.setIoStatus("Y");
+//        setParam.setModiTime(now);
+//        if (!waitPakinService.update(setParam, wrapper)) {
+//            throw new CoolException("鏇存柊閫氱煡妗eけ璐�");
+//        }
         // 鏇存柊婧愮珯鐐逛俊鎭�
         sourceStaNo.setWrkNo(workNo);
         sourceStaNo.setModiTime(now);

--
Gitblit v1.9.1