From ff3b5df7015b2f2c5e24d9973a7b443309d8e579 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期六, 19 七月 2025 18:07:29 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
index d0a2602..38e09c4 100644
--- a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
+++ b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
@@ -5,6 +5,7 @@
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.domain.ShuttleGatherResult;
+import com.zy.asrs.domain.param.ShuttleDemoParam;
import com.zy.asrs.domain.param.ShuttleGatherParam;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.entity.DeviceConfig;
@@ -128,7 +129,7 @@
//褰撳墠绌挎杞﹀簱浣嶅彿
String currentLocNo = shuttleProtocol.getCurrentLocNo();
//褰撳墠绌挎杞︾嚎绋嬪埌鐩爣鍦扮偣璺濈
- List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//鎼滅储绌洪棽绌挎杞︼紝浣跨敤姝e父閫氶亾鍦板浘
+ List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, new ArrayList<NavigationMapType>(){{add(NavigationMapType.NORMAL);}}, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//鎼滅储绌洪棽绌挎杞︼紝浣跨敤姝e父閫氶亾鍦板浘
if (currentShuttlePath == null) {
continue;
}
@@ -173,7 +174,7 @@
int currentLev = Utils.getLev(currentLocNo);
//鍒ゆ柇褰撳墠妤煎眰鏄惁鏈変换鍔★紝濡傛灉鏈夊垯涓嶅垎閰嶈繖杈嗚溅
List<WrkMast> wrkMasts1 = wrkMastService.selectWrkByLev(currentLev);
- int shuttleCount = this.getShuttleCountByLev(currentLev);//鑾峰彇绌挎杞︽ゼ灞傝溅杈嗘暟閲�
+ int shuttleCount = this.getShuttleEnableUseCountByLev(currentLev);//鑾峰彇绌挎杞︽ゼ灞傝溅杈嗘暟閲�
if (!wrkMasts1.isEmpty() && shuttleCount <= 1) {
//瀛樺湪鍏朵粬浠诲姟涓斿彲鐢ㄥ皬杞︽暟閲忓皬浜庣瓑浜�1锛岃烦杩囪繖杈嗚溅
continue;
@@ -333,6 +334,25 @@
}
/**
+ * 灏忚溅婕旂ず
+ */
+ public void shuttleDemo(ShuttleDemoParam param) {
+ List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ .eq("device_type", String.valueOf(SlaveType.Shuttle))
+ .in("device_no", param.getShuttleNos())
+ );
+
+ for (DeviceConfig device : shuttleList) {
+ ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo());
+ if (shuttleThread == null) {
+ continue;
+ }
+
+ shuttleThread.enableDemo(param.getStatus() == 1);
+ }
+ }
+
+ /**
* 妫�娴嬬洰鏍囨ゼ灞傝溅鏁伴噺鏄惁灏忎簬鍏佽鐨勬渶澶ф暟閲�
* true: 灏忎簬鏈�澶ф暟閲� false: 澶т簬鎴栫瓑浜庢渶澶ф暟閲�
*/
@@ -478,7 +498,7 @@
String locNo = forkLiftStaProtocol.getLocNo();//绔欑偣搴撲綅鍙�
//褰撳墠绌挎杞︾嚎绋嬪埌鐩爣鍦扮偣璺濈
- List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//浣跨敤姝e父閫氶亾鍦板浘
+ List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.getMapTypes(NavigationMapType.NORMAL), Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//浣跨敤姝e父閫氶亾鍦板浘
if (currentShuttlePath == null) {
continue;
}
@@ -508,7 +528,7 @@
/**
* 鑾峰彇妤煎眰鍙敤灏忚溅鏁伴噺
*/
- public int getShuttleCountByLev(int lev) {
+ public int getShuttleEnableUseCountByLev(int lev) {
List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
.eq("device_type", String.valueOf(SlaveType.Shuttle)));
int count = 0;
@@ -541,4 +561,36 @@
return count;
}
+ /**
+ * 鑾峰彇妤煎眰灏忚溅鏁伴噺
+ */
+ public int getShuttleCountByLev(int lev) {
+ List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ .eq("device_type", String.valueOf(SlaveType.Shuttle)));
+ int count = 0;
+ for (DeviceConfig device : shuttleList) {
+ //鑾峰彇鍥涘悜绌挎杞︾嚎绋�
+ ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo());
+ if (shuttleThread == null) {
+ continue;
+ }
+
+ ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
+ if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) {
+ continue;
+ }
+
+ if (shuttleProtocol.getCurrentLocNo() == null) {
+ continue;
+ }
+
+ if (Utils.getLev(shuttleProtocol.getCurrentLocNo()) == lev) {
+ //鍚屼竴妤煎眰鍙敤灏忚溅
+ count++;
+ continue;
+ }
+ }
+ return count;
+ }
+
}
--
Gitblit v1.9.1