From 53da98b415ee2021346c83a86be3617b1ef2c984 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 26 六月 2025 15:50:03 +0800
Subject: [PATCH] 清除托盘码站点

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java
index 26cfdd1..7e70281 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java
@@ -84,7 +84,7 @@
         if (task == null) {
             return R.error("浠诲姟涓嶅瓨鍦紒锛�");
         }
-        log.info("瀹瑰櫒鍒拌揪鎺ユ敹锛屼换鍔″彿锛歿}锛屽綋鍓嶇姸鎬侊細{}锛屼笂鎶ョ姸鎬侊細{}",task.getTaskNo(),task.getTaskSts$(),TaskStsType.WCS_CONTAINER_RECEIVE.desc);
+        log.info("瀹瑰櫒鍒拌揪鎺ユ敹锛屼换鍔″彿锛歿}锛屽綋鍓嶇姸鎬侊細{}锛屼笂鎶ョ姸鎬侊細{}, 鎺ユ敹鍙傛暟锛歿}",task.getTaskNo(),task.getTaskSts$(),TaskStsType.WCS_CONTAINER_RECEIVE.desc, JSONObject.toJSONString(arrivedParam));
 
         taskType = task.getTaskType() > 100 ? "outStock":"inStock";
 
@@ -107,7 +107,9 @@
             if (task.getTaskSts() == TaskStsType.WCS_EXECUTE_OUT_ARRIVED.id
             || task.getTaskSts() == TaskStsType.WCS_EXECUTE_OUT_TASK_DONE.id ) {
                 // 鍒拌揪鎷i�変綅锛屾帶鍒舵挱绉嶅浜伅
-                    List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getBarcode, task.getBarcode()));
+                    List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
+                                    .eq(CacheSite::getSiteNo, arrivedParam.getSlotCode())
+                            .eq(CacheSite::getBarcode, task.getBarcode()));
                     if(cacheSites.size() == 0) {
                         log.error("鏉$爜锛歿}锛屾湭鎵惧埌鎾澧欎寒鐏�",task.getBarcode());
                         throw new CoolException("鏈壘鍒版挱绉嶅");
@@ -347,7 +349,7 @@
     public R slapLightLogic(Map<String, Object> request) {
         String taskNo = request.get("taskNo").toString();
         String orderNo = request.get("orderNo").toString();
-
+        String siteNo = Objects.isNull(request.get("siteNo")) ? null : request.get("siteNo").toString();
         List<CacheSite> performs = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderNo, orderNo));
         if (Objects.isNull(performs.stream().findFirst().get().getPlatformId())) {
             throw new CoolException("璇锋墦鍗版槑缁嗭紝骞剁粦瀹氱洰鏍囬泦璐у尯");
@@ -376,21 +378,21 @@
 //            }).collect(Collectors.toList());
 
             //鍒ゆ柇鏁伴噺鏄惁涓庤鍗曟槑缁嗙殑闇�姹傞噺鐩稿悓锛岀浉鍚屽垯璁㈠崟瀹屾垚
-            if (one.getPickStatus() == OrderPickStatus.ORDER_PICK_STATUS_DONE.val) {
-                //鎾瀹屾垚锛岄噴鏀剧粦瀹氱珯鐐�
-                List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderNo, orderNo));
-                for (CacheSite cacheSite : cacheSites) {
-                    if (!cacheSite.getSiteStatus().equals(CacheSiteStatusType.O.id)) {
-                        cacheSite.setSiteStatus(CacheSiteStatusType.O.id);
-                        cacheSite.setOrderId(null);
-                        cacheSite.setBarcode(null);
-                        cacheSite.setOrderNo(null);
-                        cacheSite.setPlatformId(null);
-                        cacheSite.setPlatformNo(null);
-                        cacheSite.setUpdateTime(new Date());
-                        if (!cacheSiteService.updateById(cacheSite)) {
-                            throw new CoolException("鎾绔欑偣鏇存柊澶辫触");
-                        }
+            //鎾瀹屾垚锛岄噴鏀剧粦瀹氱珯鐐�
+            List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
+                    .eq(!Objects.isNull(siteNo), CacheSite::getSiteNo, siteNo)
+                    .eq(CacheSite::getOrderNo, orderNo));
+            for (CacheSite cacheSite : cacheSites) {
+                if (!cacheSite.getSiteStatus().equals(CacheSiteStatusType.O.id)) {
+                    cacheSite.setSiteStatus(CacheSiteStatusType.O.id);
+                    cacheSite.setOrderId(null);
+                    cacheSite.setBarcode(null);
+                    cacheSite.setOrderNo(null);
+                    cacheSite.setPlatformId(null);
+                    cacheSite.setPlatformNo(null);
+                    cacheSite.setUpdateTime(new Date());
+                    if (!cacheSiteService.updateById(cacheSite)) {
+                        throw new CoolException("鎾绔欑偣鏇存柊澶辫触");
                     }
                 }
             }

--
Gitblit v1.9.1