From a5f5493e8e0b1b74392df4b536f4e143e6f295e5 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Fri, 17 May 2024 16:34:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8A=A5=E5=91=8A=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/domain/TestPlanReportBug.java | 38 +- .../plan/domain/TestPlanReportBugExample.java | 270 ++++++++++ .../domain/TestPlanReportFunctionCase.java | 36 +- .../TestPlanReportFunctionCaseExample.java | 466 ++++++++++++++++-- .../plan/mapper/TestPlanReportBugMapper.java | 8 + .../plan/mapper/TestPlanReportBugMapper.xml | 124 ++++- .../TestPlanReportFunctionCaseMapper.xml | 158 +++++- .../3.0.0/ddl/V3.0.0_12__beta_ddl.sql | 14 +- .../controller/TestPlanReportController.java | 23 +- .../plan/dto/ReportDetailCasePageDTO.java | 46 ++ .../TestPlanReportDetailEditRequest.java | 16 + .../TestPlanReportDetailPageRequest.java | 4 - .../TestPlanReportDetailResponse.java | 2 + .../mapper/ExtTestPlanReportBugMapper.java | 25 + .../mapper/ExtTestPlanReportBugMapper.xml | 17 + ...ExtTestPlanReportFunctionalCaseMapper.java | 43 ++ .../ExtTestPlanReportFunctionalCaseMapper.xml | 50 ++ .../plan/mapper/ExtTestPlanReportMapper.java | 38 +- .../plan/mapper/ExtTestPlanReportMapper.xml | 23 - .../plan/service/TestPlanReportService.java | 123 +++-- .../service/TestPlanStatisticsService.java | 14 +- .../plan/utils/RateCalculateUtils.java | 39 ++ .../TestPlanReportControllerTests.java | 12 +- 23 files changed, 1372 insertions(+), 217 deletions(-) create mode 100644 backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java create mode 100644 backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailEditRequest.java create mode 100644 backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java create mode 100644 backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml create mode 100644 backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.java create mode 100644 backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml create mode 100644 backend/services/test-plan/src/main/java/io/metersphere/plan/utils/RateCalculateUtils.java diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBug.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBug.java index 41cd35faa7..768451446c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBug.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBug.java @@ -1,6 +1,11 @@ package io.metersphere.plan.domain; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; import java.io.Serializable; @@ -9,21 +14,46 @@ import java.util.Arrays; @Data public class TestPlanReportBug implements Serializable { - @Schema(description = "ID") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_bug.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{test_plan_report_bug.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "报告ID") + @Schema(description = "测试计划报告ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_bug.test_plan_report_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{test_plan_report_bug.test_plan_report_id.length_range}", groups = {Created.class, Updated.class}) private String testPlanReportId; - @Schema(description = "缺陷ID") + @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_bug.bug_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{test_plan_report_bug.bug_id.length_range}", groups = {Created.class, Updated.class}) private String bugId; + @Schema(description = "缺陷业务ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{test_plan_report_bug.bug_num.not_blank}", groups = {Created.class}) + private Long bugNum; + + @Schema(description = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_bug.bug_title.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{test_plan_report_bug.bug_title.length_range}", groups = {Created.class, Updated.class}) + private String bugTitle; + + @Schema(description = "缺陷状态") + private String bugStatus; + + @Schema(description = "缺陷处理人") + private String bugHandleUser; + private static final long serialVersionUID = 1L; public enum Column { id("id", "id", "VARCHAR", false), testPlanReportId("test_plan_report_id", "testPlanReportId", "VARCHAR", false), - bugId("bug_id", "bugId", "VARCHAR", false); + bugId("bug_id", "bugId", "VARCHAR", false), + bugNum("bug_num", "bugNum", "BIGINT", false), + bugTitle("bug_title", "bugTitle", "VARCHAR", false), + bugStatus("bug_status", "bugStatus", "VARCHAR", false), + bugHandleUser("bug_handle_user", "bugHandleUser", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBugExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBugExample.java index c04d212424..14d14925cc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBugExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportBugExample.java @@ -313,6 +313,276 @@ public class TestPlanReportBugExample { addCriterion("bug_id not between", value1, value2, "bugId"); return (Criteria) this; } + + public Criteria andBugNumIsNull() { + addCriterion("bug_num is null"); + return (Criteria) this; + } + + public Criteria andBugNumIsNotNull() { + addCriterion("bug_num is not null"); + return (Criteria) this; + } + + public Criteria andBugNumEqualTo(Long value) { + addCriterion("bug_num =", value, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumNotEqualTo(Long value) { + addCriterion("bug_num <>", value, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumGreaterThan(Long value) { + addCriterion("bug_num >", value, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumGreaterThanOrEqualTo(Long value) { + addCriterion("bug_num >=", value, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumLessThan(Long value) { + addCriterion("bug_num <", value, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumLessThanOrEqualTo(Long value) { + addCriterion("bug_num <=", value, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumIn(List values) { + addCriterion("bug_num in", values, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumNotIn(List values) { + addCriterion("bug_num not in", values, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumBetween(Long value1, Long value2) { + addCriterion("bug_num between", value1, value2, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugNumNotBetween(Long value1, Long value2) { + addCriterion("bug_num not between", value1, value2, "bugNum"); + return (Criteria) this; + } + + public Criteria andBugTitleIsNull() { + addCriterion("bug_title is null"); + return (Criteria) this; + } + + public Criteria andBugTitleIsNotNull() { + addCriterion("bug_title is not null"); + return (Criteria) this; + } + + public Criteria andBugTitleEqualTo(String value) { + addCriterion("bug_title =", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleNotEqualTo(String value) { + addCriterion("bug_title <>", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleGreaterThan(String value) { + addCriterion("bug_title >", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleGreaterThanOrEqualTo(String value) { + addCriterion("bug_title >=", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleLessThan(String value) { + addCriterion("bug_title <", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleLessThanOrEqualTo(String value) { + addCriterion("bug_title <=", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleLike(String value) { + addCriterion("bug_title like", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleNotLike(String value) { + addCriterion("bug_title not like", value, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleIn(List values) { + addCriterion("bug_title in", values, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleNotIn(List values) { + addCriterion("bug_title not in", values, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleBetween(String value1, String value2) { + addCriterion("bug_title between", value1, value2, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugTitleNotBetween(String value1, String value2) { + addCriterion("bug_title not between", value1, value2, "bugTitle"); + return (Criteria) this; + } + + public Criteria andBugStatusIsNull() { + addCriterion("bug_status is null"); + return (Criteria) this; + } + + public Criteria andBugStatusIsNotNull() { + addCriterion("bug_status is not null"); + return (Criteria) this; + } + + public Criteria andBugStatusEqualTo(String value) { + addCriterion("bug_status =", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusNotEqualTo(String value) { + addCriterion("bug_status <>", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusGreaterThan(String value) { + addCriterion("bug_status >", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusGreaterThanOrEqualTo(String value) { + addCriterion("bug_status >=", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusLessThan(String value) { + addCriterion("bug_status <", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusLessThanOrEqualTo(String value) { + addCriterion("bug_status <=", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusLike(String value) { + addCriterion("bug_status like", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusNotLike(String value) { + addCriterion("bug_status not like", value, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusIn(List values) { + addCriterion("bug_status in", values, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusNotIn(List values) { + addCriterion("bug_status not in", values, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusBetween(String value1, String value2) { + addCriterion("bug_status between", value1, value2, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugStatusNotBetween(String value1, String value2) { + addCriterion("bug_status not between", value1, value2, "bugStatus"); + return (Criteria) this; + } + + public Criteria andBugHandleUserIsNull() { + addCriterion("bug_handle_user is null"); + return (Criteria) this; + } + + public Criteria andBugHandleUserIsNotNull() { + addCriterion("bug_handle_user is not null"); + return (Criteria) this; + } + + public Criteria andBugHandleUserEqualTo(String value) { + addCriterion("bug_handle_user =", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserNotEqualTo(String value) { + addCriterion("bug_handle_user <>", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserGreaterThan(String value) { + addCriterion("bug_handle_user >", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserGreaterThanOrEqualTo(String value) { + addCriterion("bug_handle_user >=", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserLessThan(String value) { + addCriterion("bug_handle_user <", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserLessThanOrEqualTo(String value) { + addCriterion("bug_handle_user <=", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserLike(String value) { + addCriterion("bug_handle_user like", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserNotLike(String value) { + addCriterion("bug_handle_user not like", value, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserIn(List values) { + addCriterion("bug_handle_user in", values, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserNotIn(List values) { + addCriterion("bug_handle_user not in", values, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserBetween(String value1, String value2) { + addCriterion("bug_handle_user between", value1, value2, "bugHandleUser"); + return (Criteria) this; + } + + public Criteria andBugHandleUserNotBetween(String value1, String value2) { + addCriterion("bug_handle_user not between", value1, value2, "bugHandleUser"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java index 8f68561669..bf49cf5c85 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java @@ -4,6 +4,7 @@ import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import lombok.Data; @@ -33,10 +34,31 @@ public class TestPlanReportFunctionCase implements Serializable { @Size(min = 1, max = 50, message = "{test_plan_report_function_case.function_case_id.length_range}", groups = {Created.class, Updated.class}) private String functionCaseId; + @Schema(description = "功能用例业务ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{test_plan_report_function_case.function_case_num.not_blank}", groups = {Created.class}) + private Long functionCaseNum; + + @Schema(description = "功能用例名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_function_case.function_case_name.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{test_plan_report_function_case.function_case_name.length_range}", groups = {Created.class, Updated.class}) + private String functionCaseName; + + @Schema(description = "功能用例所属模块") + private String functionCaseModule; + + @Schema(description = "功能用例用例等级") + private String functionCasePriority; + + @Schema(description = "功能用例执行人") + private String functionCaseExecuteUser; + + @Schema(description = "功能用例关联缺陷数") + private String functionCaseBugCount; + @Schema(description = "执行结果", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_report_function_case.execute_result.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{test_plan_report_function_case.execute_result.length_range}", groups = {Created.class, Updated.class}) - private String executeResult; + @NotBlank(message = "{test_plan_report_function_case.function_case_execute_result.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{test_plan_report_function_case.function_case_execute_result.length_range}", groups = {Created.class, Updated.class}) + private String functionCaseExecuteResult; private static final long serialVersionUID = 1L; @@ -45,7 +67,13 @@ public class TestPlanReportFunctionCase implements Serializable { testPlanReportId("test_plan_report_id", "testPlanReportId", "VARCHAR", false), testPlanFunctionCaseId("test_plan_function_case_id", "testPlanFunctionCaseId", "VARCHAR", false), functionCaseId("function_case_id", "functionCaseId", "VARCHAR", false), - executeResult("execute_result", "executeResult", "VARCHAR", false); + functionCaseNum("function_case_num", "functionCaseNum", "BIGINT", false), + functionCaseName("function_case_name", "functionCaseName", "VARCHAR", false), + functionCaseModule("function_case_module", "functionCaseModule", "VARCHAR", false), + functionCasePriority("function_case_priority", "functionCasePriority", "VARCHAR", false), + functionCaseExecuteUser("function_case_execute_user", "functionCaseExecuteUser", "VARCHAR", false), + functionCaseBugCount("function_case_bug_count", "functionCaseBugCount", "VARCHAR", false), + functionCaseExecuteResult("function_case_execute_result", "functionCaseExecuteResult", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java index 3911e183fc..079e2526ca 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java @@ -384,73 +384,483 @@ public class TestPlanReportFunctionCaseExample { return (Criteria) this; } - public Criteria andExecuteResultIsNull() { - addCriterion("execute_result is null"); + public Criteria andFunctionCaseNumIsNull() { + addCriterion("function_case_num is null"); return (Criteria) this; } - public Criteria andExecuteResultIsNotNull() { - addCriterion("execute_result is not null"); + public Criteria andFunctionCaseNumIsNotNull() { + addCriterion("function_case_num is not null"); return (Criteria) this; } - public Criteria andExecuteResultEqualTo(String value) { - addCriterion("execute_result =", value, "executeResult"); + public Criteria andFunctionCaseNumEqualTo(Long value) { + addCriterion("function_case_num =", value, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultNotEqualTo(String value) { - addCriterion("execute_result <>", value, "executeResult"); + public Criteria andFunctionCaseNumNotEqualTo(Long value) { + addCriterion("function_case_num <>", value, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultGreaterThan(String value) { - addCriterion("execute_result >", value, "executeResult"); + public Criteria andFunctionCaseNumGreaterThan(Long value) { + addCriterion("function_case_num >", value, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultGreaterThanOrEqualTo(String value) { - addCriterion("execute_result >=", value, "executeResult"); + public Criteria andFunctionCaseNumGreaterThanOrEqualTo(Long value) { + addCriterion("function_case_num >=", value, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultLessThan(String value) { - addCriterion("execute_result <", value, "executeResult"); + public Criteria andFunctionCaseNumLessThan(Long value) { + addCriterion("function_case_num <", value, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultLessThanOrEqualTo(String value) { - addCriterion("execute_result <=", value, "executeResult"); + public Criteria andFunctionCaseNumLessThanOrEqualTo(Long value) { + addCriterion("function_case_num <=", value, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultLike(String value) { - addCriterion("execute_result like", value, "executeResult"); + public Criteria andFunctionCaseNumIn(List values) { + addCriterion("function_case_num in", values, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultNotLike(String value) { - addCriterion("execute_result not like", value, "executeResult"); + public Criteria andFunctionCaseNumNotIn(List values) { + addCriterion("function_case_num not in", values, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultIn(List values) { - addCriterion("execute_result in", values, "executeResult"); + public Criteria andFunctionCaseNumBetween(Long value1, Long value2) { + addCriterion("function_case_num between", value1, value2, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultNotIn(List values) { - addCriterion("execute_result not in", values, "executeResult"); + public Criteria andFunctionCaseNumNotBetween(Long value1, Long value2) { + addCriterion("function_case_num not between", value1, value2, "functionCaseNum"); return (Criteria) this; } - public Criteria andExecuteResultBetween(String value1, String value2) { - addCriterion("execute_result between", value1, value2, "executeResult"); + public Criteria andFunctionCaseNameIsNull() { + addCriterion("function_case_name is null"); return (Criteria) this; } - public Criteria andExecuteResultNotBetween(String value1, String value2) { - addCriterion("execute_result not between", value1, value2, "executeResult"); + public Criteria andFunctionCaseNameIsNotNull() { + addCriterion("function_case_name is not null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameEqualTo(String value) { + addCriterion("function_case_name =", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameNotEqualTo(String value) { + addCriterion("function_case_name <>", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameGreaterThan(String value) { + addCriterion("function_case_name >", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameGreaterThanOrEqualTo(String value) { + addCriterion("function_case_name >=", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameLessThan(String value) { + addCriterion("function_case_name <", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameLessThanOrEqualTo(String value) { + addCriterion("function_case_name <=", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameLike(String value) { + addCriterion("function_case_name like", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameNotLike(String value) { + addCriterion("function_case_name not like", value, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameIn(List values) { + addCriterion("function_case_name in", values, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameNotIn(List values) { + addCriterion("function_case_name not in", values, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameBetween(String value1, String value2) { + addCriterion("function_case_name between", value1, value2, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseNameNotBetween(String value1, String value2) { + addCriterion("function_case_name not between", value1, value2, "functionCaseName"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleIsNull() { + addCriterion("function_case_module is null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleIsNotNull() { + addCriterion("function_case_module is not null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleEqualTo(String value) { + addCriterion("function_case_module =", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleNotEqualTo(String value) { + addCriterion("function_case_module <>", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleGreaterThan(String value) { + addCriterion("function_case_module >", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleGreaterThanOrEqualTo(String value) { + addCriterion("function_case_module >=", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleLessThan(String value) { + addCriterion("function_case_module <", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleLessThanOrEqualTo(String value) { + addCriterion("function_case_module <=", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleLike(String value) { + addCriterion("function_case_module like", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleNotLike(String value) { + addCriterion("function_case_module not like", value, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleIn(List values) { + addCriterion("function_case_module in", values, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleNotIn(List values) { + addCriterion("function_case_module not in", values, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleBetween(String value1, String value2) { + addCriterion("function_case_module between", value1, value2, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCaseModuleNotBetween(String value1, String value2) { + addCriterion("function_case_module not between", value1, value2, "functionCaseModule"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityIsNull() { + addCriterion("function_case_priority is null"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityIsNotNull() { + addCriterion("function_case_priority is not null"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityEqualTo(String value) { + addCriterion("function_case_priority =", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityNotEqualTo(String value) { + addCriterion("function_case_priority <>", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityGreaterThan(String value) { + addCriterion("function_case_priority >", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityGreaterThanOrEqualTo(String value) { + addCriterion("function_case_priority >=", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityLessThan(String value) { + addCriterion("function_case_priority <", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityLessThanOrEqualTo(String value) { + addCriterion("function_case_priority <=", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityLike(String value) { + addCriterion("function_case_priority like", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityNotLike(String value) { + addCriterion("function_case_priority not like", value, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityIn(List values) { + addCriterion("function_case_priority in", values, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityNotIn(List values) { + addCriterion("function_case_priority not in", values, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityBetween(String value1, String value2) { + addCriterion("function_case_priority between", value1, value2, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCasePriorityNotBetween(String value1, String value2) { + addCriterion("function_case_priority not between", value1, value2, "functionCasePriority"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserIsNull() { + addCriterion("function_case_execute_user is null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserIsNotNull() { + addCriterion("function_case_execute_user is not null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserEqualTo(String value) { + addCriterion("function_case_execute_user =", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserNotEqualTo(String value) { + addCriterion("function_case_execute_user <>", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserGreaterThan(String value) { + addCriterion("function_case_execute_user >", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserGreaterThanOrEqualTo(String value) { + addCriterion("function_case_execute_user >=", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserLessThan(String value) { + addCriterion("function_case_execute_user <", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserLessThanOrEqualTo(String value) { + addCriterion("function_case_execute_user <=", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserLike(String value) { + addCriterion("function_case_execute_user like", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserNotLike(String value) { + addCriterion("function_case_execute_user not like", value, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserIn(List values) { + addCriterion("function_case_execute_user in", values, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserNotIn(List values) { + addCriterion("function_case_execute_user not in", values, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserBetween(String value1, String value2) { + addCriterion("function_case_execute_user between", value1, value2, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteUserNotBetween(String value1, String value2) { + addCriterion("function_case_execute_user not between", value1, value2, "functionCaseExecuteUser"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountIsNull() { + addCriterion("function_case_bug_count is null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountIsNotNull() { + addCriterion("function_case_bug_count is not null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountEqualTo(String value) { + addCriterion("function_case_bug_count =", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountNotEqualTo(String value) { + addCriterion("function_case_bug_count <>", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountGreaterThan(String value) { + addCriterion("function_case_bug_count >", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountGreaterThanOrEqualTo(String value) { + addCriterion("function_case_bug_count >=", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountLessThan(String value) { + addCriterion("function_case_bug_count <", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountLessThanOrEqualTo(String value) { + addCriterion("function_case_bug_count <=", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountLike(String value) { + addCriterion("function_case_bug_count like", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountNotLike(String value) { + addCriterion("function_case_bug_count not like", value, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountIn(List values) { + addCriterion("function_case_bug_count in", values, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountNotIn(List values) { + addCriterion("function_case_bug_count not in", values, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountBetween(String value1, String value2) { + addCriterion("function_case_bug_count between", value1, value2, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseBugCountNotBetween(String value1, String value2) { + addCriterion("function_case_bug_count not between", value1, value2, "functionCaseBugCount"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultIsNull() { + addCriterion("function_case_execute_result is null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultIsNotNull() { + addCriterion("function_case_execute_result is not null"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultEqualTo(String value) { + addCriterion("function_case_execute_result =", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultNotEqualTo(String value) { + addCriterion("function_case_execute_result <>", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultGreaterThan(String value) { + addCriterion("function_case_execute_result >", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultGreaterThanOrEqualTo(String value) { + addCriterion("function_case_execute_result >=", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultLessThan(String value) { + addCriterion("function_case_execute_result <", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultLessThanOrEqualTo(String value) { + addCriterion("function_case_execute_result <=", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultLike(String value) { + addCriterion("function_case_execute_result like", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultNotLike(String value) { + addCriterion("function_case_execute_result not like", value, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultIn(List values) { + addCriterion("function_case_execute_result in", values, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultNotIn(List values) { + addCriterion("function_case_execute_result not in", values, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultBetween(String value1, String value2) { + addCriterion("function_case_execute_result between", value1, value2, "functionCaseExecuteResult"); + return (Criteria) this; + } + + public Criteria andFunctionCaseExecuteResultNotBetween(String value1, String value2) { + addCriterion("function_case_execute_result not between", value1, value2, "functionCaseExecuteResult"); return (Criteria) this; } } diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.java b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.java index 6227ad3bad..d438c05b13 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.java @@ -11,16 +11,24 @@ public interface TestPlanReportBugMapper { int deleteByExample(TestPlanReportBugExample example); + int deleteByPrimaryKey(String id); + int insert(TestPlanReportBug record); int insertSelective(TestPlanReportBug record); List selectByExample(TestPlanReportBugExample example); + TestPlanReportBug selectByPrimaryKey(String id); + int updateByExampleSelective(@Param("record") TestPlanReportBug record, @Param("example") TestPlanReportBugExample example); int updateByExample(@Param("record") TestPlanReportBug record, @Param("example") TestPlanReportBugExample example); + int updateByPrimaryKeySelective(TestPlanReportBug record); + + int updateByPrimaryKey(TestPlanReportBug record); + int batchInsert(@Param("list") List list); int batchInsertSelective(@Param("list") List list, @Param("selective") TestPlanReportBug.Column ... selective); diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.xml index 2e4d3cd2f1..51c25e9fbc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportBugMapper.xml @@ -2,9 +2,13 @@ - + + + + + @@ -65,7 +69,7 @@ - id, test_plan_report_id, bug_id + id, test_plan_report_id, bug_id, bug_num, bug_title, bug_status, bug_handle_user + + + delete from test_plan_report_bug + where id = #{id,jdbcType=VARCHAR} + delete from test_plan_report_bug @@ -88,10 +102,12 @@ - insert into test_plan_report_bug (id, test_plan_report_id, bug_id - ) - values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR} - ) + insert into test_plan_report_bug (id, test_plan_report_id, bug_id, + bug_num, bug_title, bug_status, + bug_handle_user) + values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}, + #{bugNum,jdbcType=BIGINT}, #{bugTitle,jdbcType=VARCHAR}, #{bugStatus,jdbcType=VARCHAR}, + #{bugHandleUser,jdbcType=VARCHAR}) insert into test_plan_report_bug @@ -105,6 +121,18 @@ bug_id, + + bug_num, + + + bug_title, + + + bug_status, + + + bug_handle_user, + @@ -116,6 +144,18 @@ #{bugId,jdbcType=VARCHAR}, + + #{bugNum,jdbcType=BIGINT}, + + + #{bugTitle,jdbcType=VARCHAR}, + + + #{bugStatus,jdbcType=VARCHAR}, + + + #{bugHandleUser,jdbcType=VARCHAR}, + select @@ -101,9 +109,15 @@ insert into test_plan_report_function_case (id, test_plan_report_id, test_plan_function_case_id, - function_case_id, execute_result) + function_case_id, function_case_num, function_case_name, + function_case_module, function_case_priority, + function_case_execute_user, function_case_bug_count, + function_case_execute_result) values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{testPlanFunctionCaseId,jdbcType=VARCHAR}, - #{functionCaseId,jdbcType=VARCHAR}, #{executeResult,jdbcType=VARCHAR}) + #{functionCaseId,jdbcType=VARCHAR}, #{functionCaseNum,jdbcType=BIGINT}, #{functionCaseName,jdbcType=VARCHAR}, + #{functionCaseModule,jdbcType=VARCHAR}, #{functionCasePriority,jdbcType=VARCHAR}, + #{functionCaseExecuteUser,jdbcType=VARCHAR}, #{functionCaseBugCount,jdbcType=VARCHAR}, + #{functionCaseExecuteResult,jdbcType=VARCHAR}) insert into test_plan_report_function_case @@ -120,8 +134,26 @@ function_case_id, - - execute_result, + + function_case_num, + + + function_case_name, + + + function_case_module, + + + function_case_priority, + + + function_case_execute_user, + + + function_case_bug_count, + + + function_case_execute_result, @@ -137,8 +169,26 @@ #{functionCaseId,jdbcType=VARCHAR}, - - #{executeResult,jdbcType=VARCHAR}, + + #{functionCaseNum,jdbcType=BIGINT}, + + + #{functionCaseName,jdbcType=VARCHAR}, + + + #{functionCaseModule,jdbcType=VARCHAR}, + + + #{functionCasePriority,jdbcType=VARCHAR}, + + + #{functionCaseExecuteUser,jdbcType=VARCHAR}, + + + #{functionCaseBugCount,jdbcType=VARCHAR}, + + + #{functionCaseExecuteResult,jdbcType=VARCHAR}, @@ -163,8 +213,26 @@ function_case_id = #{record.functionCaseId,jdbcType=VARCHAR}, - - execute_result = #{record.executeResult,jdbcType=VARCHAR}, + + function_case_num = #{record.functionCaseNum,jdbcType=BIGINT}, + + + function_case_name = #{record.functionCaseName,jdbcType=VARCHAR}, + + + function_case_module = #{record.functionCaseModule,jdbcType=VARCHAR}, + + + function_case_priority = #{record.functionCasePriority,jdbcType=VARCHAR}, + + + function_case_execute_user = #{record.functionCaseExecuteUser,jdbcType=VARCHAR}, + + + function_case_bug_count = #{record.functionCaseBugCount,jdbcType=VARCHAR}, + + + function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR}, @@ -177,7 +245,13 @@ test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, test_plan_function_case_id = #{record.testPlanFunctionCaseId,jdbcType=VARCHAR}, function_case_id = #{record.functionCaseId,jdbcType=VARCHAR}, - execute_result = #{record.executeResult,jdbcType=VARCHAR} + function_case_num = #{record.functionCaseNum,jdbcType=BIGINT}, + function_case_name = #{record.functionCaseName,jdbcType=VARCHAR}, + function_case_module = #{record.functionCaseModule,jdbcType=VARCHAR}, + function_case_priority = #{record.functionCasePriority,jdbcType=VARCHAR}, + function_case_execute_user = #{record.functionCaseExecuteUser,jdbcType=VARCHAR}, + function_case_bug_count = #{record.functionCaseBugCount,jdbcType=VARCHAR}, + function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR} @@ -194,8 +268,26 @@ function_case_id = #{functionCaseId,jdbcType=VARCHAR}, - - execute_result = #{executeResult,jdbcType=VARCHAR}, + + function_case_num = #{functionCaseNum,jdbcType=BIGINT}, + + + function_case_name = #{functionCaseName,jdbcType=VARCHAR}, + + + function_case_module = #{functionCaseModule,jdbcType=VARCHAR}, + + + function_case_priority = #{functionCasePriority,jdbcType=VARCHAR}, + + + function_case_execute_user = #{functionCaseExecuteUser,jdbcType=VARCHAR}, + + + function_case_bug_count = #{functionCaseBugCount,jdbcType=VARCHAR}, + + + function_case_execute_result = #{functionCaseExecuteResult,jdbcType=VARCHAR}, where id = #{id,jdbcType=VARCHAR} @@ -205,17 +297,27 @@ set test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, test_plan_function_case_id = #{testPlanFunctionCaseId,jdbcType=VARCHAR}, function_case_id = #{functionCaseId,jdbcType=VARCHAR}, - execute_result = #{executeResult,jdbcType=VARCHAR} + function_case_num = #{functionCaseNum,jdbcType=BIGINT}, + function_case_name = #{functionCaseName,jdbcType=VARCHAR}, + function_case_module = #{functionCaseModule,jdbcType=VARCHAR}, + function_case_priority = #{functionCasePriority,jdbcType=VARCHAR}, + function_case_execute_user = #{functionCaseExecuteUser,jdbcType=VARCHAR}, + function_case_bug_count = #{functionCaseBugCount,jdbcType=VARCHAR}, + function_case_execute_result = #{functionCaseExecuteResult,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into test_plan_report_function_case - (id, test_plan_report_id, test_plan_function_case_id, function_case_id, execute_result - ) + (id, test_plan_report_id, test_plan_function_case_id, function_case_id, function_case_num, + function_case_name, function_case_module, function_case_priority, function_case_execute_user, + function_case_bug_count, function_case_execute_result) values (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanFunctionCaseId,jdbcType=VARCHAR}, - #{item.functionCaseId,jdbcType=VARCHAR}, #{item.executeResult,jdbcType=VARCHAR} + #{item.functionCaseId,jdbcType=VARCHAR}, #{item.functionCaseNum,jdbcType=BIGINT}, + #{item.functionCaseName,jdbcType=VARCHAR}, #{item.functionCaseModule,jdbcType=VARCHAR}, + #{item.functionCasePriority,jdbcType=VARCHAR}, #{item.functionCaseExecuteUser,jdbcType=VARCHAR}, + #{item.functionCaseBugCount,jdbcType=VARCHAR}, #{item.functionCaseExecuteResult,jdbcType=VARCHAR} ) @@ -241,8 +343,26 @@ #{item.functionCaseId,jdbcType=VARCHAR} - - #{item.executeResult,jdbcType=VARCHAR} + + #{item.functionCaseNum,jdbcType=BIGINT} + + + #{item.functionCaseName,jdbcType=VARCHAR} + + + #{item.functionCaseModule,jdbcType=VARCHAR} + + + #{item.functionCasePriority,jdbcType=VARCHAR} + + + #{item.functionCaseExecuteUser,jdbcType=VARCHAR} + + + #{item.functionCaseBugCount,jdbcType=VARCHAR} + + + #{item.functionCaseExecuteResult,jdbcType=VARCHAR} ) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql index 94760763ad..9b01567546 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql @@ -115,9 +115,15 @@ CREATE UNIQUE INDEX idx_test_plan_report_id ON test_plan_report_summary(test_pla CREATE TABLE IF NOT EXISTS test_plan_report_function_case( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' , - `test_plan_function_case_id` VARCHAR(50) NOT NULL COMMENT '测试计划功能用例关联ID' , + `test_plan_function_case_id` VARCHAR(50) NOT NULL COMMENT '测试计划功能用例关联ID(同一计划下可重复关联, 暂时保留)' , `function_case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' , - `execute_result` VARCHAR(50) NOT NULL COMMENT '执行结果' , + `function_case_num` BIGINT NOT NULL COMMENT '功能用例业务ID' , + `function_case_name` VARCHAR(255) NOT NULL COMMENT '功能用例名称' , + `function_case_module` VARCHAR(255) COMMENT '功能用例所属模块' , + `function_case_priority` VARCHAR(50) COMMENT '功能用例用例等级' , + `function_case_execute_user` VARCHAR(50) COMMENT '功能用例执行人' , + `function_case_bug_count` VARCHAR(255) COMMENT '功能用例关联缺陷数' , + `function_case_execute_result` VARCHAR(50) NOT NULL COMMENT '执行结果' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容功能用例部分'; @@ -127,6 +133,10 @@ CREATE TABLE IF NOT EXISTS test_plan_report_bug( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' , `bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' , + `bug_num` BIGINT NOT NULL COMMENT '缺陷业务ID' , + `bug_title` VARCHAR(255) NOT NULL COMMENT '缺陷标题' , + `bug_status` VARCHAR(50) COMMENT '缺陷状态' , + `bug_handle_user` VARCHAR(50) COMMENT '缺陷处理人' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容缺陷部分'; 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 d666df3176..fb2f5c9b2e 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 @@ -3,13 +3,10 @@ package io.metersphere.plan.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.bug.dto.response.BugDTO; -import io.metersphere.functional.dto.FunctionalCasePageDTO; import io.metersphere.plan.constants.TestPlanResourceConfig; import io.metersphere.plan.domain.TestPlanReport; -import io.metersphere.plan.dto.request.TestPlanReportBatchRequest; -import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest; -import io.metersphere.plan.dto.request.TestPlanReportGenRequest; -import io.metersphere.plan.dto.request.TestPlanReportPageRequest; +import io.metersphere.plan.dto.ReportDetailCasePageDTO; +import io.metersphere.plan.dto.request.*; import io.metersphere.plan.dto.response.TestPlanReportDetailResponse; import io.metersphere.plan.dto.response.TestPlanReportPageResponse; import io.metersphere.plan.service.TestPlanManagementService; @@ -92,6 +89,8 @@ public class TestPlanReportController { return testPlanReportService.genReportByManual(request, SessionUtils.getUserId()); } + // 报告详情开始 + @GetMapping("/get/{id}") @Operation(summary = "测试计划-报告-详情") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) @@ -100,13 +99,21 @@ public class TestPlanReportController { return testPlanReportService.getReport(id); } + @PostMapping("/edit") + @Operation(summary = "测试计划-报告-详情-报告内容更新") + @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_UPDATE) + @CheckOwner(resourceId = "#request.getId()", resourceType = "test_plan_report") + public TestPlanReportDetailResponse edit(@Validated @RequestBody TestPlanReportDetailEditRequest request) { + return testPlanReportService.edit(request); + } + @PostMapping("/detail/bug/page") @Operation(summary = "测试计划-报告-详情-缺陷分页查询") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) @CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report") public Pager> pageBug(@Validated @RequestBody TestPlanReportDetailPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "b.num desc"); + StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprb.bug_num, tprb.id desc"); return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailBugs(request)); } @@ -114,9 +121,9 @@ public class TestPlanReportController { @Operation(summary = "测试计划-报告-详情-功能用例分页查询") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) @CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report") - public Pager> pageFunctionalCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) { + public Pager> pageFunctionalCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "fc.num desc"); + StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprfc.function_case_num, tprfc.id desc"); return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailFunctionalCases(request)); } } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java new file mode 100644 index 0000000000..3c170f937b --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java @@ -0,0 +1,46 @@ +package io.metersphere.plan.dto; + +import lombok.Data; + +/** + * 报告详情用例分页返回对象 (功能, 接口, 场景) + */ + +@Data +public class ReportDetailCasePageDTO { + + // ID、用例名称、所属模块、用例等级、执行人、执行结果、缺陷数 + + /** + * 用例ID + */ + private String id; + /** + * 用例业务ID + */ + private Long num; + /** + * 用例名称 + */ + private String name; + /** + * 所属模块 + */ + private String moduleName; + /** + * 用例等级 + */ + private String priority; + /** + * 执行结果 + */ + private String executeResult; + /** + * 执行人 + */ + private String executeUser; + /** + * 缺陷数 + */ + private Long bugCount; +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailEditRequest.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailEditRequest.java new file mode 100644 index 0000000000..72fafa7b61 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailEditRequest.java @@ -0,0 +1,16 @@ +package io.metersphere.plan.dto.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +@Data +public class TestPlanReportDetailEditRequest { + + @Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_id.not_blank}") + private String id; + + @Schema(description = "报告内容") + private String summary; +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailPageRequest.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailPageRequest.java index 276bf7ee99..0f13bcb153 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailPageRequest.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanReportDetailPageRequest.java @@ -13,8 +13,4 @@ public class TestPlanReportDetailPageRequest extends BasePageRequest { @Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_plan.report_id.not_blank}") private String reportId; - - @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan.report_id.not_blank}") - private String projectId; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java index 031b697284..db5ed8a751 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java @@ -16,6 +16,8 @@ public class TestPlanReportDetailResponse { private Long executeTime; @Schema(description = "报告结束(执行)时间") private Long ednTime; + @Schema(description = "报告内容") + private String summary; /** * 报告分析 diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java new file mode 100644 index 0000000000..0ce9332405 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java @@ -0,0 +1,25 @@ +package io.metersphere.plan.mapper; + +import io.metersphere.bug.dto.response.BugDTO; +import io.metersphere.plan.domain.TestPlanReportBug; +import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ExtTestPlanReportBugMapper { + + /** + * 获取计划的缺陷集合 + * @param planId 计划ID + * @return 缺陷集合 + */ + List getPlanBugs(@Param("id") String planId); + + /** + * 分页查询报告关联的缺陷 + * @param request 请求参数 + * @return 关联的缺陷集合 + */ + List list(@Param("request") TestPlanReportDetailPageRequest request); +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml new file mode 100644 index 0000000000..96cbace737 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + \ No newline at end of file diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.java new file mode 100644 index 0000000000..80471581ae --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.java @@ -0,0 +1,43 @@ +package io.metersphere.plan.mapper; + +import io.metersphere.plan.domain.TestPlanReportFunctionCase; +import io.metersphere.plan.dto.CaseStatusCountMap; +import io.metersphere.plan.dto.ReportDetailCasePageDTO; +import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest; +import io.metersphere.plugin.platform.dto.SelectOption; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ExtTestPlanReportFunctionalCaseMapper { + + /** + * 获取计划关联的功能用例 + * @param planId 计划ID + * @return 功能用例列表 + */ + List getPlanExecuteCases(@Param("id") String planId); + + List getCasePriorityByIds(@Param("ids") List caseIds); + + /** + * 统计报告中执行通过的功能用例数量 + * @param reportId 报告ID + * @return 用例数量 + */ + Long countExecuteSuccessCase(@Param("id") String reportId); + + /** + * 统计报告中功能用例执行情况 + * @param reportId 报告ID + * @return 用例数量 + */ + List countExecuteResult(@Param("id") String reportId); + + /** + * 分页查询报告关联的用例 + * @param request 请求参数 + * @return 关联的用例集合 + */ + List list(@Param("request") TestPlanReportDetailPageRequest request); +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml new file mode 100644 index 0000000000..c9efb4bc45 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportFunctionalCaseMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + \ No newline at end of file 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 33446fe1ae..c9c7f07802 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 @@ -1,11 +1,7 @@ package io.metersphere.plan.mapper; -import io.metersphere.bug.dto.response.BugDTO; -import io.metersphere.functional.dto.FunctionalCasePageDTO; import io.metersphere.plan.domain.TestPlanReport; -import io.metersphere.plan.dto.CaseStatusCountMap; import io.metersphere.plan.dto.request.TestPlanReportBatchRequest; -import io.metersphere.plan.dto.request.TestPlanReportDetailPageRequest; import io.metersphere.plan.dto.request.TestPlanReportPageRequest; import io.metersphere.plan.dto.response.TestPlanReportPageResponse; import io.metersphere.system.dto.sdk.ApiReportMessageDTO; @@ -31,41 +27,13 @@ public interface ExtTestPlanReportMapper { */ List getReportBatchIdsByParam(@Param("request") TestPlanReportBatchRequest request); - /** - * 统计报告中执行通过的功能用例数量 - * @param reportId 报告ID - * @return 用例数量 - */ - Long countExecuteSuccessFunctionalCase(@Param("id") String reportId); - List selectReportByIds(@Param("ids") List ids); List getNoticeList(@Param("ids") List subList); - /** - * 统计报告中功能用例执行情况 - * @param reportId 报告ID - * @return 用例数量 - */ - List countFunctionalCaseExecuteResult(@Param("id") String reportId); + long countReportByTime(@Param("time") long timeMills, @Param("projectId") String projectId); - /** - * 分页查询报告关联的缺陷 - * @param request 请求参数 - * @return 关联的缺陷集合 - */ - List listReportBugs(@Param("request")TestPlanReportDetailPageRequest request); + List selectReportIdByProjectIdAndTime(@Param("time") long timeMills, @Param("projectId") String projectId); - /** - * 分页查询报告关联的用例 - * @param request 请求参数 - * @return 关联的用例集合 - */ - List listReportFunctionalCases(@Param("request")TestPlanReportDetailPageRequest request); - - long countReportByTime(@Param("time") long timeMills, @Param("projectId") String projectId); - - List selectReportIdByProjectIdAndTime(@Param("time") long timeMills, @Param("projectId") String projectId); - - List selectReportIdTestPlanIds(@Param("testPlanIds") List testPlanIds); + List selectReportIdTestPlanIds(@Param("testPlanIds") List testPlanIds); } 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 4a61edc74c..b920786377 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 @@ -16,29 +16,6 @@ - - - - - - - -