From 13c199274ed4d9b1f81880619867ee4d16b90dce Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期六, 13 四月 2024 10:32:42 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java |   12 ++++++++++--
 1 files changed, 10 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..fef474f 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,7 @@
         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;
     }
@@ -484,12 +486,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