From e039dbc9aa07fabb13be9673cbb7dfccfecda870 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 23 十一月 2024 08:14:28 +0800
Subject: [PATCH] #读取地图文件优化

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

diff --git a/src/main/java/com/zy/common/utils/NyShuttleOperaUtils.java b/src/main/java/com/zy/common/utils/NyShuttleOperaUtils.java
index 552b933..fc00b05 100644
--- a/src/main/java/com/zy/common/utils/NyShuttleOperaUtils.java
+++ b/src/main/java/com/zy/common/utils/NyShuttleOperaUtils.java
@@ -22,7 +22,7 @@
      * @param startPoint 璧风偣锛堝皬杞﹀綋鍓嶄綅缃級
      * @param targetPoint 鐩爣鐐癸紙璐х墿鐩爣浣嶇疆锛�
      */
-    public static NyShuttleOperaResult getShuttleTransportCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint) {
+    public static synchronized NyShuttleOperaResult getShuttleTransportCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint) {
         //琛岃蛋璺緞
         ArrayList<NavigateNode> nodes = new ArrayList<>();
         //鍛戒护闆嗗悎
@@ -51,7 +51,7 @@
      * @param middlePoint 涓棿鐐癸紙璐х墿浣嶇疆锛�
      * @param targetPoint 鐩爣鐐癸紙璐х墿鐩爣浣嶇疆锛�
      */
-    public static NyShuttleOperaResult getShuttleTransportCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String middlePoint, String targetPoint) {
+    public static synchronized NyShuttleOperaResult getShuttleTransportCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String middlePoint, String targetPoint) {
         //琛岃蛋璺緞
         ArrayList<NavigateNode> nodes = new ArrayList<>();
         //鍛戒护闆嗗悎
@@ -86,7 +86,7 @@
     /**
      * 鑾峰彇璧风偣鍒扮洰鏍囩偣琛岃蛋鍛戒护
      */
-    public static NyShuttleOperaResult getStartToTargetCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint, Integer mapType) {
+    public static synchronized NyShuttleOperaResult getStartToTargetCommands(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint, Integer mapType) {
         NavigateMapUtils navigateMapUtils = SpringUtils.getBean(NavigateMapUtils.class);
         //璁$畻璧风偣鍒扮洰鏍囩偣琛岃蛋鑺傜偣
         List<NavigateNode> calc = NavigateUtils.calc(startPoint, targetPoint, mapType, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startPoint)), null);
@@ -114,7 +114,7 @@
             allNode.addAll(nodes);
         }
 
-        boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(startPoint), allNode, true);//閿佸畾璺緞
+        boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(startPoint), shuttleNo, allNode, true);//閿佸畾璺緞
         if (!result) {
             return null;//璺緞閿佸畾澶辫触
         }
@@ -124,7 +124,7 @@
     /**
      * 鑾峰彇璧风偣鍒扮洰鏍囩偣琛岃蛋鍛戒护(鍙紶鐧藉悕鍗�)
      */
-    public static NyShuttleOperaResult getStartToTargetCommandsByWhites(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint, Integer mapType, List<int[]> whites) {
+    public static synchronized NyShuttleOperaResult getStartToTargetCommandsByWhites(Integer shuttleNo, Integer wrkNo, String startPoint, String targetPoint, Integer mapType, List<int[]> whites) {
         NavigateMapUtils navigateMapUtils = SpringUtils.getBean(NavigateMapUtils.class);
         //璁$畻璧风偣鍒扮洰鏍囩偣琛岃蛋鑺傜偣
         List<NavigateNode> calc = NavigateUtils.calc(startPoint, targetPoint, mapType, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startPoint)), whites);
@@ -167,7 +167,7 @@
                 nodes.add(node);
             }
         }
-        boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(startPoint), nodes, true);//閿佸畾璺緞
+        boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(startPoint), shuttleNo, nodes, true);//閿佸畾璺緞
         if (!result) {
             return null;//璺緞閿佸畾澶辫触
         }

--
Gitblit v1.9.1