From 1b007b8d43f82cf86e3cf5f2a316f30bae51deb2 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期五, 23 五月 2025 12:53:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/shuttle_rcs' into shuttle_rcs

---
 src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
index dd6f4fd..2600041 100644
--- a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
+++ b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
@@ -1,9 +1,11 @@
 package com.zy.core.dispatcher;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.core.common.Cools;
 import com.core.exception.CoolException;
 import com.zy.asrs.domain.ShuttleGatherResult;
+import com.zy.asrs.domain.param.ShuttleGatherParam;
 import com.zy.asrs.entity.BasShuttle;
 import com.zy.asrs.entity.WrkMast;
 import com.zy.asrs.service.BasShuttleService;
@@ -55,14 +57,14 @@
     /**
      * 璋冨害杞﹁締-璋冨害鎸囧畾绌挎杞�
      */
-    public boolean dispatchShuttle(Integer wrkNo, String locNo, Integer shuttleNo) {
+    public synchronized boolean dispatchShuttle(Integer wrkNo, String locNo, Integer shuttleNo) {
         return shuttleMoveGenerate(wrkNo, locNo, shuttleNo);
     }
 
     /**
      * 璋冨害杞﹁締
      */
-    public boolean dispatchShuttle(Integer wrkNo, String locNo) {
+    public synchronized boolean dispatchShuttle(Integer wrkNo, String locNo) {
         ArrayList<ShuttleThread> sameLev = new ArrayList<>();//鐩稿悓妤煎眰鐨勭┛姊溅
         ArrayList<ShuttleThread> diffLev = new ArrayList<>();//涓嶅悓妤煎眰鐨勭┛姊溅
 
@@ -200,7 +202,7 @@
      * 灏忚溅杩佺Щ浠诲姟鐢熸垚
      */
     @Transactional
-    public boolean shuttleMoveGenerate(Integer wrkNo, String locNo, Integer shuttleNo) {
+    public synchronized boolean shuttleMoveGenerate(Integer wrkNo, String locNo, Integer shuttleNo) {
         Date now = new Date();
         //鑾峰彇鍥涘悜绌挎杞︾嚎绋�
         ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
@@ -237,7 +239,7 @@
                 News.info("{}鍙峰皬杞︼紝瀛樺湪鍏朵粬宸ヤ綔妗d换鍔★紝绛夊緟鎵ц瀹屾垚鍐嶇敓鎴愭柊鐨勪换鍔�", shuttleNo);
                 return false;
             }else {
-                if (!mainWrkMast.getShuttleNo().equals(shuttleNo)) {
+                if (!shuttleNo.equals(mainWrkMast.getShuttleNo())) {
                     News.info("{}鍙峰皬杞︼紝瀛樺湪鍏朵粬宸ヤ綔妗d换鍔★紝绛夊緟鎵ц瀹屾垚鍐嶇敓鎴愭柊鐨勪换鍔�", shuttleNo);
                     return false;
                 }
@@ -299,8 +301,15 @@
     /**
      * 灏忚溅闆嗗悎
      */
-    public List<ShuttleGatherResult> shuttleGather() {
-        List<BasShuttle> basShuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().eq("status", 1));
+    public List<ShuttleGatherResult> shuttleGather(ShuttleGatherParam param) {
+        Wrapper<BasShuttle> wrapper = new EntityWrapper<BasShuttle>().eq("status", 1);
+        if (param != null) {
+            if (!param.getShuttleNos().isEmpty()) {
+                wrapper.in("shuttle_no", param.getShuttleNos());
+            }
+        }
+
+        List<BasShuttle> basShuttles = basShuttleService.selectList(wrapper);
         List<ShuttleGatherResult> list = new ArrayList<>();
         for (BasShuttle basShuttle : basShuttles) {
             String idleLoc = basShuttle.getIdleLoc();

--
Gitblit v1.9.1