From c8de85433e5800a7b5595a96d99f4b49f24c38b4 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期二, 16 十二月 2025 13:11:23 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/ServerBootstrap.java |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index b0cb5a0..dcf52e6 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -131,6 +131,30 @@
 
     @PreDestroy
     public void destroy() {
+        try {
+            List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+                    .eq("device_type", String.valueOf(SlaveType.Crn)));
+            for (DeviceConfig deviceConfig : crnList) {
+                SlaveConnection.remove(SlaveType.Crn, deviceConfig.getDeviceNo());
+            }
+        } catch (Exception ignore) {}
+        try {
+            List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+                    .eq("device_type", String.valueOf(SlaveType.Devp)));
+            for (DeviceConfig deviceConfig : devpList) {
+                SlaveConnection.remove(SlaveType.Devp, deviceConfig.getDeviceNo());
+            }
+        } catch (Exception ignore) {}
+        try {
+            List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+                    .eq("device_type", String.valueOf(SlaveType.Rgv)));
+            for (DeviceConfig deviceConfig : rgvList) {
+                SlaveConnection.remove(SlaveType.Rgv, deviceConfig.getDeviceNo());
+            }
+        } catch (Exception ignore) {}
+        try {
+            mainProcess.shutDown();
+        } catch (Exception ignore) {}
     }
 
 

--
Gitblit v1.9.1