From 684484fb93775edcfa19cfc7a43d0a748c8362be Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期五, 12 四月 2024 10:59:30 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java | 37 ++++++++++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 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 b7fbef2..d9930f0 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
@@ -7,10 +7,12 @@
import com.zy.asrs.framework.common.DateUtils;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.framework.exception.CoolException;
+import com.zy.asrs.wcs.common.ExecuteSupport;
import com.zy.asrs.wcs.core.entity.BasShuttle;
import com.zy.asrs.wcs.core.entity.Loc;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.command.ShuttleCommand;
+import com.zy.asrs.wcs.core.model.command.ShuttleRedisCommand;
import com.zy.asrs.wcs.core.model.enums.ShuttleCommandModeType;
import com.zy.asrs.wcs.core.model.enums.ShuttleRunDirection;
import com.zy.asrs.wcs.core.service.BasShuttleService;
@@ -18,6 +20,7 @@
import com.zy.asrs.wcs.core.utils.NavigateUtils;
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.OutputQueue;
+import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
import com.zy.asrs.wcs.rcs.entity.DeviceDataLog;
import com.zy.asrs.wcs.rcs.model.enums.ShuttleProtocolStatusType;
import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
@@ -110,7 +113,8 @@
shuttleProtocol.setCurrentCode(data.getString("groundCode") == null ? "0" : data.getString("groundCode"));
//鐢垫睜鐢甸噺
shuttleProtocol.setBatteryPower(data.getString("battery") == null ? "0%" : data.getString("battery"));
-
+ //鏁呴殰
+ shuttleProtocol.setErrorCode(deviceStatus == 6 ? "1" : "0");
//鏄惁椤跺崌
shuttleProtocol.setHasLift(data.getInteger("palletStatus") == 1 ? true : false);
@@ -370,6 +374,16 @@
@Override
public boolean isIdle() {
+ return this.isIdle(null);
+ }
+
+ @Override
+ public boolean isIdle(ExecuteSupport support) {
+ if (null != support) {
+ if (!support.judgement()) {
+ return false;
+ }
+ }
if (this.shuttleProtocol.getIdle() == null
|| this.shuttleProtocol.getPakMk() == null
|| this.shuttleProtocol.getErrorCode() == null
@@ -441,6 +455,10 @@
@Override
public boolean isChargingCompleted() {
+ if (this.shuttleProtocol.getBatteryPower() == null) {
+ return false;
+ }
+
if (Integer.valueOf(this.shuttleProtocol.getBatteryPower()) >= 100) {
return true;
}
@@ -448,6 +466,23 @@
}
@Override
+ public List<NavigateNode> getMoveAdvancePath() {
+ ArrayList<NavigateNode> path = new ArrayList<>();
+ if (shuttleProtocol.getTaskNo() != 0) {
+ //瀛樺湪浠诲姟锛岃幏鍙栨寚浠�
+ Object object = redisUtil.get(DeviceRedisConstant.SHUTTLE_FLAG + shuttleProtocol.getTaskNo());
+ if (object != null) {
+ ShuttleRedisCommand redisCommand = JSON.parseObject(object.toString(), ShuttleRedisCommand.class);
+ List<NavigateNode> nodes = redisCommand.getAssignCommand().getNodes();//绌挎杞﹂璁¤矾寰�
+ if (!nodes.isEmpty()) {
+ path.addAll(nodes);
+ }
+ }
+ }
+ return path;
+ }
+
+ @Override
public ShuttleCommand getMoveCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed) {
HashMap<String, Object> body = new HashMap<>();
body.put("messageName", "runOrder");
--
Gitblit v1.9.1