From 30ae2bc8dae7b26fd297760f1ca0b26ffe7afa21 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 19 Jun 2024 10:30:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4=E6=A8=A1=E5=9D=97=E7=9A=84?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/service/TestPlanService.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java index 60651bb364..9169c98dd6 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -131,7 +131,7 @@ public class TestPlanService extends TestPlanBaseUtilsService { && !StringUtils.equalsIgnoreCase(createOrCopyRequest.getGroupId(), TestPlanConstants.TEST_PLAN_DEFAULT_GROUP_ID)) { throw new MSException(Translator.get("test_plan.group.error")); } - + TestPlan createTestPlan = new TestPlan(); BeanUtils.copyBean(createTestPlan, createOrCopyRequest); validateTestPlanGroup(createTestPlan.getGroupId(), 1); @@ -485,6 +485,8 @@ public class TestPlanService extends TestPlanBaseUtilsService { TestPlanModule module = testPlanModuleMapper.selectByPrimaryKey(testPlan.getModuleId()); moduleName = module == null ? Translator.get("unplanned.plan") : module.getName(); response.setModuleId(module == null ? ModuleConstants.DEFAULT_NODE_ID : module.getId()); + } else { + response.setModuleId(ModuleConstants.DEFAULT_NODE_ID); } //计划组只有几个参数 @@ -527,7 +529,8 @@ public class TestPlanService extends TestPlanBaseUtilsService { /** * 关联的资源初始化默认测试集 - * @param planId 计划ID + * + * @param planId 计划ID * @param allCollections 测试集 */ @Async @@ -605,10 +608,10 @@ public class TestPlanService extends TestPlanBaseUtilsService { /** * 批量移动 (计划/计划组) * - * @param request 批量请求参数 - * @param userId 当前登录用户 - * @param operationUrl 请求URL - * @param method 请求方法 + * @param request 批量请求参数 + * @param userId 当前登录用户 + * @param operationUrl 请求URL + * @param method 请求方法 */ public long batchMove(TestPlanBatchRequest request, String userId, String operationUrl, String method) { // 目前计划的批量操作不支持全选所有页 @@ -902,7 +905,7 @@ public class TestPlanService extends TestPlanBaseUtilsService { /** * 初始化测试规划默认节点 * - * @param planId 计划ID + * @param planId 计划ID * @param currentUser 当前用户 */ public List initDefaultPlanCollection(String planId, String currentUser) { @@ -953,7 +956,7 @@ public class TestPlanService extends TestPlanBaseUtilsService { BeanUtils.copyBean(childCollectionDTO, childCollection); parentCollectionDTO.setChildren(List.of(childCollectionDTO)); // 更新pos - initPos ++; + initPos++; collectionDTOS.add(parentCollectionDTO); }