From 088453238b5086519be49ad6892450e4404e7aba Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 15 五月 2025 15:55:13 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 18 ++++++++++--------
src/main/java/com/zy/asrs/domain/enums/RedisKeyType.java | 1 +
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/zy/asrs/domain/enums/RedisKeyType.java b/src/main/java/com/zy/asrs/domain/enums/RedisKeyType.java
index d096fd3..1df6d8a 100644
--- a/src/main/java/com/zy/asrs/domain/enums/RedisKeyType.java
+++ b/src/main/java/com/zy/asrs/domain/enums/RedisKeyType.java
@@ -3,6 +3,7 @@
public enum RedisKeyType {
QUEUE_TASK("queue_task_"),
+ IN_TASK_LOCK("in_task_lock"),
;
public String key;
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 9004e48..709f188 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -7,6 +7,7 @@
import com.core.exception.CoolException;
import com.zy.asrs.domain.dto.NotifyCustomDataDto;
import com.zy.asrs.domain.enums.NotifyMsgType;
+import com.zy.asrs.domain.enums.RedisKeyType;
import com.zy.asrs.domain.enums.TaskStatusType;
import com.zy.asrs.domain.enums.WorkNoType;
import com.zy.asrs.entity.*;
@@ -18,15 +19,12 @@
import com.zy.asrs.utils.Utils;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
+import com.zy.common.utils.RedisUtil;
import com.zy.core.CrnThread;
import com.zy.core.DevpThread;
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;
@@ -76,13 +74,9 @@
@Autowired
private TaskWrkService taskWrkService;
@Autowired
- private ConfigService configService;
- @Autowired
private StaDescMapper staDescMapper;
@Autowired
private CommandInfoService commandInfoService;
- @Autowired
- private OpenServiceImpl openServiceImpl;
@Autowired
private StaDescService staDescService;
@Autowired
@@ -93,6 +87,8 @@
private CrnOperaUtils crnOperaUtils;
@Autowired
private NotifyUtils notifyUtils;
+ @Autowired
+ private RedisUtil redisUtil;
@Value("${wms.count}")
private Integer maxCount;
@Value("${wms.url}")
@@ -185,6 +181,11 @@
String response = "";
Boolean success = false;
try {
+ Object object = redisUtil.get(RedisKeyType.IN_TASK_LOCK.key);
+ if(object != null) {
+ continue;
+ }
+
response = new HttpHandler.Builder()
.setUri(wmsUrl)
.setPath(inboundTaskApplyPath)
@@ -192,6 +193,7 @@
.build()
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
+ redisUtil.set(RedisKeyType.IN_TASK_LOCK.key, "lock", 5);
if (jsonObject.getInteger("code") != 200) {
log.info("鏉$爜锛�" + barcode + "鐢宠WMS澶辫触,response=" + JSON.toJSONString(jsonObject));
continue;
--
Gitblit v1.9.1