From 7635dc25bd2a4d565df496b2d96354639966768d Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期四, 25 九月 2025 11:09:44 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/action/LiftAction.java | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/action/LiftAction.java b/src/main/java/com/zy/core/action/LiftAction.java
index 1c2f1c4..0626be0 100644
--- a/src/main/java/com/zy/core/action/LiftAction.java
+++ b/src/main/java/com/zy/core/action/LiftAction.java
@@ -8,6 +8,7 @@
import com.zy.common.utils.RedisUtil;
import com.zy.core.News;
import com.zy.core.cache.SlaveConnection;
+import com.zy.core.enums.LiftProtocolStatusType;
import com.zy.core.enums.LiftTaskModeType;
import com.zy.core.enums.RedisKeyType;
import com.zy.core.enums.SlaveType;
@@ -121,6 +122,45 @@
redisCommand.setCommandStep(commandStep);
// 鏇存柊redis鏁版嵁
redisUtil.set(RedisKeyType.LIFT_WORK_FLAG.key + taskNo, JSON.toJSONString(redisCommand));
+ }else {
+ if (!liftThread.isDeviceIdle()) {
+ return false;
+ }
+
+ LiftCommand lastCommand = commands.get(commandStep - 1);
+ if (lastCommand.getMode() == LiftTaskModeType.PICK_PUT.id) {
+ if (liftProtocol.getLev() == lastCommand.getPutLev()) {
+ lastCommand.setComplete(true);
+ }
+ } else if (lastCommand.getMode() == LiftTaskModeType.SHUTTLE_SWITCH.id) {
+ if (liftProtocol.getLev() == lastCommand.getPutLev()) {
+ lastCommand.setComplete(true);
+ }
+ } else if (lastCommand.getMode() == LiftTaskModeType.MOVE.id) {
+ if (liftProtocol.getLev() == lastCommand.getPutLev()) {
+ lastCommand.setComplete(true);
+ }
+ }
+
+ //浠诲姟鏁版嵁淇濆瓨鍒皉edis
+ redisUtil.set(RedisKeyType.LIFT_WORK_FLAG.key + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
+
+ if (!lastCommand.getComplete()) {
+ //涓婁竴鏉′换鍔℃湭瀹屾垚锛岀姝笅鍙戝懡浠�
+ return false;
+ }
+
+ //鍒ゆ柇鏄惁涓烘渶鍚庝竴鏉″懡浠や笖鍛戒护鎵ц瀹屾垚锛屾姏鍑虹瓑寰呯‘璁ょ姸鎬�
+ LiftCommand endCommand = commands.get(commands.size() - 1);
+ if (endCommand.getComplete()) {
+ //宸叉墽琛屽畬鎴�
+ //鍒犻櫎redis
+ redisUtil.del(RedisKeyType.LIFT_WORK_FLAG.key + redisCommand.getWrkNo());
+
+ //瀵逛富绾跨▼鎶涘嚭绛夊緟纭鐘舵�亀aiting
+ liftThread.setProtocolStatus(LiftProtocolStatusType.WAITING);
+ News.info("鎻愬崌鏈轰换鍔℃墽琛屼笅鍙戝畬鎴愭墽琛岀粨鏉燂紝鎻愬崌鏈哄彿={}锛屼换鍔℃暟鎹�={}", redisCommand.getLiftNo(), JSON.toJSON(redisCommand));
+ }
}
return true;
--
Gitblit v1.9.1