From 6b9019956913fc47499ba185beedf4370bb5354c Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期四, 03 九月 2026 23:25:01 +0800
Subject: [PATCH] 修正实时设备连接状态与异常展示

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestLiveServiceImpl.java |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestLiveServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestLiveServiceImpl.java
index d59699b..50401a0 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestLiveServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestLiveServiceImpl.java
@@ -64,8 +64,7 @@
         List<Map<String, Object>> exceptions = new ArrayList<>();
         if (receiving)
             exceptions.addAll(sources.stream().filter(source -> !"COLLECTOR".equals(source.sourceType())
-                    && !"ONLINE".equals(source.deviceStatus())
-                    && !"WORKING".equals(source.deviceStatus()) && !"PAUSED".equals(source.deviceStatus()))
+                    && "OFFLINE".equals(source.deviceStatus()))
                     .map(source -> Map.<String, Object>of("sourceType", source.sourceType(), "sourceId", source.sourceId(),
                             "batteryNo", source.batteryNo(), "status", source.deviceStatus(), "message", "数据来源当前不可观测"))
                     .toList());
@@ -169,9 +168,9 @@
                     && Objects.equals(channel.identity().subdevid(), binding.getSubdevid())
                     && Objects.equals(channel.identity().chlid(), binding.getChlid()))
                 return new LiveSource("CABINET_CHANNEL", binding.getChannelId(), battery.getBatteryNo(),
-                        channel.online() ? channel.workStatus().name() : "OFFLINE",
+                        channel.online() ? "ONLINE" : "OFFLINE",
                         channel.online() ? snapshot(channel) : Map.of());
-        return new LiveSource("CABINET_CHANNEL", binding.getChannelId(), battery.getBatteryNo(), "UNKNOWN", Map.of());
+        return new LiveSource("CABINET_CHANNEL", binding.getChannelId(), battery.getBatteryNo(), "OFFLINE", Map.of());
     }
 
     private Map<String, Object> snapshot(ChannelCandidate channel)
@@ -217,7 +216,7 @@
             return new LiveSource("COLLECTOR", (long) collector.collectorId(), battery.getBatteryNo(),
                     collector.online() ? "ONLINE" : "OFFLINE", collector.online() ? value : Map.of());
         }
-        return new LiveSource("COLLECTOR", battery.getCollectorId(), battery.getBatteryNo(), "UNKNOWN", Map.of());
+        return new LiveSource("COLLECTOR", battery.getCollectorId(), battery.getBatteryNo(), "OFFLINE", Map.of());
     }
 
     @PreDestroy void shutdown() { scheduler.shutdownNow(); }

--
Gitblit v1.7.1