From 02d21f6176ac8d54f7ba121bf42821a405be40f2 Mon Sep 17 00:00:00 2001
From: 1 <1>
Date: 星期四, 23 十月 2025 16:45:21 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/model/protocol/StaProtocol.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/model/protocol/StaProtocol.java b/src/main/java/com/zy/core/model/protocol/StaProtocol.java
index eb6fe1b..5d578ad 100644
--- a/src/main/java/com/zy/core/model/protocol/StaProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/StaProtocol.java
@@ -3,6 +3,9 @@
import com.zy.asrs.entity.BasDevp;
import lombok.Data;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* 杈撻�佺嚎plc鍗曚釜绔欑偣璇︾粏淇℃伅
* Created by vincent on 2020/8/6
@@ -20,6 +23,8 @@
// ----------------------------------------------------------------
// 鐩爣绔�
private Short staNo;
+
+ private String barcode;
// ----------------------------------------------------------------
// 鑷姩
@@ -46,6 +51,9 @@
// 浣�
private boolean low;
+ // 鍙犵洏鍙犳弧
+ private boolean full;
+
// 閿佸畾鏍囪
private boolean pakMk = true;
@@ -57,6 +65,10 @@
//lfd鍏ュ簱鍗拌 褰搒tamp>=2鏃舵墠鍏ュ簱
private Integer stamp = 0;
+
+ private boolean err = false;
+
+
// 澶栧舰妫�娴� ------------------------------------------------------------------------
@@ -98,10 +110,19 @@
private Boolean upcontactErr = false; //椤跺崌鐢垫満鎺ヨЕ鍣ㄦ晠闅�
+ public Boolean isErr(){
+ if (frontErr || backErr || highErr || leftErr || rightErr || weightErr || barcodeErr){
+ return true;
+ }else {
+ return false;
+ }
+ }
+
public BasDevp toSqlModel(){
BasDevp basDevp = new BasDevp();
basDevp.setDevNo(siteId);
basDevp.setWrkNo(workNo.intValue());
+ basDevp.setBarcode(barcode);
basDevp.setAutoing(autoing?"Y":"N");
basDevp.setLoading(loading?"Y":"N");
basDevp.setInEnable(inEnable?"Y":"N");
@@ -111,6 +132,7 @@
basDevp.setLocType3((short) 0); // 杞婚噸绫诲瀷{0:鏈煡,1:杞诲簱浣�,2:閲嶅簱浣峿
basDevp.setLocType1(high != low && low ? (short) 1 : (short) 2);
basDevp.setInQty(inQty !=null ?(int)inQty : 0);
+ basDevp.setBarcode(this.getBarcode());
return basDevp;
}
@@ -123,5 +145,32 @@
}
return null;
}
+// public Integer getNearbySta() {
+// if (getNearbySta == null) return 0;
+//
+// // key: 绔欑偣鍙� value: 鍩哄噯鐗╃悊浣嶇疆
+// Map<Integer, Integer> posMap = new HashMap<>();
+// posMap.put(1004, 6534);
+// posMap.put(1007, 33634);
+// posMap.put(1010, 75174);
+// posMap.put(1014, 102124);
+// posMap.put(1018, 138224);
+// posMap.put(1021, 178034);
+// posMap.put(1024, 219684);
+// posMap.put(1028, 246724);
+// posMap.put(1031, 288194);
+// posMap.put(1035, 315204);
+// int tolerance = 50; // 鍏佽璇樊鑼冨洿
+//
+// for (Map.Entry<Integer, Integer> entry : posMap.entrySet()) {
+// int site = entry.getKey();
+// int basePos = entry.getValue();
+// if (Math.abs(getNearbySta - basePos) <= tolerance) {
+// return site;
+// }
+// }
+//
+// return 0; // 娌″尮閰嶅埌绔欑偣
+// }
}
--
Gitblit v1.9.1