From 0e10bf39c53b0b79cbdc051ddb10845d361042c3 Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期三, 06 五月 2026 09:51:50 +0800
Subject: [PATCH] 初始化

---
 src/main/webapp/views/crn.html                            |   14 
 src/main/java/com/zy/common/task/GhlnWcsScheduler.java    |  130 ++++++++------
 src/main/java/com/zy/common/model/AgvTaskCompleteDto.java |    1 
 src/main/java/com/zy/controller/OpenController.java       |    6 
 src/main/webapp/static/js/console.js                      |    2 
 src/main/java/com/zy/service/impl/MainServiceImpl.java    |   60 +++++-
 src/main/webapp/static/js/console.map.js                  |  190 +++++++++++++++++----
 src/main/java/com/zy/core/thread/SiemensDevpThread.java   |   25 +-
 src/main/resources/application.yml                        |   84 ++++++++
 src/main/java/com/zy/utils/Utils.java                     |   20 ++
 10 files changed, 398 insertions(+), 134 deletions(-)

diff --git a/src/main/java/com/zy/common/model/AgvTaskCompleteDto.java b/src/main/java/com/zy/common/model/AgvTaskCompleteDto.java
index 2db5b9b..a0464ca 100644
--- a/src/main/java/com/zy/common/model/AgvTaskCompleteDto.java
+++ b/src/main/java/com/zy/common/model/AgvTaskCompleteDto.java
@@ -9,4 +9,5 @@
  */
 @Data
 public class AgvTaskCompleteDto {
+    private Integer staNo; // 鍙栨斁璐х珯鐐�
 }
