From 123a17c9d50745ea609f91943adca64e5ed12355 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期六, 12 四月 2025 09:08:14 +0800
Subject: [PATCH] 1
---
src/main/java/com/zy/core/thread/impl/FyDevpThread.java | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/FyDevpThread.java b/src/main/java/com/zy/core/thread/impl/FyDevpThread.java
index 3625152..6ec89a1 100644
--- a/src/main/java/com/zy/core/thread/impl/FyDevpThread.java
+++ b/src/main/java/com/zy/core/thread/impl/FyDevpThread.java
@@ -78,7 +78,7 @@
@Override
@SuppressWarnings("InfiniteLoopStatement")
public void run() {
-// connect();
+ connect();
while (true) {
try {
int step = 1;
@@ -185,14 +185,21 @@
OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛", DateUtils.convert(new Date()), slave.getId()));
// 鏍规嵁瀹炴椂淇℃伅鏇存柊鏁版嵁搴�
try {
+ BasDevpService basConveyorStaService = SpringUtils.getBean(BasDevpService.class);
+
List<BasDevp> stations = new ArrayList<>();
for (Integer sta : staNos2) {
StaProtocol staProtocol = station.get(sta);
BasDevp sqlModel = staProtocol.toSqlModel();
stations.add(sqlModel);
+
+ //鏆傛椂鍐欏叆鏁版嵁搴�
+ BasDevp basDevp = basConveyorStaService.selectById(sta);
+ if (basDevp == null) {
+ basConveyorStaService.insert(sqlModel);
+ }
}
if (!stations.isEmpty()) {
- BasDevpService basConveyorStaService = SpringUtils.getBean(BasDevpService.class);
if (null != basConveyorStaService && !basConveyorStaService.updateBatchById(stations)) {
throw new Exception("鏇存柊鏁版嵁搴撴暟鎹け璐�");
}
--
Gitblit v1.9.1