From d835d1b51f832889929cdf69010034a30ef44d02 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期四, 17 十月 2024 13:57:29 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java
index d03039a..ab8d8aa 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java
@@ -15,6 +15,7 @@
 import com.zy.asrs.wcs.core.service.TaskService;
 import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
 import com.zy.asrs.wcs.rcs.entity.Device;
+import com.zy.asrs.wcs.rcs.model.enums.ShuttleProtocolStatusType;
 import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
 import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol;
 import com.zy.asrs.wcs.rcs.service.DeviceService;
@@ -139,6 +140,14 @@
                 continue;
             }
 
+            if (shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.OFFLINE)) {
+                continue;
+            }
+
+            if (shuttleProtocol.getCurrentLocNo() == null) {
+                continue;
+            }
+
             if (shuttleProtocol.getCurrentLocNo().equals(locNo)) {
                 return true;
             }
@@ -186,9 +195,9 @@
     /**
      * 妫�娴嬬┛姊溅鏄惁鏈変换鍔$粦瀹�
      */
-    public static boolean checkShuttleHasBinding(Device device) {
+    public static boolean checkShuttleHasBinding(Device device, String taskNo) {
         TaskService taskService = SpringUtils.getBean(TaskService.class);
-        List<Task> tasks = taskService.selectWorkingByShuttle(Integer.parseInt(device.getDeviceNo()));
+        List<Task> tasks = taskService.selectWorkingByShuttle(Integer.parseInt(device.getDeviceNo()), taskNo);
         if (tasks.isEmpty()) {
             return false;//鏃犱换鍔$粦瀹�
         }
@@ -199,8 +208,15 @@
      * 妫�娴嬫彁鍗囨満鏄惁鏈変换鍔$粦瀹�
      */
     public static boolean checkLiftHasBinding(Integer liftNo) {
+        return checkLiftHasBinding(liftNo, null);
+    }
+
+    /**
+     * 妫�娴嬫彁鍗囨満鏄惁鏈変换鍔$粦瀹�
+     */
+    public static boolean checkLiftHasBinding(Integer liftNo, String taskNo) {
         TaskService taskService = SpringUtils.getBean(TaskService.class);
-        List<Task> tasks = taskService.selectWorkingByLift(liftNo);
+        List<Task> tasks = taskService.selectWorkingByLift(liftNo, taskNo);
         if (tasks.isEmpty()) {
             return false;//鏃犱换鍔$粦瀹�
         }

--
Gitblit v1.9.1