From 4e005e4936039fca16bfd1679942daa416a21986 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 20 十一月 2025 14:27:47 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/utils/NavigateSolution.java |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/common/utils/NavigateSolution.java b/src/main/java/com/zy/common/utils/NavigateSolution.java
index b76e86f..0cd7bed 100644
--- a/src/main/java/com/zy/common/utils/NavigateSolution.java
+++ b/src/main/java/com/zy/common/utils/NavigateSolution.java
@@ -63,6 +63,51 @@
         return navigateNodeList;
     }
 
+    public List<List<NavigateNode>> getRgvTrackMap() {
+        BasMapService basMapService = SpringUtils.getBean(BasMapService.class);
+        BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", 1));
+        if (basMap == null) {
+            throw new CoolException("鍦板浘涓嶅瓨鍦�");
+        }
+
+        List<List<JSONObject>> dataList = JSON.parseObject(basMap.getData(), List.class);
+
+        List<List<NavigateNode>> navigateNodeList = new ArrayList<>();
+        for (int i = 0; i < dataList.size(); i++) {
+            List<JSONObject> row = dataList.get(i);
+            List<NavigateNode> navigateNodeRow = new ArrayList<>();
+            for (int j = 0; j < row.size(); j++) {
+                JSONObject map = row.get(j);
+                NavigateNode navigateNode = new NavigateNode(i, j);
+
+                String nodeType = map.getString("type");
+                if(nodeType == null) {
+                    navigateNode.setValue(MapNodeType.DISABLE.id);
+                }else if(nodeType.equals("rgv")){
+                    navigateNode.setValue(MapNodeType.NORMAL_PATH.id);
+                    JSONObject valueObj = JSON.parseObject(map.getString("value"));
+
+                    //RGV鏆備笉鎺у埗琛岃蛋鏂瑰悜锛岄粯璁や笂涓嬪乏鍙抽兘鍙蛋
+                    List<String> directionList = new ArrayList<>();
+                    directionList.add("top");
+                    directionList.add("bottom");
+                    directionList.add("left");
+                    directionList.add("right");
+                    navigateNode.setDirectionList(directionList);
+                }else {
+                    navigateNode.setValue(MapNodeType.DISABLE.id);
+                }
+
+                navigateNode.setNodeType(nodeType);
+                navigateNode.setNodeValue(map.getString("value"));
+                navigateNodeRow.add(navigateNode);
+            }
+            navigateNodeList.add(navigateNodeRow);
+        }
+
+        return navigateNodeList;
+    }
+
     public NavigateNode astarSearchJava(List<List<NavigateNode>> map, NavigateNode start, NavigateNode end) {
         // 娓呯悊涓婃鎼滅储鐨勭姸鎬侊紝闃叉澶嶇敤瀹炰緥瀵艰嚧璁板綍娈嬬暀
         this.Open.clear();
@@ -184,6 +229,21 @@
         return null;
     }
 
+    public NavigateNode findTrackSiteNoNavigateNode(List<List<NavigateNode>> map, int trackSiteNo) {
+        for(int x = 0; x < map.size(); x++) {
+            for(int y = 0; y < map.get(0).size(); y++) {
+                NavigateNode node = map.get(x).get(y);
+                if("rgv".equals(node.getNodeType())) {
+                    JSONObject valueObj = JSON.parseObject(node.getNodeValue());
+                    if(valueObj.getInteger("trackSiteNo") == trackSiteNo) {
+                        return node;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
     //------------------A*鍚彂鍑芥暟------------------//
 
     //璁$畻閫氳繃鐜板湪鐨勭粨鐐圭殑浣嶇疆鍜屾渶缁堢粨鐐圭殑浣嶇疆璁$畻H鍊�(鏇煎搱椤挎硶锛氬潗鏍囧垎鍒彇宸�肩浉鍔�)

--
Gitblit v1.9.1