From 92295fb902ac91db2988bb00091161d11c7dcd89 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期五, 02 五月 2025 16:37:08 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 34 +++++++++++++++++++++++-----------
1 files changed, 23 insertions(+), 11 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 4e684f8..4817d93 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -23,6 +23,10 @@
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.*;
+import com.zy.core.enums.DevpType.DevpRequestType;
+import com.zy.core.enums.DevpType.DevpStateType;
+import com.zy.core.enums.DevpType.DevpTrayType;
+import com.zy.core.enums.DevpType.DevpWorkType;
import com.zy.core.model.CrnSlave;
import com.zy.core.model.DevpSlave;
import com.zy.core.model.Task;
@@ -146,10 +150,12 @@
errMsg = "鎵爜澶辫触";
back = true;
}
+
// 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
- if (staProtocol.isAutoing() && staProtocol.isLoading()
- && staProtocol.isInEnable()
- && !staProtocol.isEmptyMk() && workNo >= 9790
+ if (staProtocol.stateType == DevpStateType.AUTO
+ && staProtocol.workType == DevpWorkType.BUSY
+ && staProtocol.requestType == DevpRequestType.IN
+ && staProtocol.trayType == DevpTrayType.FULL
&& staProtocol.isPakMk()) {
// 鑾峰彇鏉$爜鎵弿浠俊鎭�
BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
@@ -185,7 +191,7 @@
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
if (jsonObject.getInteger("code") != 200) {
- log.info("鏉$爜锛�" + barcode + "鐢宠WMS澶辫触");
+ log.info("鏉$爜锛�" + barcode + "鐢宠WMS澶辫触,response=" + JSON.toJSONString(jsonObject));
continue;
}
@@ -197,7 +203,7 @@
JSONObject result = jsonObject.getJSONObject("data");
Integer resultWrkNo = result.getInteger("wrkNo");
- Integer resultStaNo = result.getInteger("staNo");
+ Integer resultStaNo = result.getInteger("stnNo");
String resultLocNo = result.getString("locNo");
// 鍒涙柊涓�涓叆搴撳伐浣滄。
@@ -322,7 +328,11 @@
} else {
staProtocol = staProtocol.clone();
}
- if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == 0)) {
+
+ if (staProtocol.stateType == DevpStateType.AUTO
+ && staProtocol.workType == DevpWorkType.BUSY
+ && staProtocol.requestType == DevpRequestType.OUT
+ && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == 0)) {
// 鏌ヨ宸ヤ綔妗�
TaskWrk taskWrk = taskWrkMapper.selectCrnStaWorking(crnSlave.getId(), staDesc.getStnNo().toString());
if (taskWrk == null) {
@@ -431,8 +441,8 @@
log.error("鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鐐瑰湪鏁版嵁搴撲笉瀛樺湪, 绔欑偣缂栧彿={}", crnStn.getStaNo());
continue;
}
- if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable()
- && staDetl.getCanining() != null && staDetl.getCanining().equals("Y")) {
+
+ if (staProtocol.stateType == DevpStateType.AUTO && staProtocol.workType == DevpWorkType.BUSY && staProtocol.getWorkNo() > 0) {
flag = true;
}
if (!flag) {
@@ -554,8 +564,10 @@
}
// 鍒ゆ柇鍫嗗灈鏈哄嚭搴撶珯鐘舵��
- if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
- && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
+ if (staProtocol.stateType == DevpStateType.AUTO
+ && staProtocol.workType == DevpWorkType.IDLE
+ && staProtocol.requestType == DevpRequestType.OUT
+ && staProtocol.getWorkNo() == 0) {
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
// 鍫嗗灈鏈烘帶鍒惰繃婊�
@@ -608,7 +620,7 @@
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("taskNo", taskWrk.getTaskNo());
hashMap.put("status", TaskStatusType.DISTRIBUTE.id);
- hashMap.put("ioType", 1);
+ hashMap.put("ioType", 2);
hashMap.put("barcode", taskWrk.getBarcode());
hashMap.put("reportTime", format.format(new Date()));
--
Gitblit v1.9.1