From aad5ff1dbc5fb61ad5a01d13573560ed5aae9b04 Mon Sep 17 00:00:00 2001
From: 1 <1>
Date: 星期二, 07 十月 2025 13:17:35 +0800
Subject: [PATCH] #和得服务器

---
 src/main/java/com/zy/core/model/protocol/StaProtocol.java |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 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 0e2be39..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;
+
+
 
     // 澶栧舰妫�娴� ------------------------------------------------------------------------
 
@@ -110,6 +122,7 @@
         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");
@@ -119,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;
     }
 
@@ -131,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