From f45ec8943f3d2de4d17e3b533d4b6469d84331b4 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 04 十二月 2025 14:16:49 +0800
Subject: [PATCH] #
---
src/main/resources/docs/WCS外部HTTP API接口V1.0.docx | 0
src/main/java/com/zy/core/enums/RedisKeyType.java | 2 ++
src/main/java/com/zy/core/plugin/FakeProcess.java | 26 ++++++++++++++++++++++++++
3 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/enums/RedisKeyType.java b/src/main/java/com/zy/core/enums/RedisKeyType.java
index fa7402b..ae29535 100644
--- a/src/main/java/com/zy/core/enums/RedisKeyType.java
+++ b/src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -22,6 +22,8 @@
DEVICE_LOG_KEY("device_log_key_"),
+ GENERATE_IN_TASK_LIMIT("generate_in_task_limit_"),
+
GENERATE_FAKE_IN_TASK_LIMIT("generate_fake_in_task_limit_"),
GENERATE_FAKE_OUT_TASK_LIMIT("generate_fake_out_task_limit_"),
GENERATE_FAKE_IN_STATION_DATA_LIMIT("generate_fake_in_station_data_limit_"),
diff --git a/src/main/java/com/zy/core/plugin/FakeProcess.java b/src/main/java/com/zy/core/plugin/FakeProcess.java
index 181f5f2..dec9d60 100644
--- a/src/main/java/com/zy/core/plugin/FakeProcess.java
+++ b/src/main/java/com/zy/core/plugin/FakeProcess.java
@@ -46,6 +46,7 @@
private static Map<Integer,Long> stationStayTimeMap = new HashMap<>();
private static String enableFake = "N";
+ private static String fakeRealTaskRequestWms = "N";
@Autowired
private WrkMastService wrkMastService;
@@ -71,6 +72,11 @@
Config enableFakeConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake"));
if (enableFakeConfig != null) {
enableFake = enableFakeConfig.getValue();
+ }
+
+ Config fakeRealTaskRequestWmsConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "fakeRealTaskRequestWms"));
+ if (fakeRealTaskRequestWmsConfig != null) {
+ fakeRealTaskRequestWms = fakeRealTaskRequestWmsConfig.getValue();
}
//妫�娴嬪叆搴撶珯鏄惁鏈変换鍔$敓鎴愶紝骞朵豢鐪熺敓鎴愭ā鎷熷叆搴撶珯鐐规暟鎹�
@@ -151,6 +157,10 @@
return;
}
+ if (fakeRealTaskRequestWms.equals("Y")) {
+ return;
+ }
+
List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>());
for (BasDevp basDevp : basDevps) {
StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo());
@@ -226,6 +236,10 @@
return;
}
+ if (fakeRealTaskRequestWms.equals("Y")) {
+ return;
+ }
+
List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>());
for (BasDevp basDevp : basDevps) {
StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo());
@@ -285,6 +299,10 @@
* 鍏ュ簱绔欙紝鏍规嵁鏉$爜鎵弿鐢熸垚鍏ュ簱宸ヤ綔妗�
*/
public synchronized void generateStoreWrkFile() {
+ if (fakeRealTaskRequestWms.equals("N")) {
+ return;
+ }
+
List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>());
for (BasDevp basDevp : basDevps) {
StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo());
@@ -339,6 +357,11 @@
return;
}
+ Object lock = redisUtil.get(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId);
+ if (lock != null) {
+ continue;
+ }
+
try {
HashMap<String, Object> param = new HashMap<>();
param.put("barcode", stationProtocol.getBarcode());
@@ -360,10 +383,13 @@
taskParam.setTaskNo(String.valueOf(dto.getTaskNo()));
taskParam.setLocNo(dto.getLocNo());
taskParam.setTaskPri(dto.getTaskPri());
+ taskParam.setBarcode(stationProtocol.getBarcode());
boolean result = commonService.createInTask(taskParam);
} else {
News.error("璇锋眰WMS鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
}
+
+ redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 10);
} catch (Exception e) {
e.printStackTrace();
}
diff --git "a/src/main/resources/docs/WCS\345\244\226\351\203\250HTTP API\346\216\245\345\217\243V1.0.docx" "b/src/main/resources/docs/WCS\345\244\226\351\203\250HTTP API\346\216\245\345\217\243V1.0.docx"
index 5760a1c..b3ec7f7 100644
--- "a/src/main/resources/docs/WCS\345\244\226\351\203\250HTTP API\346\216\245\345\217\243V1.0.docx"
+++ "b/src/main/resources/docs/WCS\345\244\226\351\203\250HTTP API\346\216\245\345\217\243V1.0.docx"
Binary files differ
--
Gitblit v1.9.1