From 37733cc39c04b863a0b997c7fa3d9ac6a24e08be Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 19 六月 2024 15:58:19 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
index bcd4c5a..c0adf3c 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -46,7 +46,7 @@
 @SuppressWarnings("all")
 public class SurayShuttleThread implements ShuttleThread {
 
-    private static final String API_URL = "http://127.0.0.1:8082";
+    private static String API_URL = "http://127.0.0.1:8082";
 
     private Device device;
     private RedisUtil redisUtil;
@@ -55,6 +55,7 @@
     public SurayShuttleThread(Device device,RedisUtil redisUtil) {
         this.device = device;
         this.redisUtil = redisUtil;
+        API_URL = "http://" + device.getIp() + ":" + device.getPort();
     }
 
     @Override
@@ -238,6 +239,16 @@
     @Override
     public synchronized boolean movePath(List<NavigateNode> nodes, Integer taskNo) {
         try {
+            //榛樿鍦板浘姣嶈建鏂瑰悜x
+            String mapDirection = "x";
+            DictService dictService = SpringUtils.getBean(DictService.class);
+            Dict dict = dictService.getOne(new LambdaQueryWrapper<Dict>()
+                    .eq(Dict::getFlag, "direction_map")
+                    .eq(Dict::getStatus, 1));
+            if (dict != null) {
+                mapDirection = dict.getValue();
+            }
+
             String loginToken = requestLoginToken();
             if (loginToken == null) {
                 return false;
@@ -262,13 +273,13 @@
                 NavigateNode startPath = sectionNodes.get(0);
                 //缁撴潫璺緞
                 NavigateNode targetPath = sectionNodes.get(sectionNodes.size() - 1);
-                if (ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.LEFT
+                if (mapDirection.equals("y") && ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.LEFT
                         || ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.RIGHT) {
-                    //瀛愯建鏂瑰悜
-                    oper = 6;
-                } else {
                     //姣嶈建鏂瑰悜
                     oper = 5;
+                } else {
+                    //瀛愯建鏂瑰悜
+                    oper = 6;
                 }
 
                 for (int i = 0; i < sectionNodes.size(); i++) {

--
Gitblit v1.9.1