From a6419abb1e5dc63f8957da5eb45c82d49b86cbc9 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 07 一月 2025 16:38:47 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/utils/NavigateMapData.java |   50 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/zy/common/utils/NavigateMapData.java b/src/main/java/com/zy/common/utils/NavigateMapData.java
index 66a14d2..98cc5a1 100644
--- a/src/main/java/com/zy/common/utils/NavigateMapData.java
+++ b/src/main/java/com/zy/common/utils/NavigateMapData.java
@@ -5,9 +5,18 @@
 import com.zy.asrs.entity.BasMap;
 import com.zy.asrs.entity.LocMast;
 import com.zy.asrs.service.LocMastService;
+import com.zy.asrs.utils.Utils;
 import com.zy.common.model.MapNode;
 import com.zy.common.model.enums.NavigationMapType;
+import com.zy.core.cache.SlaveConnection;
+import com.zy.core.enums.MapNodeType;
 import com.zy.core.enums.RedisKeyType;
+import com.zy.core.enums.SlaveType;
+import com.zy.core.model.ForkLiftSlave;
+import com.zy.core.model.protocol.ForkLiftStaProtocol;
+import com.zy.core.properties.SlaveProperties;
+import com.zy.core.thread.ForkLiftThread;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.stereotype.Component;
 
@@ -20,6 +29,9 @@
  */
 @Component
 public class NavigateMapData {
+
+    @Autowired
+    private SlaveProperties slaveProperties;
 
     public int[][] getData(Integer lev, Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
         try {
@@ -295,12 +307,12 @@
                         || locMast.getLocSts().equals("R")
                         || locMast.getLocSts().equals("P")
                 ) {
-                    mapNode.setValue(-1);//绂佺敤鑺傜偣
+                    mapNode.setValue(MapNodeType.DISABLE.id);//绂佺敤鑺傜偣
                 }
             } else if (mapType == NavigationMapType.NORMAL.id) {
                 //杩囨护搴撲綅鐘舵�乆
                 if (locMast.getLocSts().equals("X")) {
-                    mapNode.setValue(-1);//绂佺敤鑺傜偣
+                    mapNode.setValue(MapNodeType.DISABLE.id);//绂佺敤鑺傜偣
                 }
             }
 
@@ -316,7 +328,7 @@
                 int y = points[1];
                 List<MapNode> list = lists.get(x);
                 MapNode mapNode = list.get(y);
-                mapNode.setValue(66);//璁剧疆涓鸿溅杈嗕唬鐮�66
+                mapNode.setValue(MapNodeType.CAR.id);//璁剧疆涓鸿溅杈嗕唬鐮�66
                 //鏇存柊list
                 list.set(y, mapNode);
                 lists.set(x, list);
@@ -343,6 +355,38 @@
             }
         }
 
+        //鍔犺浇璐у弶鎻愬崌鏈烘斁璐х偣浣嶆暟鎹�
+        for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) {
+            ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, forkLiftSlave.getId());
+            if (forkLiftThread == null) {
+                continue;
+            }
+
+            for (ForkLiftStaProtocol staProtocol : forkLiftThread.getForkLiftStaProtocols()) {
+                int row = Utils.getRow(staProtocol.getLocNo());
+                int bay = Utils.getBay(staProtocol.getLocNo());
+
+                List<MapNode> list = lists.get(row);
+                MapNode mapNode = list.get(bay);
+
+                if (mapType == NavigationMapType.DFX.id) {
+                    //杞﹁締鏈夎揣
+                    if (staProtocol.getHasTray()) {
+                        mapNode.setValue(MapNodeType.DISABLE.id);
+                    }
+                }else {
+                    if (staProtocol.getHasCar()) {
+                        mapNode.setValue(MapNodeType.CAR.id);
+                    }
+                }
+
+                //鏇存柊list
+                list.set(bay, mapNode);
+                lists.set(row, list);
+            }
+
+        }
+
         return lists;
     }
 

--
Gitblit v1.9.1