From 8e13d5a26f6cb6f981b31799e43330f40c791192 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期四, 03 九月 2026 23:39:01 +0800
Subject: [PATCH] 停止后隐藏实时预警并补充完成态测试

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestLiveServiceImpl.java |    3 ++-
 1 files changed, 2 insertions(+), 1 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 50401a0..6345a50 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
@@ -68,7 +68,8 @@
                     .map(source -> Map.<String, Object>of("sourceType", source.sourceType(), "sourceId", source.sourceId(),
                             "batteryNo", source.batteryNo(), "status", source.deviceStatus(), "message", "数据来源当前不可观测"))
                     .toList());
-        if (mapper != null) {
+        // 完成或暂停后只保留历史异常事实,实时控制台不再展示开放预警。
+        if (receiving && mapper != null) {
             mapper.selectWarningExceptions(testId, "OPEN").forEach(item -> exceptions.add(Map.of(
                     "exceptionId", item.getExceptionId(), "sourceType", item.getSourceType(),
                     "metricCode", item.getMetricCode(), "value", item.getAbnormalValue(), "unit", item.getUnit(),

--
Gitblit v1.7.1