From 3c8b4f87fa61885f3c28d00eb6b9c9abde9bd462 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 01 八月 2023 16:25:02 +0800
Subject: [PATCH] 检测穿梭车是否在提升机内

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index cae761a..9dbbe29 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -2,10 +2,7 @@
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.core.common.Cools;
-import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.mapper.*;
@@ -13,11 +10,9 @@
 import com.zy.asrs.utils.Utils;
 import com.zy.common.model.*;
 import com.zy.common.model.enums.NavigationMapType;
-import com.zy.common.model.enums.WrkChargeType;
 import com.zy.common.service.CommonService;
 import com.zy.common.service.erp.ErpService;
 import com.zy.common.utils.*;
-import com.zy.core.CrnThread;
 import com.zy.core.DevpThread;
 import com.zy.core.News;
 import com.zy.core.cache.MessageQueue;
@@ -28,7 +23,6 @@
 import com.zy.core.model.protocol.*;
 import com.zy.core.properties.SlaveProperties;
 import com.zy.core.thread.*;
-import io.swagger.models.auth.In;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -729,7 +723,7 @@
             //鍒ゆ柇灏忚溅鏄惁鍒拌揪杈撻�佺珯鐐瑰簱浣�
             if (!shuttleProtocol.getCurrentLocNo().equals(basDevp.getLocNo())) {
                 //灏忚溅涓嶅湪杈撻�佺珯鐐逛綅缃�
-                dispatchShuttle(wrkMast.getWrkNo(), basDevp.getLocNo());//璋冨害灏忚溅鍒拌揣鐗╂墍鍦ㄨ緭閫佺珯鐐硅繘琛屽彇璐�
+                dispatchShuttle(wrkMast.getWrkNo(), basDevp.getLocNo(), wrkMast.getShuttleNo());//璋冨害灏忚溅鍒拌揣鐗╂墍鍦ㄨ緭閫佺珯鐐硅繘琛屽彇璐�
                 return false;
             }
 
@@ -1002,7 +996,7 @@
             //鍒ゆ柇灏忚溅鏄惁鍒拌揪璐х墿搴撲綅
             if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) {
                 //灏忚溅涓嶅湪杈撻�佺珯鐐逛綅缃�
-                dispatchShuttle(wrkMast.getWrkNo(), wrkMast.getSourceLocNo());//璋冨害灏忚溅鍒拌揣鐗╂墍鍦ㄨ緭閫佺珯鐐硅繘琛屽彇璐�
+                dispatchShuttle(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getShuttleNo());//璋冨害灏忚溅鍒拌揣鐗╂墍鍦ㄨ緭閫佺珯鐐硅繘琛屽彇璐�
                 return false;
             }
 
@@ -1164,8 +1158,8 @@
     public synchronized void shuttleFinished() {
         for (ShuttleSlave shuttle : slaveProperties.getShuttle()) {
             //鑾峰彇鍥涘悜绌挎杞︿俊鎭�
-            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId());
-            ShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
+            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId());
+            NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
             if (shuttleProtocol == null) {
                 continue;
             }
@@ -1173,7 +1167,7 @@
             //鍥涘悜绌挎杞︾姸鎬佷负绛夊緟纭銆佸皬杞﹀浜庣┖闂茬姸鎬�
             if (shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.WAITING.id  //浠诲姟瀹屾垚绛夊緟纭
                     && shuttleProtocol.getTaskNo() != 0
-                    && shuttleProtocol.getBusyStatus() == 0
+                    && shuttleProtocol.getFree() == ShuttleStatusType.IDLE.id
             ) {
                 //灏嗕换鍔℃。鏍囪涓哄畬鎴�
                 WrkMast wrkMast = wrkMastMapper.selectByWorkNo(shuttleProtocol.getTaskNo().intValue());
@@ -1182,7 +1176,7 @@
                         case 5://5.灏忚溅鎼繍涓� ==> 9.鍏ュ簱瀹屾垚
                             wrkMast.setWrkSts(9L);
                             //浠诲姟鍙锋竻闆�
-                            shuttleProtocol.setTaskNo((short) 0);
+                            shuttleProtocol.setTaskNo(0);
                             break;
                         case 22://22.灏忚溅鎼繍涓� ==> 23.灏忚溅鎼繍瀹屾垚
                             wrkMast.setWrkSts(23L);

--
Gitblit v1.9.1