From 52a3d2b51c7ca58abcb0e31783671af98d526aef Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 22 十二月 2023 12:17:23 +0800
Subject: [PATCH] #检料盘点工作档更新

---
 src/main/java/com/zy/core/model/protocol/LiftProtocol.java |   61 ++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/zy/core/model/protocol/LiftProtocol.java b/src/main/java/com/zy/core/model/protocol/LiftProtocol.java
index abc2b26..e64959d 100644
--- a/src/main/java/com/zy/core/model/protocol/LiftProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/LiftProtocol.java
@@ -1,5 +1,8 @@
 package com.zy.core.model.protocol;
 
+import com.core.common.SpringUtils;
+import com.zy.asrs.entity.BasLiftErr;
+import com.zy.asrs.service.BasLiftErrService;
 import com.zy.core.enums.LiftProtocolStatusType;
 import com.zy.core.model.command.LiftAssignCommand;
 import lombok.Data;
@@ -93,6 +96,11 @@
     private Boolean deviceError;
 
     /**
+     * 鏁呴殰鐮�
+     */
+    private Short errorCode;
+
+    /**
      * 浠诲姟鍦板潃
      */
     private Short taskAddress;
@@ -115,12 +123,24 @@
     /**
      * 浣滀笟鏍囪
      */
-    private Boolean pakMk = true;
+    private Boolean pakMk = false;
+
+    /**
+     * 鐙崰浠ょ墝
+     * 鏈浠诲姟鍗犳嵁锛屼护鐗屼负0
+     * 琚换鍔″崰鎹紝灏嗕换鍔″彿璧嬪�肩粰浠ょ墝
+     */
+    private Integer token = 0;
 
     /**
      * 浠诲姟鍛戒护
      */
     private LiftAssignCommand assignCommand;
+
+    /**
+     * 鎸囦护涓嬪彂鏃堕棿
+     */
+    private Long sendTime = 0L;
 
     /**
      * 璁剧疆鎻愬崌鏈虹姸鎬�
@@ -140,20 +160,22 @@
 
     // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
     public Boolean isIdle(Short taskNo) {
-        if(this.taskNo == null
-                || this.busy == null
+        if(this.busy == null
                 || this.model == null
                 || this.deviceError == null
                 || this.pakMk == null
+                || this.token == null
         ){
             return false;
         }
 
-        boolean res = (this.taskNo == 0 || this.taskNo.intValue() == taskNo.intValue())
-                && !this.busy
+        boolean res =
+//                (this.taskNo.equals(this.completeTaskNo) || this.taskNo.intValue() == taskNo.intValue())
+                !this.busy
                 && this.model
-                && this.pakMk.equals(true)
+                && !this.pakMk
                 && !this.deviceError
+                && this.protocolStatusType.equals(LiftProtocolStatusType.IDLE)
                 ;
         return res;
     }
@@ -165,23 +187,26 @@
                 || this.model == null
                 || this.deviceError == null
                 || this.pakMk == null
+                || this.token == null
         ){
             return false;
         }
 
-        boolean res = this.taskNo == 0
-                && !this.busy
+        boolean res =
+//                this.taskNo.equals(this.completeTaskNo)
+                !this.busy
                 && this.model
-                && this.pakMk.equals(true)
+                && !this.pakMk
                 && !this.deviceError
+                && this.token == 0
+                && this.protocolStatusType.equals(LiftProtocolStatusType.IDLE)
                 ;
         return res;
     }
 
     // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵�侊紝涓嶅垽鏂换鍔″彿
     public Boolean isIdleNoTask() {
-        if(this.taskNo == null
-                || this.busy == null
+        if(this.busy == null
                 || this.model == null
                 || this.deviceError == null
                 || this.pakMk == null
@@ -191,11 +216,23 @@
 
         boolean res = !this.busy
                 && this.model
-                && this.pakMk.equals(true)
+                && !this.pakMk
                 && !this.deviceError
                 ;
         return res;
     }
 
+    public String getErrCode$() {
+        if (this.errorCode == null) {
+            return "";
+        }
+        BasLiftErrService basLiftErrService = SpringUtils.getBean(BasLiftErrService.class);
+        BasLiftErr basLiftErr = basLiftErrService.selectById(this.errorCode);
+        if (basLiftErr == null) {
+            return String.valueOf(this.errorCode);
+        }
+        return basLiftErr.getErrName();
+    }
+
 
 }

--
Gitblit v1.9.1