From 3f797dd834a2de283cf5eff2ff1124e5a0ccb233 Mon Sep 17 00:00:00 2001
From: Administrator <XS@163.COM>
Date: 星期六, 25 四月 2026 11:18:50 +0800
Subject: [PATCH] 更改 2026-4-25
---
src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java | 112 ++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 77 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java b/src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java
index 44440a4..72848b9 100644
--- a/src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java
@@ -1,9 +1,9 @@
package com.zy.core.model.protocol;
-import com.zy.core.enums.DualCrnForkPosType;
-import com.zy.core.enums.DualCrnLiftPosType;
-import com.zy.core.enums.DualCrnModeType;
-import com.zy.core.enums.DualCrnStatusType;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
+import com.zy.common.utils.RedisUtil;
+import com.zy.core.enums.*;
import lombok.Data;
@@ -12,31 +12,41 @@
@Data
public class DualCrnProtocol {
- private Integer crnNo;
+ private volatile Integer crnNo;
/**
* 1 = 鎵嬪姩妯″紡
* 2 = 鑷姩妯″紡
* 3 = 鐢佃剳妯″紡
*/
- public Integer mode;
+ public volatile Integer mode;
- public DualCrnModeType modeType;
+ public volatile DualCrnModeType modeType;
/**
* 寮傚父鐮�
*/
- public Integer alarm;
+ public volatile Integer alarm;
/**
- * 宸ヤ綅1浠诲姟鍙�
+ * WCS宸ヤ綅1浠诲姟鍙�
*/
- public Integer taskNo = 0;
+ public volatile Integer taskNo = 0;
/**
- * 宸ヤ綅2浠诲姟鍙�
+ * WCS宸ヤ綅2浠诲姟鍙�
*/
- public Integer taskNoTwo = 0;
+ public volatile Integer taskNoTwo = 0;
+
+ /**
+ * 璁惧宸ヤ綅1浠诲姟鍙�
+ */
+ public volatile Integer deviceTaskNo = 0;
+
+ /**
+ * 璁惧宸ヤ綅2浠诲姟鍙�
+ */
+ public volatile Integer deviceTaskNoTwo = 0;
/**
* 宸ヤ綅1褰撳墠鐘舵��
@@ -51,42 +61,42 @@
* 90锛氫换鍔″畬鎴愮瓑寰匴CS纭
* 99锛氭姤璀�
*/
- public Integer status;
+ public volatile Integer status;
/**
* 宸ヤ綅2褰撳墠鐘舵��
*/
- public Integer statusTwo;
+ public volatile Integer statusTwo;
/**
* 宸ヤ綅1鐘舵�佹灇涓�
*/
- public DualCrnStatusType statusType;
+ public volatile DualCrnStatusType statusType;
/**
* 宸ヤ綅2鐘舵�佹灇涓�
*/
- public DualCrnStatusType statusTypeTwo;
+ public volatile DualCrnStatusType statusTypeTwo;
/**
* 宸ヤ綅1鍫嗗灈鏈哄綋鍓嶅垪鍙�
*/
- public Integer bay;
+ public volatile Integer bay;
/**
* 宸ヤ綅2鍫嗗灈鏈哄綋鍓嶅垪鍙�
*/
- public Integer bayTwo;
+ public volatile Integer bayTwo;
/**
* 宸ヤ綅1鍫嗗灈鏈哄綋鍓嶅眰鍙�
*/
- public Integer level;
+ public volatile Integer level;
/**
* 宸ヤ綅2鍫嗗灈鏈哄綋鍓嶅眰鍙�
*/
- public Integer levelTwo;
+ public volatile Integer levelTwo;
/**
* 宸ヤ綅1褰撳墠璐у弶浣嶇疆
@@ -94,7 +104,7 @@
* 1 = 璐у弶鍦ㄥ乏渚�
* 2 = 璐у弶鍦ㄥ彸渚�
*/
- public Integer forkPos;
+ public volatile Integer forkPos;
/**
* 宸ヤ綅2褰撳墠璐у弶浣嶇疆
@@ -102,51 +112,55 @@
* 1 = 璐у弶鍦ㄥ乏渚�
* 2 = 璐у弶鍦ㄥ彸渚�
*/
- public Integer forkPosTwo;
+ public volatile Integer forkPosTwo;
- public DualCrnForkPosType forkPosType;
+ public volatile DualCrnForkPosType forkPosType;
- public DualCrnForkPosType forkPosTypeTwo;
+ public volatile DualCrnForkPosType forkPosTypeTwo;
/**
* 褰撳墠杞借揣鍙颁綅缃�
* 0 = 涓嬪畾浣�
* 1 = 涓婂畾浣�
*/
- public Integer liftPos;
+ public volatile Integer liftPos;
- public Integer liftPosTwo;
+ public volatile Integer liftPosTwo;
- public DualCrnLiftPosType liftPosType;
+ public volatile DualCrnLiftPosType liftPosType;
- public DualCrnLiftPosType liftPosTypeTwo;
+ public volatile DualCrnLiftPosType liftPosTypeTwo;
/**
* 璧拌鍦ㄥ畾浣�
* 0 = 鍦ㄥ畾浣�
* 1 = 涓嶅湪瀹氫綅
*/
- public Integer walkPos;
+ public volatile Integer walkPos;
- public Integer walkPosTwo;
+ public volatile Integer walkPosTwo;
/**
* 杞借揣鍙版湁鐗�
*/
- public Integer loaded;
+ public volatile Integer loaded;
- public Integer loadedTwo;
+ public volatile Integer loadedTwo;
/**
* 浠诲姟鎺ユ敹鐘舵��
* 0 = 鏈帴鏀�
* 1 = 宸叉帴鏀�
*/
- public Integer taskReceive;
+ public volatile Integer taskReceive;
- public Integer taskReceiveTwo;
+ public volatile Integer taskReceiveTwo;
- private Integer temp1;
+ public volatile Integer taskSend;
+
+ public volatile Integer taskSendTwo;
+
+ private volatile Integer temp1;
private Integer temp2;
@@ -292,4 +306,32 @@
this.statusTwo = DualCrnStatusType.get(type).id;
}
+ public Integer getTaskNo() {
+ RedisUtil redisUtil = null;
+ try {
+ redisUtil = SpringUtils.getBean(RedisUtil.class);
+ }catch (Exception e) {}
+ if (null != redisUtil) {
+ Object o = redisUtil.get(RedisKeyType.DUAL_CRN_STATION1_FLAG.key + this.crnNo);
+ if (!Cools.isEmpty(o)) {
+ this.taskNo = Integer.parseInt(String.valueOf(o));
+ }
+ }
+ return this.taskNo == null ? 0 : this.taskNo;
+ }
+
+ public Integer getTaskNoTwo() {
+ RedisUtil redisUtil = null;
+ try {
+ redisUtil = SpringUtils.getBean(RedisUtil.class);
+ }catch (Exception e) {}
+ if (null != redisUtil) {
+ Object o = redisUtil.get(RedisKeyType.DUAL_CRN_STATION2_FLAG.key + this.crnNo);
+ if (!Cools.isEmpty(o)) {
+ this.taskNoTwo = Integer.parseInt(String.valueOf(o));
+ }
+ }
+ return this.taskNoTwo == null ? 0 : this.taskNoTwo;
+ }
+
}
--
Gitblit v1.9.1