From 307be50c144c92afade80ffdec9279617235f42e Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 3 Jul 2024 15:21:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83=E6=94=AF=E6=8C=81=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E7=BB=84=E7=88=B6=E5=AD=90=E5=B1=82=E7=BA=A7=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1015333 --user=宋昌昌 【测试计划】完成剩余功能 https://www.tapd.cn/55049933/s/1543343 --- .../system/dto/taskcenter/TaskCenterDTO.java | 6 ++++ .../plan/mapper/ExtTestPlanReportMapper.java | 2 ++ .../plan/mapper/ExtTestPlanReportMapper.xml | 35 +++++++++++++++++- .../plan/service/TestPlanService.java | 4 +-- .../service/TestPlanTaskCenterService.java | 36 ++++++++++++------- .../TestPlanTaskCenterControllerTests.java | 12 ------- .../src/test/resources/dml/init_task_plan.sql | 4 ++- 7 files changed, 70 insertions(+), 29 deletions(-) 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 3bf4536104..182a474b5e 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,6 +5,8 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * @author: LAN @@ -66,5 +68,9 @@ public class TaskCenterDTO implements Serializable { @Schema(description = "执行历史是否被清理") private boolean historyDeleted = false; + @Schema(description = "计划组ID") + private String parentId; + @Schema(description = "计划组子任务") + private List children = new ArrayList<>(); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java index 0da2d3a182..ae77a7164d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java @@ -47,6 +47,8 @@ public interface ExtTestPlanReportMapper { List taskCenterlist(@Param("request") TaskCenterPageRequest request, @Param("projectIds") List projectIds, @Param("startTime") long startTime, @Param("endTime") long endTime); + List getChildTaskCenter(@Param("ids") List groupReportIds); + List getPlanReportListById(@Param("request") TestPlanReportDetailPageRequest request); List getReports(@Param("request") TaskCenterBatchRequest request, @Param("projectIds") List projectIds, 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 dc0b7dc379..ded8ce65b1 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 @@ -70,8 +70,8 @@ tpr.create_user AS operationName, tpr.trigger_mode, tpr.start_time, + '' as parentId, project.organization_id, - tp.num AS resourceNum, tp.name AS resourceName, tp.id AS resourceId @@ -81,6 +81,8 @@ left join project on tpr.project_id = project.id where tpr.start_time BETWEEN #{startTime} AND #{endTime} + + and tpr.id = tpr.parent_id and tpr.project_id IN @@ -96,6 +98,37 @@ + + +