From 131fd52a71e4801957a80305afb2ea959ecc72fd Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 17 十一月 2023 10:09:52 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/LiftThread.java | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/LiftThread.java b/src/main/java/com/zy/core/thread/LiftThread.java
index 71a7099..d14f4a4 100644
--- a/src/main/java/com/zy/core/thread/LiftThread.java
+++ b/src/main/java/com/zy/core/thread/LiftThread.java
@@ -329,7 +329,7 @@
redisCommand.setCommandStep(0);//鍛戒护鎵ц姝ュ簭
redisCommand.setAssignCommand(assignCommand);//鍛戒护
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("lift_wrk_no_" + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand));
+ redisUtil.set(RedisKeyType.LIFT.key + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand));
liftProtocol.setAssignCommand(assignCommand);
liftProtocol.setProtocolStatus(LiftProtocolStatusType.WORKING);
//鎵ц涓嬪彂浠诲姟
@@ -344,7 +344,7 @@
}
WrkMastMapper wrkMastMapper = SpringUtils.getBean(WrkMastMapper.class);
- Object o = redisUtil.get("lift_wrk_no_" + wrkNo);
+ Object o = redisUtil.get(RedisKeyType.LIFT.key + wrkNo);
if (o == null) {
return false;
}
@@ -357,6 +357,10 @@
//鍙栧嚭鍛戒护
NyLiftCommand command = commands.get(commandStep);
+
+ if (!redisCommand.getLiftNo().equals(liftProtocol.getLiftNo())) {
+ return false;
+ }
//涓嬪彂鍛戒护
if (!write(command)) {
@@ -376,7 +380,7 @@
short[] commandArr = getCommandArr(command);//鑾峰彇鍛戒护鎶ユ枃
BasLiftOpt opt = new BasLiftOpt(
redisCommand.getWrkNo().intValue(),
- redisCommand.getLiftNo().intValue(),
+ liftProtocol.getLiftNo().intValue(),
new Date(),
null,
null,
@@ -395,11 +399,11 @@
commandStep++;
redisCommand.setCommandStep(commandStep);
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
+ redisUtil.set(RedisKeyType.LIFT.key + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
}else {
//宸叉墽琛屽畬鎴�
//鍒犻櫎redis
- redisUtil.del("lift_wrk_no_" + redisCommand.getWrkNo());
+ redisUtil.del(RedisKeyType.LIFT.key + redisCommand.getWrkNo());
//瀵逛富绾跨▼鎶涘嚭绛夊緟纭鐘舵�亀aiting
liftProtocol.setProtocolStatus(LiftProtocolStatusType.WAITING);
--
Gitblit v1.9.1