From de5451b006f1d2f3632b03ab41f8ebee1551437d Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 10 九月 2024 16:33:01 +0800
Subject: [PATCH] #fs
---
src/main/java/com/zy/core/thread/SiemensDevpThread.java | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index f005729..ebce4ea 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -375,6 +375,21 @@
}
}
+ if (slave.getId()==2){
+ OperateResultExOne<byte[]> result464 = siemensS7Net.Read("DB101.3720",(short)(8));
+ if (result464.IsSuccess) {
+ String barcode = siemensS7Net.getByteTransform().TransString(result464.Content,0,8, "UTF-8");
+ BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 11);
+ if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
+ StaProtocol staProtocol = station.get(464);
+ if (null != staProtocol) {
+ staProtocol.setBarcode(barcode);
+ barcodeThread.setBarcode(barcode);
+ }
+ }
+ }
+ }
+
// //RGV灏忚溅
// Thread.sleep(200);
// OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2);
@@ -401,9 +416,13 @@
basDevps.add(staProtocol.toSqlModel());
}
- BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
- if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) {
- throw new Exception("鏇存柊鏁版嵁搴撴暟鎹け璐�");
+ try{
+ BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
+ if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) {
+ throw new Exception("鏇存柊鏁版嵁搴撴暟鎹け璐�");
+ }
+ } catch (Exception e){
+ log.error("鏇存柊鏁版嵁搴撴暟鎹け璐� ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
}
} catch (Exception e) {
e.printStackTrace();
--
Gitblit v1.9.1