diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java index b38cd6c9de..f1cb0d0d44 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java @@ -90,6 +90,14 @@ public class TestPlanReportController { testPlanReportService.batchSetReportDelete(request, SessionUtils.getUserId()); } + @PostMapping("/batch-param") + @Operation(summary = "测试计划-报告-获取批量参数") + @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) + @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") + public List getBatchParam(@Validated @RequestBody TestPlanReportBatchRequest request) { + return testPlanReportService.getBatchIds(request); + } + @PostMapping("/manual-gen") @Operation(summary = "测试计划-详情-手动生成报告") @RequiresPermissions(PermissionConstants.TEST_PLAN_READ_EXECUTE) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java index c17c7fb8bf..66c0095ff2 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java @@ -16,6 +16,7 @@ import io.metersphere.plan.dto.TestPlanShareInfo; import io.metersphere.plan.dto.request.TestPlanReportShareRequest; import io.metersphere.plan.dto.request.TestPlanShareReportDetailRequest; import io.metersphere.plan.dto.response.TestPlanCaseExecHistoryResponse; +import io.metersphere.plan.dto.response.TestPlanReportDetailCollectionResponse; import io.metersphere.plan.dto.response.TestPlanReportDetailResponse; import io.metersphere.plan.dto.response.TestPlanShareResponse; import io.metersphere.plan.service.TestPlanReportService; @@ -27,6 +28,8 @@ import io.metersphere.system.utils.PageUtils; import io.metersphere.system.utils.Pager; import io.metersphere.system.utils.SessionUtils; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.apache.commons.lang3.StringUtils; @@ -181,4 +184,15 @@ public class TestPlanReportShareController { testPlanReportShareService.validateExpired(shareInfo); return testPlanReportService.getFunctionalExecuteResult(reportId); } + + @PostMapping("/detail/{type}/collection/page") + @Operation(summary = "测试计划-报告-详情-测试集分页查询(不同用例类型)") + @Parameter(name = "type", description = "用例类型", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED), example = "functional, api, scenario") + public Pager> collectionPage(@PathVariable String type, @Validated @RequestBody TestPlanShareReportDetailRequest request) { + ShareInfo shareInfo = testPlanReportShareService.checkResource(request.getShareId()); + testPlanReportShareService.validateExpired(shareInfo); + Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), + StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tpc.pos desc"); + return PageUtils.setPageInfo(page, testPlanReportService.listReportCollection(request, type)); + } } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java index 0fad7b342d..1cad84e7fa 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java @@ -951,7 +951,7 @@ public class TestPlanReportService { * @param request 请求参数 * @return ID集合 */ - private List getBatchIds(TestPlanReportBatchRequest request) { + public List getBatchIds(TestPlanReportBatchRequest request) { if (request.isSelectAll()) { List batchIds = extTestPlanReportMapper.getReportBatchIdsByParam(request); if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {