From a24bb2555137158e56b91fbe5f3787dd313f62c3 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期三, 02 七月 2025 14:31:02 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/utils/NavigateUtils.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/common/utils/NavigateUtils.java b/src/main/java/com/zy/common/utils/NavigateUtils.java
index bf19aa9..3fa02a9 100644
--- a/src/main/java/com/zy/common/utils/NavigateUtils.java
+++ b/src/main/java/com/zy/common/utils/NavigateUtils.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.core.common.SpringUtils;
+import com.core.exception.CoolException;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.MapNode;
import com.zy.common.model.NavigateNode;
@@ -187,6 +188,54 @@
return list;
}
+ //璁$畻甯︽湯绔钀借矾寰�
+ public ArrayList<ArrayList<NavigateNode>> calcEndPath(String startPoint, String endPoint, Integer mapType, List<int[]> shuttlePoints, List<int[]> whites, int lastPathPart) {
+ //璁$畻璺緞
+ List<NavigateNode> navigateNodes = calc(startPoint, endPoint, mapType, shuttlePoints, whites);
+ if (navigateNodes == null) {
+ News.error("{} dash {} can't find navigate path!", startPoint, endPoint);
+ return null;
+ }
+
+ //鑾峰彇鍒嗘璺緞
+ ArrayList<ArrayList<NavigateNode>> partList = this.getSectionPath(navigateNodes);
+ //鏍规嵁浼犲叆鐨勬湯绔钀借矾寰勶紝鎵惧埌鏈鐐逛綅
+ int partResult = partList.size() - lastPathPart;
+ if (partResult == 0) {//璺緞鏁伴噺鐩稿悓鏃犻渶鍒嗗壊
+ return partList;
+ } else if (partResult < 0) {
+ throw new CoolException("鍒嗘璺緞涓庢湯绔矾寰勬暟閲忚绠楀紓甯�");
+ }
+ int pathIdx = partResult - 1;
+ ArrayList<ArrayList<NavigateNode>> filterList = new ArrayList<>();
+ for (int i = 0; i <= pathIdx; i++) {
+ filterList.add(partList.get(i));
+ }
+ return filterList;
+ }
+
+ //璁$畻鏈娈佃惤鍦板潃
+ public String calcEndLocation(String startPoint, String endPoint, Integer mapType, List<int[]> shuttlePoints, List<int[]> whites, int lastPathPart) {
+ ArrayList<ArrayList<NavigateNode>> endPath = calcEndPath(startPoint, endPoint, mapType, shuttlePoints, whites, lastPathPart);
+ if (endPath == null) {
+ return null;
+ }
+
+ return findTargetLocation(endPath);
+ }
+
+ public String findTargetLocation(List<NavigateNode> nodeList) {
+ ArrayList<ArrayList<NavigateNode>> sectionPath = this.getSectionPath(nodeList);
+ return findTargetLocation(sectionPath);
+ }
+
+ public String findTargetLocation(ArrayList<ArrayList<NavigateNode>> partList) {
+ ArrayList<NavigateNode> nodes = partList.get(partList.size() - 1);
+ NavigateNode targetNode = nodes.get(0);
+ String locNo = NavigatePositionConvert.nodeToLocNo(targetNode);
+ return locNo;
+ }
+
//鍒ゆ柇褰撳墠鑺傜偣鍒颁笅涓�涓妭鐐规槸鍚︿负鎷愮偣
public HashMap<String,Object> searchInflectionPoint(NavigateNode currentNode, NavigateNode fatherNode, NavigateNode nextNode) {
HashMap<String, Object> map = new HashMap<>();
--
Gitblit v1.9.1