From 4afa88987f466893800a83ba4767a8f59811473a Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期六, 20 十二月 2025 09:39:32 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java |    9 ++++
 src/main/java/com/zy/common/model/NavigateNode.java              |    4 +
 src/main/webapp/static/js/basDevp/basDevp.js                     |    1 
 src/main/java/com/zy/asrs/entity/BasDevp.java                    |    7 ---
 src/main/java/com/zy/common/utils/NavigateUtils.java             |   80 ++++++++++++++++++++++++++++++++++++++++
 src/main/webapp/views/basDevp/basDevp.html                       |    6 ---
 src/main/resources/mapper/BasDevpMapper.xml                      |    1 
 src/main/java/com/zy/common/utils/NavigateSolution.java          |    1 
 8 files changed, 91 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/zy/asrs/entity/BasDevp.java b/src/main/java/com/zy/asrs/entity/BasDevp.java
index e6ecf32..cafa3fd 100644
--- a/src/main/java/com/zy/asrs/entity/BasDevp.java
+++ b/src/main/java/com/zy/asrs/entity/BasDevp.java
@@ -113,13 +113,6 @@
     @TableField("run_block_reassign_loc_station_list")
     private String runBlockReassignLocStationList;
 
-    /**
-     *  椤跺崌绉绘牻绔欑偣鏁版嵁
-     */
-    @ApiModelProperty(value= "椤跺崌绉绘牻绔欑偣鏁版嵁")
-    @TableField("lift_transfer_station_list")
-    private String liftTransferStationList;
-
     public BasDevp() {}
 
     public BasDevp(Integer devpNo,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,String stationList,String barcodeStationList,String inStationList,String outStationList) {
diff --git a/src/main/java/com/zy/common/model/NavigateNode.java b/src/main/java/com/zy/common/model/NavigateNode.java
index a4b3af6..360c464 100644
--- a/src/main/java/com/zy/common/model/NavigateNode.java
+++ b/src/main/java/com/zy/common/model/NavigateNode.java
@@ -20,7 +20,9 @@
     private int value;
     @ToString.Exclude
     private NavigateNode Father;//鐖惰妭鐐�
-    private List<String> directionList;//琛岃蛋鏂瑰悜
+    private List<String> directionList;//鍏佽琛岃蛋鏂瑰悜
+    private Boolean isInflectionPoint;//鏄惁涓烘嫄鐐�
+    private String direction;//琛岃蛋鏂瑰悜
     private String nodeValue;//鑺傜偣鏁版嵁
     private String nodeType;//鑺傜偣绫诲瀷
 
diff --git a/src/main/java/com/zy/common/utils/NavigateSolution.java b/src/main/java/com/zy/common/utils/NavigateSolution.java
index e189e68..e2d429f 100644
--- a/src/main/java/com/zy/common/utils/NavigateSolution.java
+++ b/src/main/java/com/zy/common/utils/NavigateSolution.java
@@ -11,7 +11,6 @@
 import com.zy.core.enums.MapNodeType;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.BiFunction;
 
 /**
  * A*绠楁硶瀹炵幇绫�
diff --git a/src/main/java/com/zy/common/utils/NavigateUtils.java b/src/main/java/com/zy/common/utils/NavigateUtils.java
index 5fff67d..c9a2a77 100644
--- a/src/main/java/com/zy/common/utils/NavigateUtils.java
+++ b/src/main/java/com/zy/common/utils/NavigateUtils.java
@@ -65,6 +65,20 @@
             }
         }
 
+        for (int i = 0; i < fitlerList.size(); i++) {
+            NavigateNode currentNode = fitlerList.get(i);
+            currentNode.setIsInflectionPoint(false);
+
+            NavigateNode nextNode = (i + 1 < fitlerList.size()) ? fitlerList.get(i + 1) : null;
+            NavigateNode prevNode = (i - 1 >= 0) ? fitlerList.get(i - 1) : null;
+
+            HashMap<String, Object> result = searchInflectionPoint(currentNode, nextNode, prevNode);
+            if (Boolean.parseBoolean(result.get("result").toString())) {
+                currentNode.setIsInflectionPoint(true);
+                currentNode.setDirection(result.get("direction").toString());
+            }
+        }
+
         return fitlerList;
     }
 
@@ -95,8 +109,22 @@
         HashSet<NavigateNode> visited = new HashSet<>();
         int maxSteps = rgvTrackMap.size() * rgvTrackMap.get(0).size() + 5; // 瀹夊叏涓婇檺
         int steps = 0;
+        NavigateNode fatherNode = null;//褰撳墠寰幆涓婁竴鑺傜偣锛岀敤浜庢嫄鐐硅绠�
         while (res_node != null && visited.add(res_node) && steps++ < maxSteps) {
+            res_node.setIsInflectionPoint(false);
+
+            //瀵绘壘鎷愮偣
+            HashMap<String, Object> result = searchInflectionPoint(res_node, fatherNode, res_node.getFather());//鍒嗗埆浼犲叆褰撳墠鑺傜偣銆佺埗鑺傜偣銆佷笅涓�鑺傜偣
+            //鍒ゆ柇褰撳墠鑺傜偣鏄惁涓烘嫄鐐�
+            if (Boolean.parseBoolean(result.get("result").toString())) {
+                //褰撳墠涓烘嫄鐐�
+                res_node.setIsInflectionPoint(true);
+                //鎷愮偣鏂瑰悜
+                res_node.setDirection(result.get("direction").toString());
+            }
+
             list.add(res_node);
+            fatherNode = res_node;//鎶婂綋鍓嶈妭鐐逛繚瀛樻垚涓�涓埗鑺傜偣
             res_node = res_node.getFather();//杩唬鎿嶄綔
         }
         if (steps >= maxSteps) {
@@ -284,4 +312,56 @@
         }
         return best;
     }
+
+    //鍒ゆ柇褰撳墠鑺傜偣鍒颁笅涓�涓妭鐐规槸鍚︿负鎷愮偣
+    public HashMap<String,Object> searchInflectionPoint(NavigateNode currentNode, NavigateNode fatherNode, NavigateNode nextNode) {
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("result", false);//鏄惁涓烘嫄鐐癸紝true锛氭嫄鐐癸紝false锛氱洿绾�
+        // 绗竴涓偣鎴栫洿绾跨偣
+        if (fatherNode == null || nextNode == null || nextNode.getX() == fatherNode.getX() || nextNode.getY() == fatherNode.getY()) {
+            return map;//涓嶆槸鎷愮偣鐩存帴杩斿洖
+        }
+
+        //鎷愮偣鏂瑰悜
+        String direction = calcDirection(currentNode, fatherNode);
+
+        map.put("result", true);//鎷愮偣
+        map.put("direction", direction);//鎷愮偣鏂瑰悜锛堜粠褰撳墠鑺傜偣瑙嗚鐪嬬殑鏂瑰悜锛�
+        return map;
+    }
+
+    /**
+     * 璁$畻鏂瑰悜
+     */
+    public String calcDirection(NavigateNode currentNode, NavigateNode fatherNode) {
+        //鎷愮偣鏂瑰悜
+        String direction = "";
+        // 鏅�氭嫄鐐�
+        //璁$畻鎷愮偣鏂瑰悜
+        if (fatherNode.getX() != currentNode.getX()) {
+            //x杞存暟鎹湁宸紓锛屽垽鏂瓁杞存柟鍚�
+            //褰撳墠鑺傜偣X - 鐖惰妭鐐筙
+            if (currentNode.getX() - fatherNode.getX() > 0) {
+                //澶т簬0锛屾柟鍚憈op
+                direction = "top";
+            }else {
+                //灏忎簬0锛屾柟鍚慴ottom
+                direction = "bottom";
+            }
+        }
+
+        if (fatherNode.getY() != currentNode.getY()) {
+            //y杞存暟鎹湁宸紓锛屽垽鏂瓂杞存柟鍚�
+            //褰撳墠鑺傜偣Y - 鐖惰妭鐐筜
+            if (currentNode.getY() - fatherNode.getY() > 0) {
+                //澶т簬0锛屾柟鍚憀eft
+                direction = "left";
+            }else {
+                //灏忎簬0锛屾柟鍚憆ight
+                direction = "right";
+            }
+        }
+
+        return direction;
+    }
 }
diff --git a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
index 23d3ac9..55e1371 100644
--- a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
@@ -4,12 +4,14 @@
 import com.alibaba.fastjson.JSONObject;
 import com.core.common.SpringUtils;
 import com.zy.asrs.entity.DeviceConfig;
+import com.zy.asrs.service.BasDevpService;
 import com.zy.common.model.NavigateNode;
 import com.zy.common.utils.NavigateUtils;
 import com.zy.common.utils.RedisUtil;
 import com.zy.core.News;
 import com.zy.core.enums.RedisKeyType;
 import com.zy.core.model.CommandResponse;
+import com.zy.core.model.StationObjModel;
 import com.zy.core.model.command.StationCommand;
 import com.zy.core.network.api.ZyStationConnectApi;
 import com.zy.core.network.entity.ZyStationStatusEntity;
@@ -306,8 +308,9 @@
 
             Integer nextStationId = null;
             Integer nextStationDeviceNo = null;
+            NavigateNode nextNode = null;
             try {
-                NavigateNode nextNode = navigateNodes.get(i + 1);
+                nextNode = navigateNodes.get(i + 1);
                 JSONObject nextValueObject = JSON.parseObject(nextNode.getNodeValue());
                 nextStationId = nextValueObject.getInteger("stationId");
                 nextStationDeviceNo = nextValueObject.getInteger("deviceNo");
@@ -352,6 +355,10 @@
                     continue;
                 }
                 lastStationId = currentStationId;