diff --git a/src/main/java/com/zy/common/task/GhlnWcsScheduler.java b/src/main/java/com/zy/common/task/GhlnWcsScheduler.java
index 2fb4b71..a151a05 100644
--- a/src/main/java/com/zy/common/task/GhlnWcsScheduler.java
+++ b/src/main/java/com/zy/common/task/GhlnWcsScheduler.java
@@ -23,7 +23,9 @@
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -49,57 +51,65 @@
     @Scheduled(cron = "0/5 * * * * ?")
     private void wcsOpenComplete() {
         SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
-        StaProtocol staProtocol305 = devpThread.getStation().get(305);
-        if (staProtocol305!= null && staProtocol305.getIfOpenDoor()) {
-            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
-            if (basDevp.getWrkNo() != 0) {
-                WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
-                if (wrkMast == null || wrkMast.getWhsType() == null || wrkMast.getWhsType() == 3){
-                    return;
-                }
-                if (wrkMast.getWhsType() == 4) {
-                    return;
-                }
-                WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()));
-                // 鍒ゆ柇寮�闂ㄥ畬鎴愶紝鍒欓�氱煡agv鍙互鏀捐揣
-                // 璋冪敤缁撴灉
-                boolean success = false;
-                // 鏋勯�犺姹傚ご
-                Map<String, Object> headers = new HashMap<>();
-                headers.put("Content-Type", "application/json;charset=UTF-8");
-                // 鏋勯�犺姹備綋
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("matnr",wrkDetl.getMatnr());
-                jsonObject.put("batch",wrkDetl.getBatch());
-                jsonObject.put("flag",wrkMast.getIoType() > 100 ? "0" : "1");
-                String body = jsonObject.toJSONString();
-                String response = "";
-                try {
-                    response = new HttpHandler.Builder()
-                            .setUri(AgvApi.OPEN_COMPLETE_PUSH.getURI())
-                            .setPath(AgvApi.OPEN_COMPLETE_PUSH.getPath())
-                            .setHeaders(headers)
-                            .setJson(body)
-                            .build()
-                            .doPost();
-                    if (!Cools.isEmpty(response)) {
-                        JSONObject jsonObject1 = JSONObject.parseObject(response);
-                        if ((Integer) jsonObject1.get("code") == 200) {
-                            success = true;
-                            wrkMast.setWhsType(3);
-                            wrkMastService.updateById(wrkMast);
-                        }
-                    } else {
-                        log.error("wcs寮�闂ㄥ畬鎴愰�氱煡agv鎺ュ彛寮傚父鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", "", body, response);
+        List<StaProtocol> staProtocols = new ArrayList<StaProtocol>() {{
+            add(devpThread.getStation().get(305));
+            add(devpThread.getStation().get(1202));
+        }};
+//        StaProtocol staProtocol305 = devpThread.getStation().get(305);
+        for (StaProtocol staProtocol : staProtocols) {
+//            if (staProtocol305 != null && staProtocol305.getIfOpenDoor()) {
+            if (staProtocol != null && staProtocol.getIfOpenDoor()) {
+                BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", staProtocol.getSiteId()));
+                if (basDevp.getWrkNo() != 0) {
+                    WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
+                    if (wrkMast == null || wrkMast.getWhsType() == null || wrkMast.getWhsType() == 3) {
+                        return;
                     }
-                } catch (Exception e) {
-                    log.error("wcs寮�闂ㄥ畬鎴愰�氱煡agv鎺ュ彛寮傚父锛歿}", e.getMessage());
-                } finally {
-                    log.error("wcs寮�闂ㄥ畬鎴愰�氱煡agv鎺ュ彛锛歿}", success);
+                    if (wrkMast.getWhsType() == 4) {
+                        return;
+                    }
+                    WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()));
+                    // 鍒ゆ柇寮�闂ㄥ畬鎴愶紝鍒欓�氱煡agv鍙互鏀捐揣
+                    // 璋冪敤缁撴灉
+                    boolean success = false;
+                    // 鏋勯�犺姹傚ご
+                    Map<String, Object> headers = new HashMap<>();
+                    headers.put("Content-Type", "application/json;charset=UTF-8");
+                    // 鏋勯�犺姹備綋
+                    JSONObject jsonObject = new JSONObject();
+                    jsonObject.put("matnr", wrkDetl.getMatnr());
+                    jsonObject.put("batch", wrkDetl.getBatch());
+                    jsonObject.put("flag", wrkMast.getIoType() > 100 ? "0" : "1");
+                    String body = jsonObject.toJSONString();
+                    String response = "";
+                    try {
+                        response = new HttpHandler.Builder()
+                                .setUri(AgvApi.OPEN_COMPLETE_PUSH.getURI())
+                                .setPath(AgvApi.OPEN_COMPLETE_PUSH.getPath())
+                                .setHeaders(headers)
+                                .setJson(body)
+                                .build()
+                                .doPost();
+                        if (!Cools.isEmpty(response)) {
+                            JSONObject jsonObject1 = JSONObject.parseObject(response);
+                            if ((Integer) jsonObject1.get("code") == 200) {
+                                success = true;
+                                wrkMast.setWhsType(3);
+                                wrkMastService.updateById(wrkMast);
+                            }
+                        } else {
+                            log.error("wcs寮�闂ㄥ畬鎴愰�氱煡agv鎺ュ彛寮傚父鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", "", body, response);
+                        }
+                    } catch (Exception e) {
+                        log.error("wcs寮�闂ㄥ畬鎴愰�氱煡agv鎺ュ彛寮傚父锛歿}", e.getMessage());
+                    } finally {
+                        log.error("wcs寮�闂ㄥ畬鎴愰�氱煡agv鎺ュ彛锛歿}", success);
+                    }
                 }
             }
         }
-        }
+
+    }
 
     /**
      * 璇诲凡鍏抽棬
@@ -107,22 +117,27 @@
     @Scheduled(cron = "0/5 * * * * ?")
     private void wcsCloseComplete() {
         SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
-        StaProtocol staProtocol = devpThread.getStation().get(305);
-        if (staProtocol == null) {
-            return;
-        } else {
-            staProtocol = staProtocol.clone();
-        }
-            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
+        List<StaProtocol> staProtocols = new ArrayList<StaProtocol>() {{
+            add(devpThread.getStation().get(305));
+            add(devpThread.getStation().get(1202));
+        }};
+//        StaProtocol staProtocol = devpThread.getStation().get(305);
+        for (StaProtocol staProtocol : staProtocols) {
+            if (staProtocol == null) {
+                return;
+            } else {
+                staProtocol = staProtocol.clone();
+            }
+            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", staProtocol.getSiteId()));
             if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
                 WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
-                if (wrkMast == null ||  wrkMast.getWhsType() == null ||wrkMast.getWhsType() != 4) {
+                if (wrkMast == null || wrkMast.getWhsType() == null || wrkMast.getWhsType() != 4) {
                     return;
                 }
                 if (wrkMast.getIoType() == 1 && wrkMast.getWrkSts() == 1) {
                     staProtocol.setWorkNo(wrkMast.getWrkNo());
                     staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
-                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))){
+                    if (!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))) {
                         log.error("鍏ュ簱鍏抽棬瀹屾垚澶辫触");
                     }
                     wrkMast.setWrkSts(2L);
@@ -132,12 +147,13 @@
                 } else if (wrkMast.getIoType() == 101) {
                     staProtocol.setWorkNo(9999);
                     staProtocol.setStaNo(wrkMast.getSourceStaNo().shortValue());
-                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))){
+                    if (!MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol))) {
                         log.error("鍑哄簱鍏抽棬瀹屾垚澶辫触");
                     }
                     basDevp.setWrkNo(staProtocol.getWorkNo());
                     basDevpService.updateById(basDevp);
                 }
             }
+        }
     }
 }
diff --git a/src/main/java/com/zy/controller/OpenController.java b/src/main/java/com/zy/controller/OpenController.java
index 6106853..95e8b70 100644
--- a/src/main/java/com/zy/controller/OpenController.java
+++ b/src/main/java/com/zy/controller/OpenController.java
@@ -49,12 +49,14 @@
                                      HttpServletRequest request) {
         auth(appkey, param, request);
             // 缁�305鍐欏叧闂�
-            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
+//            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
+            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", param.getStaNo()));
             if (basDevp.getWrkNo() != 0) {
                 WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
                 if(wrkMast.getWhsType() != null && wrkMast.getWhsType() == 3) {
                     SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
-                    StaProtocol staProtocol305 = devpThread.getStation().get(305);
+//                    StaProtocol staProtocol305 = devpThread.getStation().get(305);
+                    StaProtocol staProtocol305 = devpThread.getStation().get(param.getStaNo());
                     if (!staProtocol305.getIfCloseDoor()) { // 娌¤姹傚叧闂�
                         // 璇锋眰鍏抽棴
                         if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 0))){
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index d884e92..6c56abd 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -45,21 +45,22 @@
     public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{
         add(100);add(101);add(102);add(103);
         add(104);add(105);add(106);add(107);
-        add(200);add(201);add(202);add(203);add(210);
-        add(300);add(301);add(302);add(303);add(304);add(305);
+        add(1101);add(1102);
+        add(200);add(201);add(202);add(203);add(2101);add(2102);add(2103);add(2104);add(210);
+        add(300);add(301);add(302);add(303);add(304);add(305);add(1200);add(1201);add(1202);
     }};
 
     public static final ArrayList<Integer> BarcodeList = new ArrayList<Integer>() {{
-        add(1); add(2);
+        add(1); add(2);add(3);
     }};
     public static final ArrayList<Integer> staNosErrList = new ArrayList<Integer>() {{
-        add(101); add(103);
+        add(101); add(103);add(1102);
     }};
 
     /**
      * 鏉$爜鏁伴噺
      */
