From d37fe74580da2e3c4a8c07c4c0a560704b42cdb3 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 3 Jul 2024 16:05:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1015333 --user=宋昌昌 【测试计划】完成剩余功能 https://www.tapd.cn/55049933/s/1543354 --- .../controller/TestPlanReportController.java | 9 ++++++++ .../TestPlanReportShareController.java | 9 ++++++++ .../ExtTestPlanCaseExecuteHistoryMapper.java | 2 ++ .../ExtTestPlanCaseExecuteHistoryMapper.xml | 21 +++++++++++++++++++ .../plan/service/TestPlanReportService.java | 20 ++++++++++++++++++ .../TestPlanReportControllerTests.java | 11 ++++++++++ .../resources/dml/init_test_plan_report.sql | 7 ++++++- 7 files changed, 78 insertions(+), 1 deletion(-) 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 142343a059..4cbc2280d9 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 @@ -8,6 +8,7 @@ import io.metersphere.plan.constants.AssociateCaseType; import io.metersphere.plan.constants.TestPlanResourceConfig; import io.metersphere.plan.dto.ReportDetailCasePageDTO; import io.metersphere.plan.dto.request.*; +import io.metersphere.plan.dto.response.TestPlanCaseExecHistoryResponse; import io.metersphere.plan.dto.response.TestPlanReportDetailResponse; import io.metersphere.plan.dto.response.TestPlanReportPageResponse; import io.metersphere.plan.service.*; @@ -141,6 +142,14 @@ public class TestPlanReportController { return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailCases(request, AssociateCaseType.FUNCTIONAL)); } + @GetMapping("/detail/functional/case/step/{reportId}") + @Operation(summary = "测试计划-报告-详情-功能用例-执行步骤结果") + @RequiresPermissions(value = {PermissionConstants.TEST_PLAN_REPORT_READ, PermissionConstants.TEST_PLAN_READ_EXECUTE}, logical = Logical.OR) + @CheckOwner(resourceId = "#reportId", resourceType = "test_plan_case_execute_history") + public TestPlanCaseExecHistoryResponse getFunctionalExecuteResult(@PathVariable String reportId) { + return testPlanReportService.getFunctionalExecuteResult(reportId); + } + @PostMapping("/detail/api/case/page") @Operation(summary = "测试计划-报告-详情-接口用例分页查询") @RequiresPermissions(value = {PermissionConstants.TEST_PLAN_REPORT_READ, PermissionConstants.TEST_PLAN_READ_EXECUTE}, logical = Logical.OR) 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 60cf4b74d0..9062299ce6 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 @@ -14,6 +14,7 @@ import io.metersphere.plan.dto.ReportDetailCasePageDTO; 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.TestPlanReportDetailResponse; import io.metersphere.plan.dto.response.TestPlanShareResponse; import io.metersphere.plan.service.TestPlanReportService; @@ -163,4 +164,12 @@ public class TestPlanReportShareController { testPlanReportShareService.validateExpired(shareInfo); return apiScenarioReportService.getDetail(reportId, stepId); } + + @GetMapping("/detail/functional/case/step/{shareId}/{reportId}") + @Operation(summary = "测试计划-报告-详情-功能用例-执行步骤结果") + public TestPlanCaseExecHistoryResponse getFunctionalExecuteResult(@PathVariable String shareId, @PathVariable String reportId) { + ShareInfo shareInfo = testPlanReportShareService.checkResource(shareId); + testPlanReportShareService.validateExpired(shareInfo); + return testPlanReportService.getFunctionalExecuteResult(reportId); + } } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java index 98a7aa5211..189d7334bc 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java @@ -14,4 +14,6 @@ public interface ExtTestPlanCaseExecuteHistoryMapper { List getCaseExecHistory(@Param("request") TestPlanCaseExecHistoryRequest request); List selectSteps(@Param("testPlanCaseId") String testPlanCaseId, @Param("caseId") String caseId); + + TestPlanCaseExecHistoryResponse getSingleExecHistory(@Param("id") String id); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml index d37ffef962..74bd11c9fe 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml @@ -37,6 +37,27 @@ tpceh.create_time DESC + +