From f4af5b89cf61b3c4d7e1d49f23d7c0e617f3aabe Mon Sep 17 00:00:00 2001
From: tzsk <Administrator@qq.com>
Date: 星期三, 07 二月 2024 09:28:04 +0800
Subject: [PATCH] Changes

---
 src/main/java/com/zy/common/web/WcsController.java |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index 6ccd5fe..b84aa9c 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -65,6 +65,8 @@
     private WrkMastMapper wrkMastMapper;
     @Autowired
     private WrkMastLogService wrkMastLogService;
+    @Autowired
+    private AgvWrkDetlService agvWrkDetlService;
 //    @Autowired
 //    private ErpService erpService;
 
@@ -592,25 +594,27 @@
 
         //鎷f枡銆佺洏鐐瑰畬鎴愪换鍔�
         if(!Cools.isEmpty(agvWrkMast) && (agvWrkMast.getIoType() == 103 || agvWrkMast.getIoType() == 107) && agvWrkMast.getWrkSts() == 205){
+            //缁戝畾绔欑偣
+            agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode);
+
             //鐢熸垚鎷f枡銆佺洏鐐瑰啀鍏ュ簱浠诲姟
             List<AgvWrkMast> agvWrkMastList = new ArrayList<>();
             agvWrkMast.setMk("Y");
             agvWrkMast.setLocNo(agvBasDevp.getDevNo());
             agvWrkMastList.add(agvWrkMast);
             agvWorkService.pickIn(agvWrkMastList);
-            //缁戝畾绔欑偣
-            agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode);
+
             return R.ok();
         }
 
         //鍏ュ簱浠诲姟
         if (!Cools.isEmpty(agvWaitPakinService.selectByContainerCode(containerCode))){
+            //缁戝畾绔欑偣
+            agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode);
             //鐢熸垚宸ヤ綔妗�
             List<AgvBasDevp> agvBasDevpList = agvBasDevpService.selectList(new EntityWrapper<AgvBasDevp>().eq("dev_no", param.getDevNo()));
             agvWorkService.createWaitPainWrkMastStart(agvBasDevpList, null, true);
 
-            //缁戝畾绔欑偣
-            agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode);
             return R.ok();
         }
 
@@ -626,15 +630,24 @@
             currentContainerMap = new HashMap<>();
         }
 
-        String devNo = param.getDevNo();
         String containerCode = param.getContainerCode();
+        if(Cools.isEmpty(containerCode)){
+            throw new CoolException("鏂欑鐮佷负绌�");
+        }
+
+        if(!Character.isDigit(containerCode.charAt(0))){
+            containerCode = containerCode.substring(3,containerCode.length());
+        }
+
+
+        String devNo = param.getDevNo();
         String currentContainerCode = currentContainerMap.get(devNo);
 
         //鍒ゆ柇瀹瑰櫒鏄惁鍙戠敓鍙樺寲
         if(!Cools.eq(containerCode,currentContainerCode)){
             //鏌ヨ鏃у鍣ㄧ殑宸ヤ綔妗�
             AgvWrkMast agvWrkMast = agvWrkMastService.selectByContainerCode(currentContainerCode);
-            if(agvWrkMast.getIoType() == 101){
+            if(Cools.isEmpty(agvWrkMast) && agvWrkMast.getIoType() == 101){
                 //鍙戦�佸鍣ㄧ珛鍦鸿姹傦紝瀹屾垚宸ヤ綔妗�
                 List<AgvWrkMast> agvWrkMastList = new ArrayList<>();
                 agvWrkMastList.add(agvWrkMast);
@@ -669,12 +682,12 @@
         //鏌ユ壘璇ュ鍣ㄧ殑宸ヤ綔妗�
         AgvWrkMast agvWrkMast = agvWrkMastService.selectByContainerCode(containerCode);
         if(!Cools.isEmpty(agvWrkMast)){
-            return R.ok(agvWrkMast);
+            return R.ok(agvWrkDetlService.selectByWrkNo(agvWrkMast.getWrkNo()));
         }
         //鏌ユ壘璇ュ鍣ㄧ殑鍏ュ簱閫氱煡妗�
-        AgvWaitPakin agvWaitPakin = agvWaitPakinService.selectByContainerCode(containerCode);
-        if(!Cools.isEmpty(agvWaitPakin)){
-            return R.ok(agvWaitPakin);
+        List<AgvWaitPakin> agvWaitPakinList = agvWaitPakinService.selectList(new EntityWrapper<AgvWaitPakin>().eq("supp_code", containerCode));
+        if(!Cools.isEmpty(agvWaitPakinList)){
+            return R.ok(agvWaitPakinList);
         }
 
         return R.error("娌℃湁璇ュ鍣ㄧ殑鍑哄簱銆佹嫞鏂欍�佸叆搴撲俊鎭瓑");

--
Gitblit v1.9.1