+
+                if (nextNode.getIsInflectionPoint()) {
+                    sleep(4000);
+                }
             }
 
             i++;
diff --git a/src/main/resources/mapper/BasDevpMapper.xml b/src/main/resources/mapper/BasDevpMapper.xml
index 5b85439..d6c01b5 100644
--- a/src/main/resources/mapper/BasDevpMapper.xml
+++ b/src/main/resources/mapper/BasDevpMapper.xml
@@ -17,7 +17,6 @@
         <result column="in_station_list" property="inStationList" />
         <result column="out_station_list" property="outStationList" />
         <result column="run_block_reassign_loc_station_list" property="runBlockReassignLocStationList" />
-        <result column="lift_transfer_station_list" property="liftTransferStationList" />
 
     </resultMap>
 
diff --git a/src/main/webapp/static/js/basDevp/basDevp.js b/src/main/webapp/static/js/basDevp/basDevp.js
index 8d267a3..f323842 100644
--- a/src/main/webapp/static/js/basDevp/basDevp.js
+++ b/src/main/webapp/static/js/basDevp/basDevp.js
@@ -38,7 +38,6 @@
           { field: "inStationList", align: "center", title: "鍏ュ簱绔欑偣鏁版嵁" },
           { field: "outStationList", align: "center", title: "鍑哄簱绔欑偣鏁版嵁" },
           { field: "runBlockReassignLocStationList", align: "center", title: "杩愯鍫靛閲嶆柊鍒嗛厤搴撲綅绔欑偣鏁版嵁" },
-          { field: "liftTransferStationList", align: "center", title: "椤跺崌绉绘牻绔欑偣鏁版嵁" },
 
           {
             fixed: "right",
diff --git a/src/main/webapp/views/basDevp/basDevp.html b/src/main/webapp/views/basDevp/basDevp.html
index 8f7a490..98bb472 100644
--- a/src/main/webapp/views/basDevp/basDevp.html
+++ b/src/main/webapp/views/basDevp/basDevp.html
@@ -149,12 +149,6 @@
                         <input class="layui-input" name="runBlockReassignLocStationList" placeholder="璇疯緭鍏ヨ繍琛屽牭濉為噸鏂板垎閰嶅簱浣嶇珯鐐规暟鎹�">
                     </div>
                 </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">椤跺崌绉绘牻绔欑偣鏁版嵁: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="liftTransferStationList" placeholder="璇疯緭鍏ラ《鍗囩Щ鏍界珯鐐规暟鎹�">
-                    </div>
-                </div>
 
              </div>
         </div>

--
Gitblit v1.9.1