From 5c698a110c552d5ef7af812f89d2950b82724c02 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 12 六月 2024 15:10:43 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
index 2669988..62e16cb 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
@@ -73,9 +73,19 @@
         if (null == shuttleProtocol) {
             return false;
         }
-        if (!shuttleThread.isIdle()) {//璁惧涓嶇┖闂�
+
+        if (!shuttleThread.isIdle(new ExecuteSupport() {
+            @Override
+            public Boolean judgement() {
+                if (Objects.equals(MotionCtgType.get(motion.getMotionCtgEl()), MotionCtgType.SHUTTLE_CHARGE_OFF)) {//闈炲叧闂厖鐢祄otion锛岄渶瑕佸垽鏂澶囩姸鎬�
+                    return false;//涓嶉渶瑕佸垽鏂姸鎬�
+                }
+                return true;//闇�瑕佸垽鏂姸鎬�
+            }
+        })) {//璁惧涓嶇┖闂�
             return false;
         }
+
         if (motionService.count(new LambdaQueryWrapper<Motion>()
                 .eq(Motion::getDeviceCtg, DeviceCtgType.SHUTTLE.val())
                 .eq(Motion::getDevice, motion.getDevice())
@@ -275,11 +285,13 @@
 
         //鍏呯數浠诲姟
         if (Objects.requireNonNull(MotionCtgType.get(motion.getMotionCtgEl())).equals(MotionCtgType.SHUTTLE_CHARGE_ON)) {
-            // 澶嶄綅绌挎杞�
-            shuttleThread.setSyncTaskNo(0);
-            shuttleThread.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
-            shuttleThread.setPakMk(true);
-            return true;
+            if (shuttleProtocol.getHasCharge() || shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.CHARGING_WAITING)) {
+                // 澶嶄綅绌挎杞�
+                shuttleThread.setSyncTaskNo(0);
+                shuttleThread.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
+                shuttleThread.setPakMk(true);
+                return true;
+            }
         }
 
         if (!shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.WAITING)
@@ -514,7 +526,7 @@
             //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
             String distCodeNum = NavigatePositionConvert.xyToPosition(endPath.getX(), endPath.getY(), endPath.getZ(), hostId);
             //鑾峰彇绉诲姩鍛戒护
-            ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed);
+            ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes);
             command.setNodes(nodes);//灏嗚璧拌妭鐐规坊鍔犲埌姣忎竴姝ュ懡浠や腑
             commands.add(command);
         }

--
Gitblit v1.9.1