From 45ef6114889aedd3dc63bcfc132b84343248c34b Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 05 四月 2024 19:51:39 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
index 1ad96fc..ae17e90 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
@@ -55,11 +55,12 @@
         if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
             throw new CoolException(BaseRes.PARAM);
         }
+        param.setContainerType(Short.valueOf(param.getBarcode().substring(0,2)));
 
-        //妫�鏌ユ槸鍚﹀凡瀛樺湪鐩稿悓鐨勬墭鐩樻潯鐮侊紝瀛樺湪鍒欐姏鍑哄紓甯�
-        if (agvWaitPakinService.selectCount(new EntityWrapper<AgvWaitPakin>().eq("supp_code", param.getBarcode())) > 0) {
-            throw new CoolException(param.getBarcode() + "鏂欐兂鐮佸凡瀛樺湪AGV鍏ュ簱閫氱煡妗d腑");
-        }
+//        //妫�鏌ユ槸鍚﹀凡瀛樺湪鐩稿悓鐨勬墭鐩樻潯鐮侊紝瀛樺湪鍒欐姏鍑哄紓甯�
+//        if (agvWaitPakinService.selectCount(new EntityWrapper<AgvWaitPakin>().eq("supp_code", param.getBarcode())) > 0) {
+//            throw new CoolException(param.getBarcode() + "鏂欐兂鐮佸凡瀛樺湪AGV鍏ュ簱閫氱煡妗d腑");
+//        }
 
         //妫�鏌ュ簱瀛樻槸鍚︽湁鐩稿悓鏂欑锛屽瓨鍦ㄥ垯鎶涘嚭寮傚父
         if(!Cools.isEmpty(agvLocDetlService.selectOne(new EntityWrapper<AgvLocDetl>().eq("supp_code",param.getBarcode())))){
@@ -82,7 +83,7 @@
         if(StringUtils.isEmpty(param.getLocno())){
             return "缁勬墭鎴愬姛";
         }else {
-            combBinding(param.getBarcode(),param.getLocno());
+            combBinding(param.getBarcode(),param.getLocno(),param.getContainerType());
             return "缁勬墭鎴愬姛锛岀粦瀹氱珯鐐规垚鍔�";
         }
 
@@ -219,19 +220,24 @@
     }
 
     @Override
-    public void combBinding(String barcode, String stationCode) {
+    public void combBinding(String barcode, String stationCode, Short containerType) {
+
+        AgvBasDevp agvBasDevp = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("dev_no", stationCode));
+
+        if(Cools.eq(agvBasDevp.getBarcode(),barcode)){
+            return;
+        }
 
         if(Cools.isEmpty(agvWaitPakinService.selectByContainerCode(barcode))){
             throw new CoolException("璇ユ枡绠辨湭缁勬墭锛屾棤娉曠粦瀹氱珯鐐�");
         }
 
-        AgvBasDevp agvBasDevp = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("barcode", barcode));
+        AgvBasDevp agvBasDevp1 = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("barcode", barcode));
 
-        if(!Cools.isEmpty(agvBasDevp)){
+        if(!Cools.isEmpty(agvBasDevp1)){
             throw new CoolException(barcode + "宸茬粡缁戝畾鍦�"+ agvBasDevp.getDevNo() +"绔欑偣");
         }
 
-        agvBasDevp = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("dev_no",stationCode));
         if(agvBasDevp == null){
             throw new CoolException(stationCode + "绔欑偣淇℃伅閿欒");
         }
@@ -245,6 +251,7 @@
 
         agvBasDevp.setBarcode(barcode);
         agvBasDevp.setLocSts("F");
+        agvBasDevp.setLocType2(containerType);
         agvBasDevpService.update(agvBasDevp,(new EntityWrapper<AgvBasDevp>().eq("dev_no",stationCode)));
     }
 

--
Gitblit v1.9.1