From a4f07b2a0ddb6c210e05afbbb491feeb466203e7 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 09 三月 2026 19:15:50 +0800
Subject: [PATCH] #V3重大更新,升级JDK17,升级SpirngBoot3.5.1
---
src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java b/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
index 563ba3e..2ec6539 100644
--- a/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
@@ -3,7 +3,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
@@ -47,6 +47,7 @@
private RedisUtil redisUtil;
private ZyStationConnectDriver zyStationConnectDriver;
private int deviceLogCollectTime = 200;
+ private boolean initStatus = false;
private long deviceDataLogTime = System.currentTimeMillis();
private ExecutorService executor = Executors.newFixedThreadPool(9999);
@@ -64,14 +65,16 @@
Thread readThread = new Thread(() -> {
while (true) {
try {
- deviceLogCollectTime = Utils.getDeviceLogCollectTime();
+ if (initStatus) {
+ deviceLogCollectTime = Utils.getDeviceLogCollectTime();
+ }
readStatus();
Thread.sleep(100);
} catch (Exception e) {
log.error("StationV4Thread Fail", e);
}
}
- });
+ }, "DevpRead-" + deviceConfig.getDeviceNo());
readThread.start();
Thread processThread = new Thread(() -> {
@@ -91,7 +94,7 @@
log.error("StationV4Process Fail", e);
}
}
- });
+ }, "DevpProcess-" + deviceConfig.getDeviceNo());
processThread.start();
}
@@ -111,7 +114,7 @@
}
BasDevp basDevp = basDevpService
- .selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo()));
+ .getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo()));
if (basDevp == null) {
return;
}
@@ -122,6 +125,7 @@
stationProtocol.setStationId(entity.getStationId());
statusList.add(stationProtocol);
}
+ initStatus = true;
}
List<ZyStationStatusEntity> zyStationStatusEntities = zyStationConnectDriver.getStatus();
@@ -273,7 +277,7 @@
JSON.toJSONString(commandResponse)
);
if (optService != null) {
- optService.insert(basStationOpt);
+ optService.save(basStationOpt);
}
}
return commandResponse;
@@ -302,6 +306,18 @@
List<Integer> path = JSON.parseArray(JSON.toJSONString(original.getNavigatePath(), SerializerFeature.DisableCircularReferenceDetect), Integer.class);
List<Integer> liftTransferPath = JSON.parseArray(JSON.toJSONString(original.getLiftTransferPath(), SerializerFeature.DisableCircularReferenceDetect), Integer.class);
if (path == null || path.isEmpty()) {
+ // 鍚岀珯鐐逛换鍔′笉浼氱敓鎴愯矾寰勶紝浣嗕粛闇�涓嬪彂鍛戒护鍐欏叆浠诲姟鏁版嵁
+ if (Objects.equals(original.getStationId(), original.getTargetStaNo())) {
+ while (true) {
+ CommandResponse commandResponse = sendCommand(original);
+ if (commandResponse != null && commandResponse.getResult()) {
+ break;
+ }
+ try {
+ Thread.sleep(200);
+ } catch (Exception ignore) {}
+ }
+ }
return;
}
@@ -441,7 +457,7 @@
if (deviceConfigService == null) {
return null;
}
- List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>()
.eq("device_type", String.valueOf(SlaveType.Devp)));
for (DeviceConfig dc : devpList) {
com.zy.core.thread.StationThread t = (com.zy.core.thread.StationThread) SlaveConnection.get(SlaveType.Devp, dc.getDeviceNo());
--
Gitblit v1.9.1