From d5d7f24188f19f5d5c50f1d2e5cd6e49ba61edcc Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 10 五月 2023 09:54:51 +0800
Subject: [PATCH] 穿梭车redis存储前缀
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 4 ++--
src/main/java/com/zy/core/thread/ShuttleThread.java | 22 +++++++++++-----------
2 files changed, 13 insertions(+), 13 deletions(-)
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 d04c53d..21c409f 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -544,7 +544,7 @@
}
/**
- * 瀹炴椂鏇存柊鍦板浘
+ * 鑾峰彇/鏇存柊瀹炴椂鍦板浘
*/
public synchronized void refreshMap() {
@@ -577,7 +577,7 @@
liftProtocol.setProtocolStatus(LiftProtocolStatusType.WORKING);//宸ヤ綔鐘舵��
liftProtocol.setLiftLock(true);//鎻愬崌鏈洪攣瀹�
- }else {//鍥涘悜绌挎杞︿换鍔�
+ }else if(key.toString().contains("shuttle_wrk_no_")){//鍥涘悜绌挎杞︿换鍔�
ShuttleRedisCommand redisCommand = JSON.parseObject(map.get(key).toString(), ShuttleRedisCommand.class);
if (redisCommand == null) {
continue;
diff --git a/src/main/java/com/zy/core/thread/ShuttleThread.java b/src/main/java/com/zy/core/thread/ShuttleThread.java
index c97a92f..b743dcc 100644
--- a/src/main/java/com/zy/core/thread/ShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/ShuttleThread.java
@@ -200,7 +200,7 @@
//妫�娴嬫槸鍚︽湁鎻愬崌鏈洪攣瀹氭爣璁帮紝鏈夊垯妫�娴嬫彁鍗囨満鏄惁鍒颁綅锛屾槸鍚﹁兘璧颁笅涓�姝ュ懡浠�
if (shuttleProtocol.getBusyStatusType() == ShuttleStatusType.IDLE
&& shuttleProtocol.getTaskNo() != 0) {
- Object o = redisUtil.get("wrk_no_" + shuttleProtocol.getTaskNo());
+ Object o = redisUtil.get("shuttle_wrk_no_" + shuttleProtocol.getTaskNo());
if (o != null) {
ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class);
if (redisCommand.getLiftSecurityMk()) {
@@ -638,7 +638,7 @@
shuttleProtocol.setAssignCommand(assignCommand);
shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WORKING);
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("wrk_no_" + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand));
+ redisUtil.set("shuttle_wrk_no_" + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand));
//鎵ц涓嬪彂浠诲姟
executeWork(assignCommand.getTaskNo());
}
@@ -650,7 +650,7 @@
return false;
}
- Object o = redisUtil.get("wrk_no_" + wrkNo);
+ Object o = redisUtil.get("shuttle_wrk_no_" + wrkNo);
if (o == null) {
return false;
}
@@ -683,7 +683,7 @@
commandStep--;
redisCommand.setCommandStep(commandStep);
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
+ redisUtil.set("shuttle_wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
shuttleProtocol.setPakMk(true);
return true;
}else {
@@ -731,7 +731,7 @@
errorCommands.remove(0);
redisCommand.setErrorCommands(errorCommands);
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
+ redisUtil.set("shuttle_wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
return true;
}
}
@@ -769,7 +769,7 @@
commandStep++;
redisCommand.setCommandStep(commandStep);
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
+ redisUtil.set("shuttle_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
}else {
//宸叉墽琛屽畬鎴�
//淇濆瓨鏁版嵁鍒版暟鎹簱鍋氭祦姘�
@@ -800,7 +800,7 @@
}
//鍒犻櫎redis
- redisUtil.del("wrk_no_" + redisCommand.getWrkNo());
+ redisUtil.del("shuttle_wrk_no_" + redisCommand.getWrkNo());
if (!assignCommand.getAuto()) {
//鎵嬪姩妯″紡涓嶆姏鍑虹瓑寰呯姸鎬侊紝鐩存帴澶嶄綅
@@ -836,7 +836,7 @@
return false;
}
- Object o = redisUtil.get("wrk_no_" + wrkNo);
+ Object o = redisUtil.get("shuttle_wrk_no_" + wrkNo);
if (o == null) {
return false;
}
@@ -925,7 +925,7 @@
liftProtocol.setSecurityMk(true);//鏍囪缃负true锛岄槻姝㈠叾浠栦换鍔″崰鐢ㄥ綋鍓嶆彁鍗囨満
redisCommand.setLiftSecurityMk(true);//鏍囪缃负true锛岄槻姝㈠叾浠栦换鍔″崰鐢ㄥ綋鍓嶆彁鍗囨満
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
+ redisUtil.set("shuttle_wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
//鍛戒护list
ArrayList<LiftCommand> liftCommands = new ArrayList<>();
@@ -956,7 +956,7 @@
return false;
}
- Object o = redisUtil.get("wrk_no_" + wrkNo);
+ Object o = redisUtil.get("shuttle_wrk_no_" + wrkNo);
if (o == null) {
return false;
}
@@ -1027,7 +1027,7 @@
redisCommand.setErrorCommands(list);
//浠诲姟鏁版嵁淇濆瓨鍒皉edis
- redisUtil.set("wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
+ redisUtil.set("shuttle_wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.FIXING);
return true;
}
--
Gitblit v1.9.1