From 103ca74d9b67ce4f766b5f77451741a76fa696b9 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期日, 22 三月 2026 09:50:10 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/impl/ZyStationV5Thread.java |   37 ++++++++++++++++++++++++++++++-------
 1 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/impl/ZyStationV5Thread.java b/src/main/java/com/zy/core/thread/impl/ZyStationV5Thread.java
index f8d7abb..ca34f74 100644
--- a/src/main/java/com/zy/core/thread/impl/ZyStationV5Thread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZyStationV5Thread.java
@@ -238,6 +238,16 @@
                                      Integer stationId,
                                      Integer targetStationId,
                                      Integer palletSize) {
+        return getCommand(commandType, taskNo, stationId, targetStationId, palletSize, null);
+    }
+
+    @Override
+    public StationCommand getCommand(StationCommandType commandType,
+                                     Integer taskNo,
+                                     Integer stationId,
+                                     Integer targetStationId,
+                                     Integer palletSize,
+                                     Double pathLenFactor) {
         StationCommand stationCommand = new StationCommand();
         stationCommand.setTaskNo(taskNo);
         stationCommand.setStationId(stationId);
@@ -246,7 +256,7 @@
         stationCommand.setCommandType(commandType);
 
         if (commandType == StationCommandType.MOVE && !stationId.equals(targetStationId)) {
-            List<NavigateNode> nodes = calcPathNavigateNodes(taskNo, stationId, targetStationId);
+            List<NavigateNode> nodes = calcPathNavigateNodes(taskNo, stationId, targetStationId, pathLenFactor);
             return fillMoveCommandPath(stationCommand, nodes, taskNo, stationId, targetStationId);
         }
         return stationCommand;
@@ -257,11 +267,20 @@
                                                                  Integer stationId,
                                                                  Integer targetStationId,
                                                                  Integer palletSize) {
+        return getRunBlockRerouteCommand(taskNo, stationId, targetStationId, palletSize, null);
+    }
+
+    @Override
+    public synchronized StationCommand getRunBlockRerouteCommand(Integer taskNo,
+                                                                 Integer stationId,
+                                                                 Integer targetStationId,
+                                                                 Integer palletSize,
+                                                                 Double pathLenFactor) {
         if (taskNo == null || taskNo <= 0 || stationId == null || targetStationId == null) {
             return null;
         }
         if (Objects.equals(stationId, targetStationId)) {
-            return getCommand(StationCommandType.MOVE, taskNo, stationId, targetStationId, palletSize);
+            return getCommand(StationCommandType.MOVE, taskNo, stationId, targetStationId, palletSize, pathLenFactor);
         }
 
         RunBlockRerouteState rerouteState = loadRunBlockRerouteState(taskNo, stationId);
@@ -281,7 +300,7 @@
         rerouteState.setPlanCount((rerouteState.getPlanCount() == null ? 0 : rerouteState.getPlanCount()) + 1);
         rerouteState.setLastPlanTime(System.currentTimeMillis());
 
-        List<List<NavigateNode>> candidatePathList = calcCandidatePathNavigateNodes(taskNo, stationId, targetStationId);
+        List<List<NavigateNode>> candidatePathList = calcCandidatePathNavigateNodes(taskNo, stationId, targetStationId, pathLenFactor);
         if (candidatePathList.isEmpty()) {
             saveRunBlockRerouteState(rerouteState);
             log.warn("杈撻�佺嚎鍫靛閲嶈鍒掑け璐ワ紝鍊欓�夎矾寰勪负绌猴紝taskNo={}, planCount={}, stationId={}, targetStationId={}",
@@ -384,22 +403,26 @@
         return zyStationConnectDriver.readOriginCommand(address, length);
     }
 
-    private List<NavigateNode> calcPathNavigateNodes(Integer taskNo, Integer startStationId, Integer targetStationId) {
+    private List<NavigateNode> calcPathNavigateNodes(Integer taskNo,
+                                                     Integer startStationId,
+                                                     Integer targetStationId,
+                                                     Double pathLenFactor) {
         NavigateUtils navigateUtils = SpringUtils.getBean(NavigateUtils.class);
         if (navigateUtils == null) {
             return new ArrayList<>();
         }
-        return navigateUtils.calcByStationId(startStationId, targetStationId, taskNo);
+        return navigateUtils.calcByStationId(startStationId, targetStationId, taskNo, pathLenFactor);
     }
 
     private List<List<NavigateNode>> calcCandidatePathNavigateNodes(Integer taskNo,
                                                                     Integer startStationId,
-                                                                    Integer targetStationId) {
+                                                                    Integer targetStationId,
+                                                                    Double pathLenFactor) {
         NavigateUtils navigateUtils = SpringUtils.getBean(NavigateUtils.class);
         if (navigateUtils == null) {
             return new ArrayList<>();
         }
-        return navigateUtils.calcCandidatePathByStationId(startStationId, targetStationId, taskNo);
+        return navigateUtils.calcCandidatePathByStationId(startStationId, targetStationId, taskNo, pathLenFactor);
     }
 
     private StationCommand buildMoveCommand(Integer taskNo,

--
Gitblit v1.9.1