From dad3cd8ed8afa86b651bb1a053421e7aa2b8c7ac Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期日, 05 五月 2024 16:31:09 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/LiftProtocol.java |   73 +++++++++++++++++++++++++++++++++++-
 1 files changed, 70 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 7ea5a7f..24c4169 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,5 +1,9 @@
 package com.zy.asrs.wcs.rcs.model.protocol;
 
+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.Device;
 import com.zy.asrs.wcs.rcs.model.enums.LiftProtocolStatusType;
 import lombok.Data;
@@ -7,18 +11,18 @@
 
 @Slf4j
 @Data
-public class LiftProtocol {
+public class LiftProtocol implements Cloneable {
 
     //**********************蹇呴』瀛樺湪灞炴��**********************
     /**
      * 鎻愬崌鏈哄彿
      */
-    private String liftNo;
+    private Integer liftNo;
 
     /**
      * 浠诲姟鍙�
      */
-    private String taskNo;
+    private Integer taskNo;
 
     /**
      * 鍥涘悜绌挎杞﹀彿
@@ -121,6 +125,11 @@
     private Boolean pakMk = false;
 
     /**
+     * 鎸囦护涓嬪彂鏃堕棿
+     */
+    private Long sendTime = 0L;
+
+    /**
      * 鏃ュ織閲囬泦鏃堕棿
      */
     private Long deviceDataLog = System.currentTimeMillis();
@@ -129,6 +138,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 ? "鑷姩" : "鎵嬪姩";
+    }
 
     /**
      * 璁剧疆鎻愬崌鏈虹姸鎬�
@@ -146,4 +184,33 @@
         this.protocolStatusType = status;
     }
 
+    public synchronized void setTaskNo(Integer taskNo) {
+        RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
+        if (null != redisUtil) {
+            redisUtil.set(DeviceRedisConstant.LIFT_FLAG + this.liftNo, taskNo);
+            this.taskNo = taskNo;
+        }
+    }
+
+    public Integer getTaskNo() {
+        RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
+        if (null != redisUtil) {
+            Object o = redisUtil.get(DeviceRedisConstant.LIFT_FLAG + this.liftNo);
+            if (!Cools.isEmpty(o)) {
+                this.taskNo = Integer.valueOf(String.valueOf(o));
+            }
+        }
+        return this.taskNo == null ? 0 : this.taskNo;
+    }
+
+    @Override
+    public LiftProtocol clone() {
+        try {
+            return (LiftProtocol) super.clone();
+        } catch (CloneNotSupportedException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
 }

--
Gitblit v1.9.1