|
@@ -160,7 +160,7 @@ public class WmTaskControllerV2 {
|
|
|
String.format(
|
|
|
"【%s】正在进行任务【%s】", user.getRealName(), checkReq.getCheckResult() ? "通过" : "拒绝");
|
|
|
|
|
|
- String lockKey = "task_opt:check:" + checkReq.getTaskId();
|
|
|
+ String lockKey = "task_opt:check:" + checkReq.getTaskId() + ":" + checkReq.getNodeId();
|
|
|
Boolean locked =
|
|
|
redisTemplate.opsForValue().setIfAbsent(lockKey, lockInfo /*, 10, TimeUnit.MINUTES*/);
|
|
|
|
|
@@ -212,7 +212,7 @@ public class WmTaskControllerV2 {
|
|
|
|
|
|
List<String> taskIds =
|
|
|
pretreatmentClear.getTaskIds().stream()
|
|
|
- .map(tid -> "task_opt:check:" + tid)
|
|
|
+ .map(tid -> "task_opt:check:" + tid + ":" + pretreatmentClear.getNodeId())
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
return R.ok(redisTemplate.delete(taskIds));
|
|
@@ -250,7 +250,7 @@ public class WmTaskControllerV2 {
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
for (String taskId : taskIds) {
|
|
|
|
|
|
- String lockKey = "task_opt:check:" + taskId;
|
|
|
+ String lockKey = "task_opt:check:" + taskId + ":" + pretreatment.getNodeId();
|
|
|
|
|
|
// 不存在历史执行锁
|
|
|
if (Boolean.TRUE.equals(
|
|
@@ -335,7 +335,7 @@ public class WmTaskControllerV2 {
|
|
|
Map<String, String> lockKeys = new LinkedHashMap<>(taskIds.size());
|
|
|
|
|
|
for (String taskId : taskIds) {
|
|
|
- lockKeys.put("task_opt:check:" + taskId, lockInfo);
|
|
|
+ lockKeys.put("task_opt:check:" + taskId + ":" + checkReq.getNodeId(), lockInfo);
|
|
|
}
|
|
|
|
|
|
// 设置执行锁
|
|
@@ -355,10 +355,10 @@ public class WmTaskControllerV2 {
|
|
|
log.error(e.getMessage(), e);
|
|
|
redisTemplate.delete(lockKeys.keySet());
|
|
|
}
|
|
|
-// finally {
|
|
|
-// 不论审核结果如何都不删除锁了
|
|
|
-// redisTemplate.delete(lockKeys.keySet());
|
|
|
-// }
|
|
|
+ // finally {
|
|
|
+ // 不论审核结果如何都不删除锁了
|
|
|
+ // redisTemplate.delete(lockKeys.keySet());
|
|
|
+ // }
|
|
|
|
|
|
return ok(Boolean.TRUE);
|
|
|
}
|