From a18215c69379bbdaecd95e25812e0796c32f9a57 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 16 四月 2024 14:46:20 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
index 9dedf44..91a9a72 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -3,6 +3,8 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.zy.asrs.common.utils.HttpHandler;
import com.zy.asrs.framework.common.DateUtils;
import com.zy.asrs.framework.common.SpringUtils;
@@ -412,7 +414,23 @@
boolean res = (this.shuttleProtocol.getDeviceStatus() == 3 || this.shuttleProtocol.getDeviceStatus() == 11)
&& this.shuttleProtocol.getPakMk()
&& this.shuttleProtocol.getErrorCode().equals("0")
- && this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id
+ && (this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.WAITING.id)
+ ;
+ return res;
+ }
+
+ @Override
+ public boolean isDeviceIdle() {
+ if (this.shuttleProtocol.getDeviceStatus() == null
+ || this.shuttleProtocol.getPakMk() == null
+ || this.shuttleProtocol.getErrorCode() == null
+ ) {
+ return false;
+ }
+
+ boolean res = (this.shuttleProtocol.getDeviceStatus() == 3 || this.shuttleProtocol.getDeviceStatus() == 11)
+ && this.shuttleProtocol.getPakMk()
+ && this.shuttleProtocol.getErrorCode().equals("0")
;
return res;
}
@@ -484,12 +502,18 @@
@Override
public List<NavigateNode> getMoveAdvancePath() {
+ ObjectMapper objectMapper = SpringUtils.getBean(ObjectMapper.class);
ArrayList<NavigateNode> path = new ArrayList<>();
if (shuttleProtocol.getTaskNo() != 0) {
//瀛樺湪浠诲姟锛岃幏鍙栨寚浠�
Object object = redisUtil.get(DeviceRedisConstant.SHUTTLE_WORK_FLAG + shuttleProtocol.getTaskNo());
if (object != null) {
- ShuttleRedisCommand redisCommand = JSON.parseObject(object.toString(), ShuttleRedisCommand.class);
+ ShuttleRedisCommand redisCommand = null;
+ try {
+ redisCommand = objectMapper.readValue(String.valueOf(object), ShuttleRedisCommand.class);
+ } catch (JsonProcessingException e) {
+ return path;
+ }
List<NavigateNode> nodes = redisCommand.getAssignCommand().getNodes();//绌挎杞﹂璁¤矾寰�
if (!nodes.isEmpty()) {
path.addAll(nodes);
--
Gitblit v1.9.1