From 80d97d40c44165674ee0168be5f08c8ca52d3c06 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 09 六月 2025 09:36:43 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/jxgtwcs' into jxgtwcs

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java
index 4d998c0..a79de4f 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java
@@ -2,13 +2,19 @@
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zy.asrs.framework.common.SpringUtils;
+import com.zy.asrs.wcs.core.entity.ShuttleStandby;
 import com.zy.asrs.wcs.core.model.MapNode;
 import com.zy.asrs.wcs.core.model.NavigateNode;
 import com.zy.asrs.wcs.core.model.PythonSimilarityResult;
 import com.zy.asrs.wcs.core.model.enums.MapNodeType;
 import com.zy.asrs.wcs.core.model.enums.NavigationMapType;
+import com.zy.asrs.wcs.core.service.ShuttleStandbyService;
 import com.zy.asrs.wcs.rcs.News;
+import com.zy.asrs.wcs.rcs.entity.Device;
+import com.zy.asrs.wcs.rcs.thread.LiftThread;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
@@ -26,9 +32,12 @@
 
     @Value("${pythonCalcPath}")
     private String pythonCalcPath;
-
     @Value("${pythonCalcSimilarity}")
     private String pythonCalcSimilarity;
+    @Autowired
+    private LiftDispatcher liftDispatcher;
+    @Autowired
+    private ShuttleStandbyService shuttleStandbyService;
 
     public List<NavigateNode> calcWhiteList(String startPoint, String endPoint, Integer mapType, List<int[]> shuttlePoints) {
         //閫氳繃寮�濮嬬紪鍙峰拰缁撴潫缂栧彿鑾峰彇瀵瑰簲鐨剎y杞村潗鏍�
@@ -418,6 +427,31 @@
         return 0D;
     }
 
+    //妫�娴嬪簱浣嶈矾寰勬槸鍚﹀彲鐢�(鐢ㄤ簬搴撲綅鏄惁鍙Щ鍔ㄦ娴�)
+    public boolean checkLocPathIsAvailable(String startLocNo, Long hostId) {
+        //鑾峰彇璺濈鐩爣浣嶇疆鏈�杩戠殑鍙崲灞傛彁鍗囨満(鍙兘涓嶇┖闂�)
+        LiftThread liftThread = liftDispatcher.searchLift(startLocNo, hostId, true);
+        if (liftThread == null) {
+            return false;
+        }
+        Device transferLiftDevice = liftThread.getDevice();
+
+        ShuttleStandby shuttleStandbyTo = shuttleStandbyService.getOne(new LambdaQueryWrapper<ShuttleStandby>()
+                .eq(ShuttleStandby::getDeviceId, transferLiftDevice.getId())
+                .eq(ShuttleStandby::getDeviceLev, Utils.getLev(startLocNo))
+                .eq(ShuttleStandby::getStatus, 1));
+
+        //鎻愬崌鏈哄簱浣嶅彿
+        String liftLocNo = shuttleStandbyTo.getDeviceLoc();
+
+        //璁$畻搴撲綅鍒版彁鍗囨満搴撲綅锛岃矾寰勬槸鍚﹀彲鐢�
+        List<NavigateNode> nodeList = this.calc(startLocNo, liftLocNo, NavigationMapType.DFX.id, null);
+        if (nodeList == null) {
+            return false;
+        }
+        return true;
+    }
+
     public static void main(String[] args) {
 //        //璁$畻璺緞
 //        List<NavigateNode> calc = calc("1000901", "1800201", NavigationMapType.NONE.id, null);

--
Gitblit v1.9.1