From 6db4a007c34ece48ffac0a2b6c2f700d7b15c6e5 Mon Sep 17 00:00:00 2001
From: lsh <lsh>
Date: 星期五, 12 七月 2024 09:01:40 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 50 ++++++++++++++++++++++--
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java | 2 +
src/main/resources/mapper/WrkMastMapper.xml | 4 ++
src/main/java/com/zy/core/thread/SiemensDevpThread.java | 4 +-
src/main/resources/application.yml | 24 ++++++++++++
5 files changed, 77 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/zy/asrs/mapper/WrkMastMapper.java b/src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
index 32176dd..6a95d49 100644
--- a/src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
@@ -25,6 +25,8 @@
// @Select("select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC")
WrkMast selectPakInStep1(@Param("sourceStaNo")Integer sourceStaNo, @Param("barcode")String barcode);
+ WrkMast selectPakInStep111(@Param("sourceStaNo")Integer sourceStaNo, @Param("barcode")String barcode);
+
WrkMast selectPakInStep11(@Param("sourceStaNo")Integer sourceStaNo);
// 鍏ュ簱绗簩姝ワ紝褰撴墭鐩樼墿鏂欏湪鍫嗗灈鏈哄叆搴撶珯鏃舵椂鏌ヨ
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 5dd7668..468076a 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -224,8 +224,17 @@
// 鍒ゆ柇閲嶅宸ヤ綔妗�
WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
if (wrkMast != null) {
- log.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
- continue;
+ LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
+ barcodeThread.setBarcode("");
+ staProtocol.setWorkNo(wrkMast.getWrkNo());
+ staProtocol.setStaNo(wrkMast.getStaNo());
+
+ devpThread.setPakMk(staProtocol.getSiteId(), false);
+ boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+ if (!result) {
+ throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+ }
+ return;
}
// // 鑾峰彇鍏ュ簱閫氱煡妗�
// List<WaitPakin> waitPakins = waitPakinMapper.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N"));
@@ -388,6 +397,22 @@
// throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
// }
continue;
+ }
+
+ // 鍒ゆ柇閲嶅宸ヤ綔妗�
+ WrkMast wrkMast111 = wrkMastMapper.selectPakInStep111(inSta.getStaNo(), barcode);
+ if (wrkMast111 != null) {
+ LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
+ barcodeThread.setBarcode("");
+ staProtocol.setWorkNo(wrkMast111.getWrkNo());
+ staProtocol.setStaNo(wrkMast111.getStaNo());
+
+ devpThread.setPakMk(staProtocol.getSiteId(), false);
+ boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+ if (!result) {
+ throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+ }
+ return;
}
// 鍒ゆ柇閲嶅宸ヤ綔妗�
@@ -558,12 +583,27 @@
// }
continue;
}
-
+//
+// // 鍒ゆ柇閲嶅宸ヤ綔妗�
+// WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
+// if (wrkMast != null) {
+// log.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
+// continue;
+// }
// 鍒ゆ柇閲嶅宸ヤ綔妗�
WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
if (wrkMast != null) {
- log.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
- continue;
+ LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
+ barcodeThread.setBarcode("");
+ staProtocol.setWorkNo(wrkMast.getWrkNo());
+ staProtocol.setStaNo(wrkMast.getStaNo());
+
+ devpThread.setPakMk(staProtocol.getSiteId(), false);
+ boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+ if (!result) {
+ throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+ }
+ return;
}
// // 鑾峰彇鍏ュ簱閫氱煡妗�
// List<WaitPakin> waitPakins = waitPakinMapper.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N"));
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index d4d46d2..d25aee6 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -133,7 +133,7 @@
/**
* 鏉$爜鏁伴噺
*/
- private int barcodeSize = 5;
+ private int barcodeSize = 9;
/**
* 鍏ュ嚭搴撴ā寮�
@@ -351,7 +351,7 @@
Thread.sleep(200);
OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.2440",(short)(barcodeSize*8));
if (result2.IsSuccess) {
- int[] staNosRgv = {281,292,173,214,120};
+ int[] staNosRgv = {281,292,173,214,120,100,101,102,103};
for (int i = 0; i < barcodeSize; i++) { //1:281 2:292 3:174(173) 4:214 5:120
String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index f088e36..595d937 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -255,9 +255,11 @@
# 澶ф枡绠� 鍙屽伐浣嶅崟浼� 鍏ュ簱鍙�1
inLargeSta[0]:
staNo: 292
+ barcode: ${wcs-slave.barcode[1].id}
# 澶ф枡绠� 鍙屽伐浣嶅崟浼� 鍏ュ簱鍙�1
inLargeSta[1]:
staNo: 281
+ barcode: ${wcs-slave.barcode[0].id}
# 澶ф枡绠� 鍙屽伐浣嶅崟浼� 绌烘澘鍏ュ簱鍙�1
emptyInLargeSta[0]:
staNo: 292
@@ -280,9 +282,11 @@
# 鍏ュ簱鍙�1
inSta[0]:
staNo: 460
+ barcode: ${wcs-slave.barcode[3].id}
# 鍏ュ簱鍙�2
inSta[1]:
staNo: 453
+ barcode: ${wcs-slave.barcode[4].id}
# 鍏ョ~鍖栫綈RGV
enterRgv[0]:
rgvNo: 623
@@ -359,6 +363,26 @@
id: 5
ip: 10.10.10.52
port: 51236
+ # 鏉$爜鎵弿浠�
+ barcode[5]:
+ id: 6
+ ip: 10.10.10.52
+ port: 51236
+ # 鏉$爜鎵弿浠�
+ barcode[6]:
+ id: 7
+ ip: 10.10.10.52
+ port: 51236
+ # 鏉$爜鎵弿浠�
+ barcode[7]:
+ id: 8
+ ip: 10.10.10.52
+ port: 51236
+ # 鏉$爜鎵弿浠�
+ barcode[8]:
+ id: 9
+ ip: 10.10.10.52
+ port: 51236
# LED1
led[0]:
id: 1
diff --git a/src/main/resources/mapper/WrkMastMapper.xml b/src/main/resources/mapper/WrkMastMapper.xml
index e356371..6e11a13 100644
--- a/src/main/resources/mapper/WrkMastMapper.xml
+++ b/src/main/resources/mapper/WrkMastMapper.xml
@@ -91,6 +91,10 @@
select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
</select>
+ <select id="selectPakInStep111" resultMap="BaseResultMap">
+ select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and barcode=#{barcode} and ((io_type=202 and wrk_sts=51) or (io_type=1 and wrk_sts=2)) order by io_pri desc,io_time,wrk_no ASC
+ </select>
+
<select id="selectPakInStep11" resultMap="BaseResultMap">
select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=1 and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
</select>
--
Gitblit v1.9.1