From a4f07b2a0ddb6c210e05afbbb491feeb466203e7 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 09 三月 2026 19:15:50 +0800
Subject: [PATCH] #V3重大更新,升级JDK17,升级SpirngBoot3.5.1

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

diff --git a/src/main/java/com/zy/common/utils/NavigateUtils.java b/src/main/java/com/zy/common/utils/NavigateUtils.java
index 7260751..377f2d2 100644
--- a/src/main/java/com/zy/common/utils/NavigateUtils.java
+++ b/src/main/java/com/zy/common/utils/NavigateUtils.java
@@ -15,7 +15,7 @@
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
 import com.zy.common.model.NavigateNode;
@@ -35,7 +35,7 @@
     private BasStationService basStationService;
 
     public synchronized List<NavigateNode> calcByStationId(Integer startStationId, Integer endStationId) {
-        BasStation startStation = basStationService.selectById(startStationId);
+        BasStation startStation = basStationService.getById(startStationId);
         if (startStation == null) {
             throw new CoolException("鏈壘鍒拌 璧风偣 瀵瑰簲鐨勭珯鐐规暟鎹�");
         }
@@ -45,12 +45,12 @@
         List<List<NavigateNode>> stationMap = navigateSolution.getStationMap(lev);
 
         NavigateNode startNode = navigateSolution.findStationNavigateNode(stationMap, startStationId);
-        if (startNode == null){
+        if (startNode == null) {
             throw new CoolException("鏈壘鍒拌 璧风偣 瀵瑰簲鐨勮妭鐐�");
         }
 
         NavigateNode endNode = navigateSolution.findStationNavigateNode(stationMap, endStationId);
-        if (endNode == null){
+        if (endNode == null) {
             throw new CoolException("鏈壘鍒拌 缁堢偣 瀵瑰簲鐨勮妭鐐�");
         }
 
@@ -58,7 +58,8 @@
         News.info("[WCS Debug] 绔欑偣璺緞寮�濮嬭绠�,startStationId={},endStationId={}", startStationId, endStationId);
         List<List<NavigateNode>> allList = navigateSolution.allSimplePaths(stationMap, startNode, endNode, 120, 500, 300);
         if (allList.isEmpty()) {
-            throw new CoolException("鏈壘鍒拌璺緞");
+//            throw new CoolException("鏈壘鍒拌璺緞");
+            return new ArrayList<>();
         }
         News.info("[WCS Debug] 绔欑偣璺緞璁$畻瀹屾垚锛岃�楁椂锛歿}ms", System.currentTimeMillis() - startTime);
 
@@ -70,12 +71,12 @@
         //鍘婚噸
         HashSet<Integer> set = new HashSet<>();
         List<NavigateNode> fitlerList = new ArrayList<>();
-        for(NavigateNode navigateNode : list){
+        for (NavigateNode navigateNode : list) {
             JSONObject valuObject = JSON.parseObject(navigateNode.getNodeValue());
             if (valuObject.containsKey("rgvCalcFlag")) {
                 continue;
             }
-            if(set.add(valuObject.getInteger("stationId"))){
+            if (set.add(valuObject.getInteger("stationId"))) {
                 fitlerList.add(navigateNode);
             }
         }
@@ -83,6 +84,20 @@
         for (int i = 0; i < fitlerList.size(); i++) {
             NavigateNode currentNode = fitlerList.get(i);
             currentNode.setIsInflectionPoint(false);
+            currentNode.setIsLiftTransferPoint(false);
+
+            try {
+                JSONObject valueObject = JSON.parseObject(currentNode.getNodeValue());
+                if (valueObject != null) {
+                    Object isLiftTransfer = valueObject.get("isLiftTransfer");
+                    if (isLiftTransfer != null) {
+                        String isLiftTransferStr = isLiftTransfer.toString();
+                        if ("1".equals(isLiftTransferStr) || "true".equalsIgnoreCase(isLiftTransferStr)) {
+                            currentNode.setIsLiftTransferPoint(true);
+                        }
+                    }
+                }
+            } catch (Exception ignore) {}
 
             NavigateNode nextNode = (i + 1 < fitlerList.size()) ? fitlerList.get(i + 1) : null;
             NavigateNode prevNode = (i - 1 >= 0) ? fitlerList.get(i - 1) : null;
@@ -115,7 +130,8 @@
         News.info("[WCS Debug] RGV璺緞寮�濮嬭绠�,startTrackSiteNo:{},endTrackSiteNo={}", startTrackSiteNo, endTrackSiteNo);
         NavigateNode res_node = navigateSolution.astarSearchJava(rgvTrackMap, startNode, endNode);
         if (res_node == null) {
-            throw new CoolException("鏈壘鍒拌璺緞");
+//            throw new CoolException("鏈壘鍒拌璺緞");
+            return new ArrayList<>();
         }
         News.info("[WCS Debug] RGV璺緞璁$畻瀹屾垚锛岃�楁椂锛歿}ms", System.currentTimeMillis() - startTime);
 
@@ -202,7 +218,7 @@
         try {
             DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class);
             if (deviceConfigService != null) {
-                List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+                List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>()
                         .eq("device_type", String.valueOf(SlaveType.Devp)));
                 for (DeviceConfig deviceConfig : devpList) {
                     StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, deviceConfig.getDeviceNo());
@@ -280,13 +296,13 @@
         try {
             ConfigService configService = SpringUtils.getBean(ConfigService.class);
             if (configService != null) {
-                Config cfgLen = configService.selectOne(new EntityWrapper<Config>().eq("code", "stationPathLenWeightPercent"));
+                Config cfgLen = configService.getOne(new QueryWrapper<Config>().eq("code", "stationPathLenWeightPercent"));
                 if (cfgLen != null && cfgLen.getValue() != null) {
                     String v = cfgLen.getValue().trim();
                     if (v.endsWith("%")) v = v.substring(0, v.length() - 1);
                     try { lenWeightPercent = Double.parseDouble(v); } catch (Exception ignore) {}
                 }
-                Config cfgCong = configService.selectOne(new EntityWrapper<Config>().eq("code", "stationPathCongWeightPercent"));
+                Config cfgCong = configService.getOne(new QueryWrapper<Config>().eq("code", "stationPathCongWeightPercent"));
                 if (cfgCong != null && cfgCong.getValue() != null) {
                     String v = cfgCong.getValue().trim();
                     if (v.endsWith("%")) v = v.substring(0, v.length() - 1);

--
Gitblit v1.9.1