From c48d0150aa9f6b297671f28adb6b9dc95b529cfc Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期四, 05 六月 2025 16:59:39 +0800
Subject: [PATCH] 1

---
 src/main/java/com/zy/core/model/protocol/SteProtocol.java |   60 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 49 insertions(+), 11 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 726504c..cda2621 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;
@@ -23,6 +24,7 @@
     private Short steNo;
 
     /**
+     * -1 = 绂荤嚎
      * 1 = 鑱旀満妯″紡
      * 0 = 鑴辨満妯″紡
      */
@@ -185,6 +187,17 @@
      */
     public Short crnAllowRun;
 
+    /**
+     * 鍏呯數鐘舵��  1锛氬湪鍏呯數锛�0锛氫笉鍦ㄥ厖鐢�
+     */
+    private Short chargeStatus;
+
+    // 鍏ュ簱鍙栫┖
+    private Boolean inEmpty;
+
+    // 鍑哄簱鍙栫┖
+    private Boolean outEmpty;
+
     public void setStatus(Short status){
         this.status = status;
         this.statusType = SteStatusType.get(status);
@@ -229,15 +242,17 @@
             basSte.setSteErr(alarm.longValue());
         }
         basSte.setWrkNo(taskNo.intValue());
-        if (!Cools.isEmpty(row)) {
-            basSte.setRow(row.intValue());
-        }
-        if (!Cools.isEmpty(bay)) {
-            basSte.setBay(bay.intValue());
-        }
-        if (!Cools.isEmpty(lev)) {
-            basSte.setLev(lev.intValue());
-        }
+//        if (basSte.getPakMk().equals("N")) {
+//            if (!Cools.isEmpty(row)) {
+//                basSte.setRow(row.intValue());
+//            }
+//            if (!Cools.isEmpty(bay)) {
+//                basSte.setBay(bay.intValue());
+//            }
+//            if (!Cools.isEmpty(lev)) {
+//                basSte.setLev(lev.intValue());
+//            }
+//        }
         return basSte;
     }
 
@@ -245,7 +260,11 @@
     public Boolean isIdle() {
         boolean res = this.statusType.equals(SteStatusType.IDLE)
                 && this.pakMk.equals("N")
-                && !isAlarm();
+                && !isAlarm()
+                && this.chargeStatus == 0
+                && isEnable()
+                && this.getMode()==1
+                ;
         if (!res) {
             return res;
         } else {
@@ -254,7 +273,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;
             }
         }
@@ -265,4 +284,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