From ab246a3f1e94056d57df505b5cc56a08fe6be24e Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期四, 13 七月 2023 09:51:34 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/enums/CrnStatusType.java          |    2 
 src/main/java/com/zy/asrs/utils/Utils.java                  |    4 -
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |    6 +-
 src/main/webapp/static/js/console.map.js                    |   52 ++++++++--------
 src/main/java/com/zy/common/model/LocTypeDto.java           |    6 +-
 src/main/java/com/zy/core/thread/SiemensDevpThread.java     |   26 ++++----
 src/main/resources/application.yml                          |   28 ++++----
 7 files changed, 61 insertions(+), 63 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index a79beb9..6644885 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -706,6 +706,7 @@
                 News.error(""+mark+" - 1"+" - 2"+" - 鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鐐瑰湪鏁版嵁搴撲笉瀛樺湪, 绔欑偣缂栧彿={}", crnStn.getStaNo());
                 continue;
             }
+
             if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable()
                     && staDetl.getCanining() != null && staDetl.getCanining().equals("Y")) {
                 flag = true;
@@ -1372,7 +1373,6 @@
                 if (!staProtocol.isLoading()){
                     continue;
                 }
-
                 // 绔欑偣鏉′欢鍒ゆ柇
                 if (staProtocol.isAutoing()
                         && staProtocol.isInEnable()
@@ -1423,8 +1423,8 @@
 //                                ledThread.errorReset();
                             }
                         } else {
-                            staProtocol.setWorkNo((short)9999);
-                            staProtocol.setStaNo(emptyInSta.getBackSta().shortValue());
+                            staProtocol.setWorkNo((short)9991);
+                            staProtocol.setStaNo((short)100);
                             devpThread.setPakMk(staProtocol.getSiteId(), false);
                             boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                             if (!result) {
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index dba862f..4dcdc5d 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -89,10 +89,8 @@
         int row = getRow(deepLoc);
         int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
         int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
-        if(row==9 ||  row==15 ){
+        if(row==3){
             shallowRow = row + 1;
-        }else if(row==12 ||  row==18 ){
-            shallowRow = row - 1;
         }else {
             return null;
         }
diff --git a/src/main/java/com/zy/common/model/LocTypeDto.java b/src/main/java/com/zy/common/model/LocTypeDto.java
index d360b7e..03a89cd 100644
--- a/src/main/java/com/zy/common/model/LocTypeDto.java
+++ b/src/main/java/com/zy/common/model/LocTypeDto.java
@@ -35,11 +35,11 @@
         if (staProtocol.isLow()) {
             this.locType1 = 1; // 浣庡簱浣�
         } else if (staProtocol.isHigh()){
-            this.locType1 = 2; // 楂樺簱浣�
+            this.locType1 = 2; // 涓簱浣�
         } else if (staProtocol.isMedium()) {
-            this.locType1 = 3;
+            this.locType1 = 3; // 涓珮搴撲綅
         } else if (staProtocol.isMedium_high()) {
-            this.locType1 = 4;
+            this.locType1 = 4; // 楂樺簱浣�
         }
 
 
diff --git a/src/main/java/com/zy/core/enums/CrnStatusType.java b/src/main/java/com/zy/core/enums/CrnStatusType.java
index 79c4b51..f02ed99 100644
--- a/src/main/java/com/zy/core/enums/CrnStatusType.java
+++ b/src/main/java/com/zy/core/enums/CrnStatusType.java
@@ -13,7 +13,7 @@
     ORIGIN_GO(7, "鍥炲師鐐�"),
     ORIGIN_BACK(8, "鍥炲弽鍘熺偣"),
     MOVING(9, "璧拌涓�"),
-    WAITING(90, "浠诲姟瀹屾垚绛夊緟WCS纭"),
+    WAITING(10, "浠诲姟瀹屾垚绛夊緟WCS纭"),
     PAUSE(11, "浠诲姟鏆傚仠"),
     SOS(99, "鎶ヨ"),
     UNKNOW(100, "鍏朵粬"),
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index c459208..4ca9c91 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -47,10 +47,10 @@
 //
 //    }};
     public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{
-        add(1);add(2);add(3);add(4);
-        add(5);add(6);add(7);add(8);
-        add(9);add(10);add(11);add(12);
-        add(13);
+        add(100);add(101);add(102);add(103);
+        add(104);add(105);add(106);add(107);
+        add(108);add(109);add(110);add(111);
+        add(1000);
     }};
 
 
@@ -61,7 +61,7 @@
     /**
      * 鏉$爜鏁伴噺
      */
-    private int barcodeSize = 6;
+    private int barcodeSize = 1;
 
     /**
      * 鍏ュ嚭搴撴ā寮�
@@ -212,7 +212,7 @@
 //        }
         //鏉$爜鎵弿鍣�
         Thread.sleep(200);
-        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.200",(short)(8));
+        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.33",(short)(8));
         if (result2.IsSuccess) {
             if (slave.getId()==1){
                     String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,0,8, "UTF-8");
@@ -227,7 +227,7 @@
         }
 
         Thread.sleep(200);
-        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.100", (short) (staNoSize * 2));
+        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB101.0", (short) (staNoSize * 2));
         if (result1.IsSuccess) {
             for (int i = 0; i < staNoSize; i++) {
                 Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
@@ -296,9 +296,9 @@
 
         //RGV鍙拌溅浣嶇疆
         Thread.sleep(200);
-        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.1",(short)2);
+        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2);
         if (result3.IsSuccess) {
-                Integer siteId = 13; // 绔欑偣缂栧彿
+                Integer siteId = 1000; // 绔欑偣缂栧彿
                 StaProtocol staProtocol = station.get(siteId);
                 if (null == staProtocol) {
                     staProtocol = new StaProtocol();
@@ -376,13 +376,13 @@
         //浠诲姟涓嬪彂娆℃暟
         int writeCount = 0;
         do {
-            write = siemensS7Net.Write("DB100." + index*2, staProtocol.getWorkNo());    // 宸ヤ綔鍙�
+            write = siemensS7Net.Write("DB100." + index*4, staProtocol.getWorkNo());    // 宸ヤ綔鍙�
             Thread.sleep(500);
-            write1 = siemensS7Net.Write("DB101." + index*2, staProtocol.getStaNo());    // 鐩爣绔�
+            write1 = siemensS7Net.Write("DB100." + (index*4+2), staProtocol.getStaNo());    // 鐩爣绔�
             if(write.IsSuccess || write1.IsSuccess){
                 Thread.sleep(200);
-                OperateResultExOne<byte[]> readResult = siemensS7Net.Read("DB100." + index*2, (short) 2);
-                OperateResultExOne<byte[]> readResult1 = siemensS7Net.Read("DB101." + index*2, (short) 2);
+                OperateResultExOne<byte[]> readResult = siemensS7Net.Read("DB100." + index*4, (short) 2);
+                OperateResultExOne<byte[]> readResult1 = siemensS7Net.Read("DB100." + (index*4+2), (short) 2);
                 if(readResult.IsSuccess && readResult1.IsSuccess){
                     short workNo = siemensS7Net.getByteTransform().TransInt16(readResult.Content, 0);
                     short staNo = siemensS7Net.getByteTransform().TransInt16(readResult1.Content, 0);
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index ecd4542..596e80a 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -8,7 +8,7 @@
     name: @pom.build.finalName@
   datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
-    url: jdbc:sqlserver://192.168.4.13:1433;databasename=jxfyasrs
+    url: jdbc:sqlserver://127.0.0.1:1433;databasename=jxfyasrs
     username: sa
     password: sa@123
   mvc:
@@ -34,7 +34,7 @@
   enable: false
 
 wms:
-  url: 192.168.4.121:8081/fywms
+  url: 127.0.0.1:8081/fywms
 
 # 涓嬩綅鏈洪厤缃�
 wcs-slave:
@@ -47,7 +47,7 @@
   # 鍫嗗灈鏈�1
   crn[0]:
     id: 1
-    ip: 10.10.10.2
+    ip: 10.10.10.100
     port: 102
     rack: 0
     slot: 0
@@ -57,21 +57,21 @@
     # 鍫嗗灈鏈哄叆搴撶珯鐐�
     crnInStn[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
-      staNo: 10
+      staNo: 111
       row: 1
       bay: 1
       lev: 1
     # 鍫嗗灈鏈哄嚭搴撶珯鐐�
     crnOutStn[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
-      staNo: 007
+      staNo: 109
       row: 2
       bay: 1
       lev: 1
   # 鍫嗗灈鏈�2
   crn[1]:
     id: 2
-    ip: 10.10.10.3
+    ip: 10.10.10.110
     port: 102
     rack: 0
     slot: 0
@@ -81,45 +81,45 @@
     # 鍫嗗灈鏈哄叆搴撶珯鐐�
     crnInStn[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
-      staNo: 6
+      staNo: 107
       row: 4
       bay: 1
       lev: 1
     # 鍫嗗灈鏈哄嚭搴撶珯鐐�
     crnOutStn[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
-      staNo: 3
+      staNo: 102
       row: 5
-      bay: 1
+      bay: 2
       lev: 1
 
   # 杈撻�佺嚎1
   devp[0]:
     id: 1
-    ip: 192.168.4.250
+    ip: 10.10.10.120
     port: 102
     rack: 0
     slot: 0
     # 鍏ュ簱鍙�1
     inSta[0]:
-      staNo: 2
+      staNo: 101
       barcode: ${wcs-slave.barcode[0].id}
       backSta: 1
       led: ${wcs-slave.led[0].id}
     # 绌烘澘鍏ュ簱鍙�1
     emptyInSta[0]:
-      staNo: 2
+      staNo: 101
       barcode: ${wcs-slave.barcode[0].id}
       backSta: 1
       led: ${wcs-slave.led[0].id}
     # 鎷f枡鍏ュ簱鍙�1
     pickSta[0]:
-      staNo: 2
+      staNo: 101
       barcode: ${wcs-slave.barcode[0].id}
       led: ${wcs-slave.led[0].id}
     # 鍑哄簱鍙�1
     outSta[0]:
-      staNo: 12
+      staNo: 105
       led: ${wcs-slave.led[1].id}
 
   # 鏉$爜鎵弿浠�1
diff --git a/src/main/webapp/static/js/console.map.js b/src/main/webapp/static/js/console.map.js
index 23f7967..0b49139 100644
--- a/src/main/webapp/static/js/console.map.js
+++ b/src/main/webapp/static/js/console.map.js
@@ -137,8 +137,8 @@
                     "stns": [
                         {
                             "type": "stn",
-                            "id": "site-001",
-                            "text": "001",
+                            "id": "site-100",
+                            "text": "100",
                             "top": 415,
                             "left": 402,
                             "width": 60,
@@ -146,8 +146,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-012",
-                            "text": "012",
+                            "id": "site-105",
+                            "text": "105",
                             "top": 415,
                             "left": 341,
                             "width": 60,
@@ -155,8 +155,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-013",
-                            "text": "013",
+                            "id": "site-1000",
+                            "text": "1000",
                             "top": 330,
                             "left": 279,
                             "width": 60,
@@ -182,8 +182,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-003",
-                            "text": "003",
+                            "id": "site-102",
+                            "text": "102",
                             "top": 363,
                             "left": 402,
                             "width": 60,
@@ -191,8 +191,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-004",
-                            "text": "004",
+                            "id": "site-103",
+                            "text": "103",
                             "top": 363,
                             "left": 341,
                             "width": 60,
@@ -200,8 +200,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-006",
-                            "text": "006",
+                            "id": "site-107",
+                            "text": "107",
                             "top": 305,
                             "left": 402,
                             "width": 60,
@@ -209,8 +209,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-005",
-                            "text": "005",
+                            "id": "site-106",
+                            "text": "106",
                             "top": 305,
                             "left": 341,
                             "width": 60,
@@ -218,8 +218,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-007",
-                            "text": "007",
+                            "id": "site-109",
+                            "text": "109",
                             "top": 226,
                             "left": 402,
                             "width": 60,
@@ -227,8 +227,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-008",
-                            "text": "008",
+                            "id": "site-108",
+                            "text": "108",
                             "top": 226,
                             "left": 341,
                             "width": 60,
@@ -236,8 +236,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-010",
-                            "text": "010",
+                            "id": "site-111",
+                            "text": "111",
                             "top": 168,
                             "left": 402,
                             "width": 60,
@@ -245,8 +245,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-011",
-                            "text": "011",
+                            "id": "site-104",
+                            "text": "104",
                             "top": 389,
                             "left": 341,
                             "width": 60,
@@ -254,8 +254,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-002",
-                            "text": "002",
+                            "id": "site-101",
+                            "text": "101",
                             "top": 389,
                             "left": 402,
                             "width": 60,
@@ -263,8 +263,8 @@
                         },
                         {
                             "type": "stn",
-                            "id": "site-009",
-                            "text": "009",
+                            "id": "site-110",
+                            "text": "110",
                             "top": 168,
                             "left": 341,
                             "width": 60,

--
Gitblit v1.9.1