From 656cdaf4463b41a168adb83ccc05d8c2f03d4d78 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期四, 27 八月 2026 21:43:20 +0800
Subject: [PATCH] fix(test): allow plan steps after creation

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

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestServiceImpl.java
index 6a30d81..05d2381 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestServiceImpl.java
@@ -220,6 +220,8 @@
 
     private void validateConfiguration(TTest test)
     {
+        // 新建测试只建立业务身份和通道关系,计划工步可在开始监测前补充。
+        if (test.getPlanSteps() == null) test.setPlanSteps(new ArrayList<>());
         validateBatteries(test.getBatteries());
         validatePlanSteps(test.getPlanSteps());
         validateThresholds(test.getThresholds());
@@ -271,7 +273,7 @@
 
     private void validatePlanSteps(List<TTestPlanStep> planSteps)
     {
-        if (planSteps == null || planSteps.isEmpty()) throw new ServiceException("计划工步不能为空");
+        if (planSteps.isEmpty()) return;
         Set<String> identities = new HashSet<>();
         Set<Integer> orders = new HashSet<>();
         for (TTestPlanStep step : planSteps)

--
Gitblit v1.7.1