From 5432b5251106ba5e8e5512c6868d31ebaec0b8ce Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期一, 31 三月 2025 09:59:07 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/utils/ShuttleOperaUtils.java |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java b/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
index 4c44728..9451d91 100644
--- a/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
+++ b/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
@@ -44,7 +44,7 @@
         Integer shuttleNo = shuttleProtocol.getShuttleNo();
         //鑾峰彇灏忚溅绉诲姩閫熷害
         Integer runSpeed = Optional.ofNullable(basShuttleService.selectOne(new EntityWrapper<BasShuttle>().eq("shuttle_no", shuttleNo)).getRunSpeed()).orElse(1000);
-        List<NavigateNode> nodeList = navigateUtils.calc(startLocNo, endLocNo, mapType, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startLocNo)), null);
+        List<NavigateNode> nodeList = navigateUtils.calc(startLocNo, endLocNo, mapType, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startLocNo)), whites);
         if (nodeList == null) {
             News.error("{} dash {} can't find navigate path!", startLocNo, endLocNo);
             shuttleThread.offerSystemMsg("{} dash {} can't find navigate path!", startLocNo, endLocNo);
@@ -52,8 +52,24 @@
         }
 
         List<NavigateNode> allNode = new ArrayList<>();
+        List<NavigateNode> lockNode = new ArrayList<>();
         for (NavigateNode node : nodeList) {
             allNode.add(node.clone());
+
+            if (whites != null) {
+                boolean flag = false;
+                for (int[] white : whites) {
+                    if(white[0] == node.getX() && white[1] == node.getY()) {
+                        flag = true;
+                        break;
+                    }
+                }
+
+                if (flag) {//鐧藉悕鍗曡烦杩囬攣瀹�
+                    continue;
+                }
+            }
+            lockNode.add(node.clone());
         }
 
         List<ShuttleCommand> commands = new ArrayList<>();
@@ -79,7 +95,7 @@
 
         assignCommand.setNodes(allNode);//褰撳墠浠诲姟鎵�鍗犵敤鐨勮妭鐐筶ist
 
-        boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(startLocNo), shuttleNo, allNode, true);//閿佸畾璺緞
+        boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(startLocNo), shuttleNo, lockNode, true);//閿佸畾璺緞
         if (!result) {
             News.error("{} dash {} can't lock path!", startLocNo, endLocNo);
             shuttleThread.offerSystemMsg("{} dash {} can't lock path!", startLocNo, endLocNo);

--
Gitblit v1.9.1