-    private int barcodeSize = 2;
+    private int barcodeSize = 3;
 
     /**
      * 鍏ュ嚭搴撴ā寮�
@@ -218,7 +219,7 @@
         // 璇讳竴妤艰繛缁�8涓珯鐐�
         OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) (8*8));
         if (result.IsSuccess) {
-            for (int i = 0; i < 8; i++) {
+            for (int i = 0; i < 10; i++) {
                 Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
                 StaProtocol staProtocol = station.get(siteId);
                 if (null == staProtocol) {
@@ -248,7 +249,7 @@
         // 璇讳簩妤艰繛缁�4涓珯鐐�
         OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.800", (short) (4*8));
         if (result2.IsSuccess) {
-            for (int i = 8; i < 12; i++) {
+            for (int i = 10; i < 18; i++) {
                 Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
                 StaProtocol staProtocol = station.get(siteId);
                 if (null == staProtocol) {
@@ -278,7 +279,7 @@
         // 璇讳簩妤�210
         OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB101.880", (short) (8));
         if (result3.IsSuccess) {
-                Integer siteId = staNos.get(12); // 绔欑偣缂栧彿210
+                Integer siteId = staNos.get(18); // 绔欑偣缂栧彿210
                 StaProtocol staProtocol = station.get(siteId);
                 if (null == staProtocol) {
                     staProtocol = new StaProtocol();
@@ -306,7 +307,7 @@
         // 璇讳簩妤�3鍖�
         OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB101.1600", (short) (6*8));
         if (result2.IsSuccess) {
-            for (int i = 13; i < staNos.size(); i++) {
+            for (int i = 19; i < staNos.size(); i++) {
                 Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
                 StaProtocol staProtocol = station.get(siteId);
                 if (null == staProtocol) {
@@ -382,7 +383,7 @@
         // 璇讳竴妤艰繛缁�8涓珯鐐癸紝鏁呴殰淇℃伅鍙嶉
         OperateResultExOne<byte[]> resultErr2 = siemensS7Net.Read("DB101.3312", (short) (8*2));
         if (resultErr2.IsSuccess) {
-            for (int i = 0; i < 8; i++) {
+            for (int i = 0; i < 10; i++) {
                 boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr2.Content, i*2 + 1, 1);
                 StaProtocol staProtocol = station.get(staNos.get(i)); // 绔欑偣缂栧彿
                 staProtocol.setBreakerErr(status[0]);
@@ -399,7 +400,7 @@
         // 璇讳簩妤艰繛缁�4涓珯鐐癸紝鏁呴殰淇℃伅鍙嶉
         OperateResultExOne<byte[]> resultErr3 = siemensS7Net.Read("DB101.3512", (short) (4*2));
         if (resultErr3.IsSuccess) {
-            for (int i = 8; i < 12; i++) {
+            for (int i = 10; i < 18; i++) {
                 boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr3.Content, (i-8) * 2 + 1, 1);
                 StaProtocol staProtocol = station.get(staNos.get(i)); // 绔欑偣缂栧彿
                 staProtocol.setBreakerErr(status[0]);
@@ -415,7 +416,7 @@
         // 璇讳笁鍖烘晠闅滀俊鎭弽棣�
         OperateResultExOne<byte[]> resultErr4 = siemensS7Net.Read("DB101.2096", (short) (6*2));
         if (resultErr4.IsSuccess) {
-            for (int i = 13; i < staNos.size(); i++) {
+            for (int i = 19; i < staNos.size(); i++) {
                 boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr4.Content, (i-13) * 2 + 1, 1);
                 StaProtocol staProtocol = station.get(staNos.get(i)); // 绔欑偣缂栧彿
                 staProtocol.setBreakerErr(status[0]);
diff --git a/src/main/java/com/zy/service/impl/MainServiceImpl.java b/src/main/java/com/zy/service/impl/MainServiceImpl.java
index ca4dea8..3c1a631 100644
--- a/src/main/java/com/zy/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/service/impl/MainServiceImpl.java
@@ -95,6 +95,9 @@
     @Value("${wms.url}")
     private String wmsUrl;
 
+    @Value("${open-door.site}")
+    private String openDoorSite;
+
     public Integer wrkNo = 9901;
 
     /**
@@ -1068,7 +1071,12 @@
                     // 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞�
                     if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) {
                         News.warnNoLog(""+mark+" - 2"+" - 6"+" - 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞� : 寮�濮嬫墽琛� 浠诲姟鍙�={}",wrkMast.getWrkNo());
-                        String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo());
+                        String shallowLocNo = "";
+                        if (Utils.getRow(wrkMast.getSourceLocNo()) == 11 && Utils.getBay(wrkMast.getSourceLocNo()) <= 18){
+                            shallowLocNo = "10" + Utils.getBay(wrkMast.getSourceLocNo()) + Utils.getLev(wrkMast.getSourceLocNo());
+                        }else {
+                            shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo());
+                        }
                         LocMast shallowLoc = locMastService.selectById(shallowLocNo);
                         // O.绌哄簱浣嶃�丵.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴撱�丼.鍏ュ簱棰勭害銆乆.绂佺敤 鐩存帴鎼紒
                         if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) {
@@ -1883,7 +1891,12 @@
 
                     if (loc != null) {
                         if (Utils.isDeepLoc(slaveProperties, loc.getLocNo())) {
-                            String shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo());
+                            String shallowLocNo = "";
+                            if (row == 11){
+                                shallowLocNo = "10" + loc.getBay1() + loc.getLev1();
+                            }else {
+                                shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo());
+                            }
                             LocMast shallowLoc1 = locMastService.selectById(shallowLocNo);
                             if (!shallowLoc1.getLocSts().equals("O")) {
                                 loc = null;
@@ -1900,7 +1913,7 @@
                     if (Utils.isShallowLoc(slaveProperties, row)) {
                         loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
 
-                        if (null != loc) {//瀵瑰簲娣卞簱浣嶉潪鍦ㄥ簱鐘舵��,涓嶈兘绉诲簱
+                        if (null != loc && row != 9 && row != 10) {//瀵瑰簲娣卞簱浣嶉潪鍦ㄥ簱鐘舵��,涓嶈兘绉诲簱
                             String deepLoc = Utils.getDeepLoc(slaveProperties, loc.getLocNo());
                             LocMast deepLoc1 = locMastService.selectById(deepLoc);
                             if (!deepLoc1.getLocSts().equals("F") && !deepLoc1.getLocSts().equals("D")) {
@@ -3101,20 +3114,39 @@
     }
 
     public synchronized void writePlc305() {
-        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
-        if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
-            WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
-            if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) {
-                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
-                StaProtocol staProtocol305 = devpThread.getStation().get(305);
-                if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 娌¤姹傛墦寮�
-                    // 璇锋眰鎵撳紑
-                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){
-                        log.error("璇锋眰寮�闂ㄥけ璐�");
+        String[] sites = openDoorSite.split(",");
+        for (String site : sites) {
+            Integer sta = Integer.valueOf(site);
+            BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", sta));
+            if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
+                WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
+                if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) {
+                    SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
+                    StaProtocol staProtocol305 = devpThread.getStation().get(sta);
+                    if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 娌¤姹傛墦寮�
+                        // 璇锋眰鎵撳紑
+//                        if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){
+                        if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, site))){ // data涓洪渶瑕佸紑闂ㄧ殑绔欑偣 閫氱煡PLC闇�瑕佸紑鍝釜闂�
+                            log.error("璇锋眰寮�闂ㄥけ璐�");
+                        }
                     }
                 }
             }
         }
+//        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305));
+//        if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) {
+//            WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo());
+//            if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) {
+//                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
+//                StaProtocol staProtocol305 = devpThread.getStation().get(305);
+//                if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 娌¤姹傛墦寮�
+//                    // 璇锋眰鎵撳紑
+//                    if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){
+//                        log.error("璇锋眰寮�闂ㄥけ璐�");
+//                    }
+//                }
+//            }
+//        }
     }
     public synchronized void readPlc305() {
         WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 16L));
@@ -3132,7 +3164,7 @@
 //                return;
 //            }
            List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 1L).eq("io_type", 1)
-                .eq("source_sta_no", 305).orderBy("appe_time",true));
+                .in("source_sta_no", 305, 1202).orderBy("appe_time",true));
            for (WrkMast wrkMast : wrkMastList) {
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
                StaProtocol staProtocol= devpThread.getStation().get(wrkMast.getStaNo());
diff --git a/src/main/java/com/zy/utils/Utils.java b/src/main/java/com/zy/utils/Utils.java
index ec92253..4e33fac 100644
--- a/src/main/java/com/zy/utils/Utils.java
+++ b/src/main/java/com/zy/utils/Utils.java
@@ -144,6 +144,26 @@
     }
 
     /**
+     * 閫氳繃搴撲綅鍙疯幏鍙� 鍒�
+     */
+    public static int getBay(String locNo) {
+        if (!Cools.isEmpty(locNo)) {
+            return Integer.parseInt(locNo.substring(2, 5));
+        }
+        throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+    }
+
+    /**
+     * 閫氳繃搴撲綅鍙疯幏鍙� 灞�
+     */
+    public static int getLev(String locNo) {
+        if (!Cools.isEmpty(locNo)) {
+            return Integer.parseInt(locNo.substring(5, 7));
+        }
+        throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+    }
+
+    /**
      * 褰撴绱㈠埌鍙屾繁搴撲綅鐨勬祬搴撲綅鏃讹紝濡傛灉娣卞簱浣嶆棤璐э紝鍒欐斁鍏ュ搴旂殑娣卞簱浣�
      */
     public static void toDeepIfEmptyByShallow(String shallowLoc) {
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 6e4d014..32f114c 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -8,8 +8,8 @@
     name: @pom.build.finalName@
   datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
-    url: jdbc:sqlserver://10.10.10.243:1433;databasename=ghlnasrs
-#    url: jdbc:sqlserver://127.0.0.1:1433;databasename=ghlnasrs
+#    url: jdbc:sqlserver://10.10.10.243:1433;databasename=ghlnasrs
+    url: jdbc:sqlserver://127.0.0.1:1433;databasename=ghlnasrs
     username: sa
     password: sa@123
   mvc:
@@ -35,14 +35,18 @@
   enable: false
 
 wms:
-  url: 10.10.10.243:8080/ghlnwms
+#  url: 10.10.10.243:8080/ghlnwms
+  url: 127.0.0.1:8080/ghlnwms
+
+open-door:
+  site: 305,1202
 
 # 涓嬩綅鏈洪厤缃�
 wcs-slave:
   # 鍙屾繁
   doubleDeep: true
   # 鍙屾繁搴撲綅鎺掑彿
-  doubleLocs: 1,4,5,8
+  doubleLocs: 1,4,5,8,11
   # 涓�涓爢鍨涙満璐熻矗鐨勮揣鏋舵帓鏁�
   groupCount: 4
 
@@ -136,6 +140,48 @@
       row: 6
       bay: 28
       lev: 1
+  # 鍫嗗灈鏈�3
+  crn[2]:
+    id: 3
+    ip: 10.10.10.20
+    port: 102
+    rack: 0
+    slot: 0
+    # 鍋忕Щ閲忥紝褰撳爢鍨涙満绔欑偣鍒楀彿=1鏃讹紝鍋忕Щ閲�=2
+    offset: 2
+    demo: false
+    # 鍫嗗灈鏈哄叆搴撶珯鐐�
+    crnInStn[0]:
+      devpPlcId: ${wcs-slave.devp[0].id}
+      staNo: 1102
+      row: 9
+      bay: 1
+      lev: 1
+    crnInStn[1]:
+      devpPlcId: ${wcs-slave.devp[0].id}
+      staNo: 2101
+      row: 9
+      bay: 1
+      lev: 2
+    # 鍫嗗灈鏈哄嚭搴撶珯鐐�
+    crnOutStn[0]:
+      devpPlcId: ${wcs-slave.devp[0].id}
+      staNo: 1102
+      row: 6
+      bay: 1
+      lev: 1
+    crnOutStn[1]:
+      devpPlcId: ${wcs-slave.devp[0].id}
+      staNo: 2101
+      row: 9
+      bay: 1
+      lev: 2
+    crnOutStn[2]:
+      devpPlcId: ${wcs-slave.devp[0].id}
+      staNo: 2103
+      row: 10
+      bay: 1
+      lev: 1
 
   # 杈撻�佺嚎1
   devp[0]:
@@ -159,6 +205,15 @@
     # 鍏ュ簱鍙�3
     inSta[2]:
       staNo: 305
+    # 鍏ュ簱鍙�4
+    inSta[3]:
+      staNo: 1102
+      barcode: ${wcs-slave.barcode[2].id}
+      backSta: 108
+      led: ${wcs-slave.led[3].id}
+    # 鍏ュ簱鍙�5
+    inSta[4]:
+      staNo: 1202
     # 绌烘澘鍏ュ簱鍙�1
 #    emptyInSta[0]:
 #      staNo: 101
@@ -188,6 +243,13 @@
     # 鍑哄簱鍙�5
     outSta[4]:
       staNo: 305
+    # 鍑哄簱鍙�6
+    outSta[5]:
+      staNo: 1101
+      led: ${wcs-slave.led[3].id}
+    # 鍑哄簱鍙�7
+    outSta[6]:
+      staNo: 1202
 
   # 鏉$爜鎵弿浠�1
   barcode[0]:
@@ -198,6 +260,11 @@
   barcode[1]:
     id: 2
     ip: 10.10.10.122
+    port: 51236
+  # 鏉$爜鎵弿浠�3
+  barcode[2]:
+    id: 2
+    ip: 10.10.10.123
     port: 51236
 
   # LED1
@@ -221,4 +288,11 @@
     ip: 10.10.10.192
     port: 5005
     devpPlcId: ${wcs-slave.devp[0].id}
-    staArr: 104
\ No newline at end of file
+    staArr: 104
+  # LED3
+  led[3]:
+    id: 4
+    ip: 10.10.10.193
+    port: 5005
+    devpPlcId: ${wcs-slave.devp[0].id}
+    staArr: 1101
\ No newline at end of file
diff --git a/src/main/webapp/static/js/console.js b/src/main/webapp/static/js/console.js
index f731681..0142dff 100644
--- a/src/main/webapp/static/js/console.js
+++ b/src/main/webapp/static/js/console.js
@@ -126,7 +126,7 @@
         let stnss = areas[i].stns
         let floor = areas[i].text
         floorId = areas[i].id
-        var position = (i+1)*100
+        var position = (i+1)*300
         floorBtn =
             "<button class='floorBtn btn-16' onclick='changFloor("+i+")' style='top: "+position+"px;'>" + floor +"</button>"
         if (mapInfo.areas[0].floors.length == 1) {
diff --git a/src/main/webapp/static/js/console.map.js b/src/main/webapp/static/js/console.map.js
index b2a3f7b..a1687df 100644
--- a/src/main/webapp/static/js/console.map.js
+++ b/src/main/webapp/static/js/console.map.js
@@ -1,7 +1,7 @@
 mapInfo = {
     "mapName": "WCS",
-    "rackCount": 8,
-    "crnCount": 2,
+    "rackCount": 10,
+    "crnCount": 3,
     "stbCount": 18,
     "hpPosition": 1,
     "minBayNo": 1,
@@ -9,7 +9,7 @@
     "racks": [{
         "type": "rack",
         "id": "rack1",
-        "top": 189,
+        "top": 325,
         "left": 200,
         "width": 1350,
         "height": 23,
@@ -18,7 +18,7 @@
     }, {
         "type": "rack",
         "id": "rack8",
-        "top": 457,
+        "top": 595,
         "left": 200,
         "width": 1300,
         "height": 23,
@@ -27,7 +27,7 @@
     }, {
         "type": "rack",
         "id": "rack7",
-        "top": 430,
+        "top": 570,
         "left": 200,
         "width": 1300,
         "height": 23,
@@ -36,7 +36,7 @@
     }, {
         "type": "rack",
         "id": "rack6",
-        "top": 365,
+        "top": 500,
         "left": 200,
         "width": 1350,
         "height": 23,
@@ -45,7 +45,7 @@
     }, {
         "type": "rack",
         "id": "rack5",
-        "top": 338,
+        "top": 473,
         "left": 200,
         "width": 1350,
         "height": 23,
@@ -54,7 +54,7 @@
     }, {
         "type": "rack",
         "id": "rack4",
-        "top": 311,
+        "top": 448,
         "left": 200,
         "width": 1300,
         "height": 23,
@@ -63,7 +63,7 @@
     }, {
         "type": "rack",
         "id": "rack3",
-        "top": 283,
+        "top": 423,
         "left": 200,
         "width": 1300,
         "height": 23,
@@ -72,34 +72,64 @@
     }, {
         "type": "rack",
         "id": "rack2",
-        "top": 217,
+        "top": 350,
         "left": 200,
         "width": 1350,
         "height": 23,
         "minBayNo": 1,
         "maxBayNo": 31
+    },{
+        "type": "rack",
+        "id": "rack9",
+        "top": 300,
+        "left": 200,
+        "width": 1300,
+        "height": 23,
+        "minBayNo": 2,
+        "maxBayNo": 31
+    },{
+        "type": "rack",
+        "id": "rack10",
+        "top": 230,
+        "left": 200,
+        "width": 1350,
+        "height": 23,
+        "minBayNo": 1,
+        "maxBayNo": 31
+    },{
+        "type": "rack",
+        "id": "rack11",
+        "top": 205,
+        "left": 200,
+        "width": 1350,
+        "height": 23,
+        "minBayNo": 1,
+        "maxBayNo": 18
     }],
     "rackDescs": [{
         "type": "rackDescs",
         "id": "lb_desc8",
         "text": "#8",
-        "top": 190,
+        "top": 325,
         "left": 150,
         "width": 33,
         "height": 23
     },
-        {"type": "rackDescs", "id": "lb_desc7", "text": "#7", "top": 218, "left": 150, "width": 33, "height": 23},
-        {"type": "rackDescs", "id": "lb_desc6", "text": "#6", "top": 280, "left": 150, "width": 33, "height": 23},
-        {"type": "rackDescs", "id": "lb_desc5", "text": "#5", "top": 310, "left": 150, "width": 33, "height": 23},
-        {"type": "rackDescs", "id": "lb_desc4", "text": "#4", "top": 340, "left": 150, "width": 33, "height": 23},
-        {"type": "rackDescs", "id": "lb_desc3", "text": "#3", "top": 370, "left": 150, "width": 33, "height": 23},
-        {"type": "rackDescs", "id": "lb_desc2", "text": "#2", "top": 430, "left": 150, "width": 33, "height": 23},
-        {"type": "rackDescs", "id": "lb_desc1", "text": "#1", "top": 460, "left": 150, "width": 33, "height": 23}],
+        {"type": "rackDescs", "id": "lb_desc11", "text": "#11", "top": 205, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc10", "text": "#10", "top": 230, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc9", "text": "#9", "top": 300, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc7", "text": "#7", "top": 350, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc6", "text": "#6", "top": 423, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc5", "text": "#5", "top": 448, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc4", "text": "#4", "top": 473, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc3", "text": "#3", "top": 500, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc2", "text": "#2", "top": 570, "left": 150, "width": 33, "height": 23},
+        {"type": "rackDescs", "id": "lb_desc1", "text": "#1", "top": 595, "left": 150, "width": 33, "height": 23}],
     "crns": [{
         "type": "crane",
         "id": "crn-1",
         "text": "1",
-        "top": 393,
+        "top": 530,
         "left": 376,
         "width": 101,
         "height": 32
@@ -107,7 +137,7 @@
         "type": "track",
         "id": "lb_track4",
         "text": "",
-        "top": 408,
+        "top": 548,
         "left": 200,
         "width": 1300,
         "height": 1
@@ -115,7 +145,7 @@
         "type": "crane",
         "id": "crn-2",
         "text": "2",
-        "top": 250,
+        "top": 385,
         "left": 383,
         "width": 101,
         "height": 29
@@ -123,7 +153,23 @@
         "type": "track",
         "id": "lb_track3",
         "text": "",
+        "top": 400,
+        "left": 200,
+        "width": 1300,
+        "height": 1
+    },{
+        "type": "crane",
+        "id": "crn-3",
+        "text": "3",
         "top": 265,
+        "left": 383,
+        "width": 101,
+        "height": 29
+    },{
+        "type": "track",
+        "id": "lb_track5",
+        "text": "",
+        "top": 280,
         "left": 200,
         "width": 1300,
         "height": 1
@@ -148,7 +194,7 @@
                 "type": "stn",
                 "id": "site-102",
                 "text": "102",
-                "top": 431,
+                "top": 570,
                 "left": 1600,
                 "width": 59,
                 "height": 27
@@ -156,7 +202,7 @@
                 "type": "stn",
                 "id": "site-103",
                 "text": "103",
-                "top": 431,
+                "top": 570,
                 "left": 1520,
                 "width": 59,
                 "height": 27
@@ -164,7 +210,7 @@
                 "type": "stn",
                 "id": "site-100",
                 "text": "100",
-                "top": 285,
+                "top": 423,
                 "left": 1600,
                 "width": 59,
                 "height": 25
@@ -172,7 +218,7 @@
                 "type": "stn",
                 "id": "site-101",
                 "text": "101",
-                "top": 285,
+                "top": 423,
                 "left": 1520,
                 "width": 59,
                 "height": 25
@@ -181,7 +227,7 @@
                     "type": "stn",
                     "id": "site-105",
                     "text": "105",
-                    "top": 431,
+                    "top": 570,
                     "left": 1328,
                     "width": 85,
                     "height": 50
@@ -189,7 +235,7 @@
                     "type": "stn",
                     "id": "site-104",
                     "text": "104",
-                    "top": 491,
+                    "top": 630,
                     "left": 1328,
                     "width": 85,
                     "height": 50
@@ -197,7 +243,7 @@
                     "type": "stn",
                     "id": "site-106",
                     "text": "106",
-                    "top": 284,
+                    "top": 420,
                     "left": 287,
                     "width": 86,
                     "height": 105
@@ -205,10 +251,26 @@
                     "type": "stn",
                     "id": "site-107",
                     "text": "107",
-                    "top": 431,
+                    "top": 570,
                     "left": 287,
                     "width": 86,
                     "height": 50
+                },{
+                    "type": "stn",
+                    "id": "site-1102",
+                    "text": "1102",
+                    "top": 297,
+                    "left": 1520,
+                    "width": 59,
+                    "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-1101",
+                    "text": "1101",
+                    "top": 297,
+                    "left": 1600,
+                    "width": 59,
+                    "height": 25
                 }]
         }, {
             "type": "floor",
@@ -222,7 +284,7 @@
                 "type": "stn",
                 "id": "site-202",
                 "text": "202",
-                "top": 431,
+                "top": 595,
                 "left": 1600,
                 "width": 59,
                 "height": 27
@@ -230,7 +292,7 @@
                 "type": "stn",
                 "id": "site-203",
                 "text": "203",
-                "top": 431,
+                "top": 595,
                 "left": 1520,
                 "width": 59,
                 "height": 27
@@ -238,7 +300,7 @@
                 "type": "stn",
                 "id": "site-200",
                 "text": "200",
-                "top": 285,
+                "top": 448,
                 "left": 1600,
                 "width": 59,
                 "height": 25
@@ -246,7 +308,7 @@
                 "type": "stn",
                 "id": "site-201",
                 "text": "201",
-                "top": 285,
+                "top": 448,
                 "left": 1520,
                 "width": 59,
                 "height": 25
@@ -254,7 +316,7 @@
                 "type": "stn",
                 "id": "site-210",
                 "text": "210",
-                "top": 431,
+                "top": 595,
                 "left": 1680,
                 "width": 59,
                 "height": 25
@@ -265,7 +327,7 @@
                 "top": 110,
                 "left": 1690,
                 "width": 1,
-                "height": 350
+                "height": 520
             }, {
                 "type": "track",
                 "id": "lb_track6",
@@ -273,7 +335,7 @@
                 "top": 110,
                 "left": 1720,
                 "width": 1,
-                "height": 350
+                "height": 520
             }, {
                 "type": "stn",
                 "id": "site-300",
@@ -327,6 +389,62 @@
                     "left": 1450,
                     "width": 59,
                     "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-2101",
+                    "text": "2101",
+                    "top": 297,
+                    "left": 1520,
+                    "width": 59,
+                    "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-2102",
+                    "text": "2102",
+                    "top": 297,
+                    "left": 1600,
+                    "width": 59,
+                    "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-2103",
+                    "text": "2103",
+                    "top": 230,
+                    "left": 1600,
+                    "width": 59,
+                    "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-2104",
+                    "text": "2104",
+                    "top": 120,
+                    "left": 1722,
+                    "width": 59,
+                    "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-1200",
+                    "text": "1200",
+                    "top": 120,
+                    "left": 1782,
+                    "width": 59,
+                    "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-1201",
+                    "text": "1201",
+                    "top": 94,
+                    "left": 1782,
+                    "width": 59,
+                    "height": 25
+                },{
+                    "type": "stn",
+                    "id": "site-1202",
+                    "text": "1202",
+                    "top": 68,
+                    "left": 1782,
+                    "width": 59,
+                    "height": 25
                 }
             ]
         }]
