From c349a2a5dddfa4d7e6a5c834f757607c39f8bfd6 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 11 十一月 2024 13:56:37 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 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 f948a7b..6ff35f8 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -8,6 +8,7 @@
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.entity.param.*;
+import com.zy.asrs.mapper.BasDevpMapper;
 import com.zy.asrs.mapper.ManLocDetlMapper;
 import com.zy.asrs.service.*;
 import com.zy.asrs.utils.MatUtils;
@@ -24,6 +25,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.util.*;
 
 /**
@@ -73,13 +75,25 @@
     @Autowired
     private ManLocDetlMapper manLocDetlMapper;
 
+    @Resource
+    private BasDevpMapper basDevpMapper;
 
     @Override
     public R inLocCallAgv(String sta, String inSta) {
-        // 鍒ゆ柇鍏ュ簱绔欑偣鏈夋棤鍑哄簱浠诲姟杩囨护鐩樼偣鎹℃枡
-        int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("sta_no", inSta).ne("wrk_sts",15).notIn("io_type",103,107));
-        if (count > 0) {
-            return R.parse(inSta + "绔欑偣瀛樺湪鍑哄簱浠诲姟");
+
+        BasDevp basDevp = basDevpMapper.selectById(inSta);
+        // 0.鍑哄簱妯″紡锛�1.agv鍏ュ簱涓紝2.鐢熸垚鍏ュ簱浠诲姟
+        if (basDevp.getDevMk().equals("0")) { // 鏄嚭搴�
+             // 鍒ゆ柇鏄惁鏈夊嚭搴撲换鍔�
+            int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>()
+                    .eq("sta_no", inSta).lt("wrk_sts",14).in("io_type",101,103,107,110));
+            if (count == 0) {
+                // 娌℃湁鍑哄簱浠诲姟锛屾洿鏀逛负鍏ュ簱妯″紡
+                basDevp.setDevMk("1");
+                basDevpMapper.updateById(basDevp);
+            } else {
+                return R.parse(inSta + "绔欑偣瀛樺湪鍑哄簱浠诲姟");
+            }
         }
 
         // 鍏堢粦瀹�
@@ -802,6 +816,13 @@
     public void leftoversOut(Map<String, Object> map,Long userId) {
         String barcode = map.get("barcode").toString();
         String barcode2 = map.get("barcode2").toString();
+
+        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",barcode2));
+        int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("zpallet",barcode2).ne("io_type",200));
+        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",barcode2));
+        if (countLoc > 0 || countWrk > 0 || countwait > 0) {
+            throw new CoolException("璇ユ潯鐮佸凡琚娇鐢�===>>" + barcode2);
+        }
         WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode).eq("io_type", 103));
         if (Cools.isEmpty(wrkMast)) {
             throw new CoolException("鏈煡璇㈠埌鎷f枡浠诲姟");

--
Gitblit v1.9.1