From bb017102f135d427606dfbdc0503191e5f001265 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 02 十二月 2022 09:19:38 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/model/protocol/SteProtocol.java | 69 +++++++++++++++++++++++++++++++++-
1 files changed, 66 insertions(+), 3 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 bc4eb2f..dc815d7 100644
--- a/src/main/java/com/zy/core/model/protocol/SteProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/SteProtocol.java
@@ -1,14 +1,19 @@
package com.zy.core.model.protocol;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasSte;
+import com.zy.asrs.service.BasSteService;
import com.zy.core.enums.SteHisTaskStatusType;
import com.zy.core.enums.SteLocaType;
import com.zy.core.enums.SteStatusType;
import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
/**
* Created by vincent on 2020/8/7
*/
+@Slf4j
@Data
public class SteProtocol {
@@ -36,7 +41,7 @@
/**
* 浠诲姟鍙�
*/
- public Integer taskNo = 0;
+ public Short taskNo = 0;
/**
* 姝e湪鎵ц浠诲姟
@@ -64,6 +69,12 @@
* 鐢垫睜鐢甸噺
*/
public Float charge = 0.0F;
+
+ public void setCharge(Float charge) {
+ if (charge >= 0) {
+ this.charge = charge;
+ }
+ }
/**
* 婊$數
@@ -180,6 +191,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);
@@ -223,13 +245,54 @@
if (alarm!=null) {
basSte.setSteErr(alarm.longValue());
}
- basSte.setWrkNo(taskNo);
+ basSte.setWrkNo(taskNo.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;
}
// 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
public Boolean isIdle() {
- return getStatusType().equals(SteStatusType.IDLE) && pakMk.equals("N");
+ boolean res = this.statusType.equals(SteStatusType.IDLE)
+ && this.mode == 1
+ && this.pakMk.equals("N")
+ && !isAlarm()
+ && this.chargeStatus == 0
+ && isEnable()
+ ;
+ if (!res) {
+ return res;
+ } else {
+ // 鐢甸噺
+ try {
+ String chargeLine = SpringUtils.getBean(BasSteService.class).selectById(this.steNo).getChargeLine();
+ return charge > Float.parseFloat(chargeLine);
+ } catch (Exception e) {
+ log.error("fail", e);
+ return false;
+ }
+ }
+ }
+
+ // 鏄惁澶勪簬鎶ヨ鐘舵��
+ public Boolean isAlarm() {
+ return this.alarm > 1;
+ }
+
+ public Boolean isEnable() {
+ if (Cools.isEmpty(row, bay, lev)) {
+ return false;
+ }
+ return row > 0 && bay > 0 && lev > 0;
}
}
--
Gitblit v1.9.1