From 517966d4dbed6ef6e5d591720b971af427e6b63a Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 04 十二月 2025 15:25:47 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/utils/NavigateUtils.java |   42 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/common/utils/NavigateUtils.java b/src/main/java/com/zy/common/utils/NavigateUtils.java
index e324def..2e210a5 100644
--- a/src/main/java/com/zy/common/utils/NavigateUtils.java
+++ b/src/main/java/com/zy/common/utils/NavigateUtils.java
@@ -4,6 +4,8 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+
+import com.zy.core.News;
 import org.springframework.stereotype.Component;
 
 import com.alibaba.fastjson.JSON;
@@ -14,9 +16,9 @@
 @Component
 public class NavigateUtils {
 
-    public synchronized List<NavigateNode> calcByStationId(Integer startStationId, Integer endStationId) {
+    public synchronized List<NavigateNode> calcByStationId(int lev, Integer startStationId, Integer endStationId) {
         NavigateSolution navigateSolution = new NavigateSolution();
-        List<List<NavigateNode>> stationMap = navigateSolution.getStationMap();
+        List<List<NavigateNode>> stationMap = navigateSolution.getStationMap(lev);
 
         NavigateNode startNode = navigateSolution.findStationNavigateNode(stationMap, startStationId);
         if (startNode == null){
@@ -28,10 +30,13 @@
             throw new CoolException("鏈壘鍒拌 缁堢偣 瀵瑰簲鐨勮妭鐐�");
         }
 
+        long startTime = System.currentTimeMillis();
+        News.info("[WCS Debug] 绔欑偣璺緞寮�濮嬭绠�,startStationId={},endStationId={}", startStationId, endStationId);
         NavigateNode res_node = navigateSolution.astarSearchJava(stationMap, startNode, endNode);
         if (res_node == null) {
             throw new CoolException("鏈壘鍒拌璺緞");
         }
+        News.info("[WCS Debug] 绔欑偣璺緞璁$畻瀹屾垚锛岃�楁椂锛歿}ms", System.currentTimeMillis() - startTime);
 
         ArrayList<NavigateNode> list = new ArrayList<>();
         // 浣跨敤 visited 闆嗗悎闃叉鐖堕摼鍑虹幇鐜鑷存寰幆锛屽悓鏃惰缃畨鍏ㄦ鏁颁笂闄�
@@ -66,9 +71,9 @@
         return fitlerList;
     }
 
-    public synchronized List<NavigateNode> calcByTrackSiteNo(Integer startTrackSiteNo, Integer endTrackSiteNo) {
+    public synchronized List<NavigateNode> calcByTrackSiteNo(int lev, Integer startTrackSiteNo, Integer endTrackSiteNo) {
         NavigateSolution navigateSolution = new NavigateSolution();
-        List<List<NavigateNode>> rgvTrackMap = navigateSolution.getRgvTrackMap();
+        List<List<NavigateNode>> rgvTrackMap = navigateSolution.getRgvTrackMap(lev);
 
         NavigateNode startNode = navigateSolution.findTrackSiteNoNavigateNode(rgvTrackMap, startTrackSiteNo);
         if (startNode == null){
@@ -80,10 +85,13 @@
             throw new CoolException("鏈壘鍒拌 缁堢偣 瀵瑰簲鐨勮妭鐐�");
         }
 
+        long startTime = System.currentTimeMillis();
+        News.info("[WCS Debug] RGV璺緞寮�濮嬭绠�,startTrackSiteNo:{},endTrackSiteNo={}", startTrackSiteNo, endTrackSiteNo);
         NavigateNode res_node = navigateSolution.astarSearchJava(rgvTrackMap, startNode, endNode);
         if (res_node == null) {
             throw new CoolException("鏈壘鍒拌璺緞");
         }
+        News.info("[WCS Debug] RGV璺緞璁$畻瀹屾垚锛岃�楁椂锛歿}ms", System.currentTimeMillis() - startTime);
 
         ArrayList<NavigateNode> list = new ArrayList<>();
         // 浣跨敤 visited 闆嗗悎闃叉鐖堕摼鍑虹幇鐜鑷存寰幆锛屽悓鏃惰缃畨鍏ㄦ鏁颁笂闄�
@@ -118,4 +126,30 @@
         return fitlerList;
     }
 
+    public synchronized List<NavigateNode> findLiftStationList(int lev) {
+        NavigateSolution navigateSolution = new NavigateSolution();
+        List<List<NavigateNode>> stationMap = navigateSolution.getStationMap(lev);
+
+        List<NavigateNode> liftStationList = new ArrayList<>();
+        for (List<NavigateNode> navigateNodes : stationMap) {
+            for (NavigateNode navigateNode : navigateNodes) {
+                String nodeType = navigateNode.getNodeType();
+                if(nodeType == null){
+                    continue;
+                }
+                if(!nodeType.equals("devp")){
+                    continue;
+                }
+                JSONObject valuObject = JSON.parseObject(navigateNode.getNodeValue());
+                if(valuObject == null){
+                    continue;
+                }
+                if (valuObject.containsKey("liftNo")) {
+                    liftStationList.add(navigateNode);
+                }
+            }
+        }
+
+        return liftStationList;
+    }
 }

--
Gitblit v1.9.1