From d89b550c50c9425842869cfd01a54a3a455c45ec Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 12 Jun 2024 14:16:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E8=84=91=E5=9B=BE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/dto/TestPlanCollectionMinderEditDTO.java | 4 ++-- .../plan/dto/TestPlanCollectionMinderTreeNodeDTO.java | 4 ++-- .../plan/service/TestPlanCollectionMinderService.java | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderEditDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderEditDTO.java index 1645220fe6..f3d14a4a82 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderEditDTO.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderEditDTO.java @@ -33,7 +33,7 @@ public class TestPlanCollectionMinderEditDTO implements Serializable { @NotBlank(message = "{test_plan_collection.execute_method.not_blank}") private String executeMethod; - @Schema(description = "测试集类型(功能:FUNCTIONAL_CASE/接口用例:API_CASE/场景:SCENARIO_CASE)", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "测试集类型(功能:FUNCTIONAL/接口用例:API/场景:SCENARIO)", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_plan_collection_minder_edit.collection_type.not_blank}") private String collectionType; @@ -43,7 +43,7 @@ public class TestPlanCollectionMinderEditDTO implements Serializable { @Schema(description = "是否使用环境组", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "{test_plan_collection.grouped.not_blank}") - private Boolean grouped; + private Boolean grouped = false; @Schema(description = "环境ID/环境组ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_plan_collection.environment_id.not_blank}") diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderTreeNodeDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderTreeNodeDTO.java index cd4ab7fa70..cd2ffb3076 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderTreeNodeDTO.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanCollectionMinderTreeNodeDTO.java @@ -23,7 +23,7 @@ public class TestPlanCollectionMinderTreeNodeDTO { private int num; @Schema(description = "串并行") - private int priority; + private Integer priority; @Schema(description = "串并行值") private String executeMethod; @@ -41,7 +41,7 @@ public class TestPlanCollectionMinderTreeNodeDTO { private Boolean extended; @Schema(description = "是否使用环境组", requiredMode = Schema.RequiredMode.REQUIRED) - private Boolean grouped; + private Boolean grouped = false; @Schema(description = "环境ID/环境组ID", requiredMode = Schema.RequiredMode.REQUIRED) private String environmentId; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java index b490a26e7f..551fc9160d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java @@ -104,6 +104,9 @@ public class TestPlanCollectionMinderService { } else { typeTreeNodeDTO.setPriority(3); } + if (StringUtils.equalsIgnoreCase(CaseType.FUNCTIONAL_CASE.getKey(),testPlanCollection.getType())) { + typeTreeNodeDTO.setPriority(null); + } return typeTreeNodeDTO; } @@ -209,7 +212,7 @@ public class TestPlanCollectionMinderService { buildChild(countTreeNodeDTO, count + Translator.get("test_plan.mind.strip"), "test_plan.mind.case_count", countTreeDTO, endList); TestPlanCollectionMinderTreeDTO envTreeDTO = new TestPlanCollectionMinderTreeDTO(); TestPlanCollectionMinderTreeNodeDTO envTreeNodeDTO = new TestPlanCollectionMinderTreeNodeDTO(); - buildChild(envTreeNodeDTO, planCollection.getEnvName(), "test_plan.mind.environment", envTreeDTO, endList); + buildChild(envTreeNodeDTO, StringUtils.equalsIgnoreCase(planCollection.getEnvironmentId(),ModuleConstants.ROOT_NODE_PARENT_ID) ? Translator.get("api_report_default_env") : planCollection.getEnvName() , "test_plan.mind.environment", envTreeDTO, endList); TestPlanCollectionMinderTreeDTO poolTreeDTO = new TestPlanCollectionMinderTreeDTO(); TestPlanCollectionMinderTreeNodeDTO poolTreeNodeDTO = new TestPlanCollectionMinderTreeNodeDTO(); buildChild(poolTreeNodeDTO, planCollection.getPoolName(), "test_plan.mind.test_resource_pool", poolTreeDTO, endList);