From 7fef7f8c7007eee9a54c7f6255391f7e46885825 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期五, 12 十二月 2025 08:28:00 +0800
Subject: [PATCH] #AI
---
src/main/java/com/zy/core/ServerBootstrap.java | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index daa86a0..b0cb5a0 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -9,12 +9,14 @@
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.thread.impl.ZySiemensCrnThread;
+import com.zy.core.thread.impl.ZyStationThread;
+import com.zy.core.thread.impl.ZyRgvThread;
+
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.List;
@@ -32,7 +34,6 @@
@Autowired
private DeviceConfigService deviceConfigService;
- @PostConstruct
@Async
public void init() throws InterruptedException {
News.info("鏍稿績鎺у埗灞傚紑濮嬪垵濮嬪寲...............................................");
@@ -95,6 +96,36 @@
SlaveConnection.put(SlaveType.Crn, deviceConfig.getDeviceNo(), thread);
}
+ News.info("鍒濆鍖栬緭閫佺珯........................................................");
+ List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ .eq("device_type", String.valueOf(SlaveType.Devp)));
+ for (DeviceConfig deviceConfig : devpList) {
+ ThreadHandler thread = null;
+ if (deviceConfig.getThreadImpl().equals("ZyStationThread")) {
+ thread = new ZyStationThread(deviceConfig, redisUtil);
+ } else {
+ throw new CoolException("鏈煡鐨勭嚎绋嬪疄鐜�");
+ }
+
+ new Thread(thread).start();
+ SlaveConnection.put(SlaveType.Devp, deviceConfig.getDeviceNo(), thread);
+ }
+
+ News.info("鍒濆鍖朢GV........................................................");
+ List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ .eq("device_type", String.valueOf(SlaveType.Rgv)));
+ for (DeviceConfig deviceConfig : rgvList) {
+ ThreadHandler thread = null;
+ if (deviceConfig.getThreadImpl().equals("ZyRgvThread")) {
+ thread = new ZyRgvThread(deviceConfig, redisUtil);
+ } else {
+ throw new CoolException("鏈煡鐨勭嚎绋嬪疄鐜�");
+ }
+
+ new Thread(thread).start();
+ SlaveConnection.put(SlaveType.Rgv, deviceConfig.getDeviceNo(), thread);
+ }
+
}
--
Gitblit v1.9.1