diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java index 182a474b5e..8dff30743a 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java @@ -5,7 +5,6 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; -import java.util.ArrayList; import java.util.List; /** @@ -69,8 +68,8 @@ public class TaskCenterDTO implements Serializable { private boolean historyDeleted = false; @Schema(description = "计划组ID") - private String parentId; + private String parent; @Schema(description = "计划组子任务") - private List children = new ArrayList<>(); + private List children; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml index ded8ce65b1..64c9250c13 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml @@ -61,7 +61,7 @@ select - distinct tpr.id, + tpr.id, tpr.project_id, tpr.integrated, tpr.result_status as status, @@ -110,7 +110,7 @@ tpr.create_user as operationName, tpr.trigger_mode, tpr.start_time, - tpr.parent_id as parentId, + tpr.parent_id as parent, project.organization_id, tp.num as resourceNum, tp.name as resourceName, diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java index f9c61e021b..d5b60fcec1 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanTaskCenterService.java @@ -133,12 +133,8 @@ public class TestPlanTaskCenterService { List groupReportIds = list.stream().filter(TaskCenterDTO::isIntegrated).map(TaskCenterDTO::getId).toList(); if (CollectionUtils.isNotEmpty(groupReportIds)) { List childTaskCenterList = extTestPlanReportMapper.getChildTaskCenter(groupReportIds); - Map> childTaskMap = childTaskCenterList.stream().collect(Collectors.groupingBy(TaskCenterDTO::getParentId)); - list.forEach(item -> { - if (CollectionUtils.isNotEmpty(childTaskMap.get(item.getId()))) { - item.setChildren(childTaskMap.get(item.getId())); - } - }); + Map> childTaskMap = childTaskCenterList.stream().collect(Collectors.groupingBy(TaskCenterDTO::getParent)); + list.forEach(item -> item.setChildren(childTaskMap.get(item.getId()))); } // 执行历史列表