From 996926db15b776bc3fd01837f317976e3e74b6cf Mon Sep 17 00:00:00 2001
From: tqs <56479841@qq.com>
Date: 星期四, 02 二月 2023 17:33:03 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/model/protocol/SteProtocol.java |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/core/model/protocol/SteProtocol.java b/src/main/java/com/zy/core/model/protocol/SteProtocol.java
index 201d49d..6e65744 100644
--- a/src/main/java/com/zy/core/model/protocol/SteProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/SteProtocol.java
@@ -4,6 +4,7 @@
 import com.core.common.SpringUtils;
 import com.zy.asrs.entity.BasSte;
 import com.zy.asrs.service.BasSteService;
+import com.zy.common.utils.News;
 import com.zy.core.enums.SteHisTaskStatusType;
 import com.zy.core.enums.SteLocaType;
 import com.zy.core.enums.SteStatusType;
@@ -190,6 +191,12 @@
      */
     private Short chargeStatus;
 
+    // 鍏ュ簱鍙栫┖
+    private Boolean inEmpty;
+
+    // 鍑哄簱鍙栫┖
+    private Boolean outEmpty;
+
     public void setStatus(Short status){
         this.status = status;
         this.statusType = SteStatusType.get(status);
@@ -253,7 +260,10 @@
         boolean res = this.statusType.equals(SteStatusType.IDLE)
                 && this.pakMk.equals("N")
                 && !isAlarm()
-                && this.chargeStatus == 0;
+                && this.chargeStatus == 0
+                && isEnable()
+                && this.getMode()==1
+                ;
         if (!res) {
             return res;
         } else {
@@ -262,7 +272,7 @@
                 String chargeLine = SpringUtils.getBean(BasSteService.class).selectById(this.steNo).getChargeLine();
                 return charge > Float.parseFloat(chargeLine);
             } catch (Exception e) {
-                log.error("fail", e);
+                News.error("fail", e);
                 return false;
             }
         }
@@ -273,4 +283,23 @@
         return this.alarm > 1;
     }
 
+    public Boolean isEnable() {
+        if (Cools.isEmpty(row)) {
+            if (row == 0) {
+                return false;
+            }
+        }
+        if (Cools.isEmpty(bay)) {
+            if (bay == 0) {
+                return false;
+            }
+        }
+        if (Cools.isEmpty(lev)) {
+            if (lev == 0) {
+                return false;
+            }
+        }
+        return true;
+    }
+
 }

--
Gitblit v1.9.1