From d9cea3d7757a8d580bb0574d419ba6dd9c2478e7 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 13 十二月 2024 15:11:50 +0800
Subject: [PATCH] #search shuttle
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/LiftProtocol.java | 72 ++++++++++++++++++++++++++++++++++-
1 files changed, 69 insertions(+), 3 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/LiftProtocol.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/LiftProtocol.java
index 920f2ff..60df86b 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/LiftProtocol.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/LiftProtocol.java
@@ -1,17 +1,20 @@
package com.zy.asrs.wcs.rcs.model.protocol;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wcs.core.utils.RedisUtil;
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
+import com.zy.asrs.wcs.rcs.entity.BasLiftErr;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.model.enums.LiftProtocolStatusType;
+import com.zy.asrs.wcs.rcs.service.BasLiftErrService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Data
-public class LiftProtocol {
+public class LiftProtocol implements Cloneable {
//**********************蹇呴』瀛樺湪灞炴��**********************
/**
@@ -95,6 +98,11 @@
private Boolean hasCar;
/**
+ * 鏁呴殰
+ */
+ private Boolean error;
+
+ /**
* 鏁呴殰鐮�
*/
private String errorCode;
@@ -122,7 +130,12 @@
/**
* 浣滀笟鏍囪
*/
- private Boolean pakMk = false;
+ private Boolean pakMk = true;
+
+ /**
+ * 鎸囦护涓嬪彂鏃堕棿
+ */
+ private Long sendTime = 0L;
/**
* 鏃ュ織閲囬泦鏃堕棿
@@ -133,6 +146,35 @@
* 璁惧淇℃伅
*/
private Device device;
+
+ /**
+ * 鎵╁睍瀛楁
+ */
+ private Object extend;
+
+ public String getRun$() {
+ if (this.run == null) {
+ return "鏈煡";
+ }
+
+ return this.run ? "杩愯涓�" : "绌洪棽";
+ }
+
+ public String getReady$() {
+ if (this.ready == null) {
+ return "鏈煡";
+ }
+
+ return this.ready ? "灏辩华" : "鏈氨缁�";
+ }
+
+ public String getModel$() {
+ if (this.model == null) {
+ return "鏈煡";
+ }
+
+ return this.model ? "鑷姩" : "鎵嬪姩";
+ }
/**
* 璁剧疆鎻愬崌鏈虹姸鎬�
@@ -150,7 +192,7 @@
this.protocolStatusType = status;
}
- public void setTaskNo(Integer taskNo) {
+ public synchronized void setTaskNo(Integer taskNo) {
RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
if (null != redisUtil) {
redisUtil.set(DeviceRedisConstant.LIFT_FLAG + this.liftNo, taskNo);
@@ -169,4 +211,28 @@
return this.taskNo == null ? 0 : this.taskNo;
}
+ public String getErrorCode$() {
+ if (this.errorCode == null) {
+ return "";
+ }
+ BasLiftErrService basLiftErrService = SpringUtils.getBean(BasLiftErrService.class);
+ BasLiftErr liftErr = basLiftErrService.getOne(new LambdaQueryWrapper<BasLiftErr>()
+ .eq(BasLiftErr::getErrorCode, this.errorCode)
+ .eq(BasLiftErr::getDevicePlc, this.device.getDevicePlc()));
+ if (liftErr != null) {
+ return this.errorCode + "-" + liftErr.getErrName();
+ }
+ return errorCode;
+ }
+
+ @Override
+ public LiftProtocol clone() {
+ try {
+ return (LiftProtocol) super.clone();
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
}
--
Gitblit v1.9.1