From c9c80ecde06d151f4f2f3ccf46d3f4c0e65cd8a1 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 23 九月 2025 13:13:46 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/utils/ShuttleOperaUtils.java |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java b/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
index 7cdbed3..c4fe002 100644
--- a/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
+++ b/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
@@ -72,6 +72,17 @@
             }
         }
 
+        Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
+
+        //灏忚溅(x,y)鍛戒护杩愯鏂瑰悜棰犲��
+        boolean shuttleDirectionReverse = false;
+        if (systemConfigMapObj != null) {
+            HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj;
+            if (systemConfigMap.get("shuttleDirectionReverse").equals("Y")) {
+                shuttleDirectionReverse = true;
+            }
+        }
+
         long calcStartTime = System.currentTimeMillis();
         List<NavigateNode> nodeList = navigateUtils.calc(startLocNo, endLocNo, mapTypes, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startLocNo)), whites);
         if (nodeList == null) {
@@ -133,15 +144,15 @@
 
             long startGetMoveCommandTime = System.currentTimeMillis();
             //鑾峰彇绉诲姩鍛戒护
-            ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes);
+            ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, shuttleDirectionReverse);
             News.info("[RCS Debug] getMoveCommand idx:{} time:{}", i, (System.currentTimeMillis() - startGetMoveCommandTime));
 
             if (i + 1 == data.size()) {
                 long startGetInOutLiftTime = System.currentTimeMillis();
                 if (moveType.equals("inLift")) {
-                    command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, true);
+                    command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, true, shuttleDirectionReverse);
                 }else if (moveType.equals("outLift")) {
-                    command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, false);
+                    command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, false, shuttleDirectionReverse);
                 }
                 News.info("[RCS Debug] getInOutLiftTime idx:{} time:{}", i, (System.currentTimeMillis() - startGetInOutLiftTime));
             }
@@ -156,9 +167,8 @@
 
         //灏忚溅绉诲姩杩炵画涓嬪彂鎸囦护
         boolean shuttleMoveCommandsContinuously = false;
-        Object object = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
-        if (object != null) {
-            HashMap<String, String> systemConfigMap = (HashMap<String, String>) object;
+        if (systemConfigMapObj != null) {
+            HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj;
             String shuttleMoveCommandsContinuouslyConfig = systemConfigMap.get("shuttleMoveCommandsContinuously");
             if (shuttleMoveCommandsContinuouslyConfig != null && shuttleMoveCommandsContinuouslyConfig.equals("Y")) {
                 shuttleMoveCommandsContinuously = true;

--
Gitblit v1.9.1