diff --git a/src/main/webapp/views/crn.html b/src/main/webapp/views/crn.html
index 6666baa..8c87a2e 100644
--- a/src/main/webapp/views/crn.html
+++ b/src/main/webapp/views/crn.html
@@ -65,12 +65,12 @@
                     <!--            <span>&nbsp;</span>-->
                     <input id="crn2" disabled="disabled">
                 </div>
-<!--                <div class="crn-command-item">-->
-<!--                    <label>3#</label>-->
-<!--                    <button id="demoBtn-3" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>-->
-<!--                    &lt;!&ndash;            <span>&nbsp;</span>&ndash;&gt;-->
-<!--                    <input id="crn3" disabled="disabled">-->
-<!--                </div>-->
+                <div class="crn-command-item">
+                    <label>3#</label>
+                    <button id="demoBtn-3" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>
+                    <!--            <span>&nbsp;</span>-->
+                    <input id="crn3" disabled="disabled">
+                </div>
 <!--                <div class="crn-command-item">-->
 <!--                    <label>4#</label>-->
 <!--                    <button id="demoBtn-4" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>-->
@@ -144,7 +144,7 @@
                     <div class="select-container" style="padding: 20px 0;">
                         <label><input type="radio" name="crnSelect" value="1" checked>&nbsp;1鍙峰爢鍨涙満</label>
                         <label><input type="radio" name="crnSelect" value="2">&nbsp;2鍙峰爢鍨涙満</label>
-<!--                        <label><input type="radio" name="crnSelect" value="3">&nbsp;3鍙峰爢鍨涙満</label>-->
+                        <label><input type="radio" name="crnSelect" value="3">&nbsp;3鍙峰爢鍨涙満</label>
 <!--                        <label><input type="radio" name="crnSelect" value="4">&nbsp;4鍙峰爢鍨涙満</label>-->
                     </div>
                 </div>

--
Gitblit v1.9.1