diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java index 533b9b152b..75d2b72504 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java @@ -66,6 +66,10 @@ public class TestPlanReportApiCase implements Serializable { @Schema(description = "接口用例执行报告ID") private String apiCaseExecuteReportId; + @Schema(description = "自定义排序", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{test_plan_report_api_case.pos.not_blank}", groups = {Created.class}) + private Long pos; + private static final long serialVersionUID = 1L; public enum Column { @@ -81,7 +85,8 @@ public class TestPlanReportApiCase implements Serializable { apiCasePriority("api_case_priority", "apiCasePriority", "VARCHAR", false), apiCaseExecuteUser("api_case_execute_user", "apiCaseExecuteUser", "VARCHAR", false), apiCaseExecuteResult("api_case_execute_result", "apiCaseExecuteResult", "VARCHAR", false), - apiCaseExecuteReportId("api_case_execute_report_id", "apiCaseExecuteReportId", "VARCHAR", false); + apiCaseExecuteReportId("api_case_execute_report_id", "apiCaseExecuteReportId", "VARCHAR", false), + pos("pos", "pos", "BIGINT", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java index 194b0cd79e..87377e2cc4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java @@ -1003,6 +1003,66 @@ public class TestPlanReportApiCaseExample { addCriterion("api_case_execute_report_id not between", value1, value2, "apiCaseExecuteReportId"); return (Criteria) this; } + + public Criteria andPosIsNull() { + addCriterion("pos is null"); + return (Criteria) this; + } + + public Criteria andPosIsNotNull() { + addCriterion("pos is not null"); + return (Criteria) this; + } + + public Criteria andPosEqualTo(Long value) { + addCriterion("pos =", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotEqualTo(Long value) { + addCriterion("pos <>", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosGreaterThan(Long value) { + addCriterion("pos >", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosGreaterThanOrEqualTo(Long value) { + addCriterion("pos >=", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosLessThan(Long value) { + addCriterion("pos <", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosLessThanOrEqualTo(Long value) { + addCriterion("pos <=", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosIn(List values) { + addCriterion("pos in", values, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotIn(List values) { + addCriterion("pos not in", values, "pos"); + return (Criteria) this; + } + + public Criteria andPosBetween(Long value1, Long value2) { + addCriterion("pos between", value1, value2, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotBetween(Long value1, Long value2) { + addCriterion("pos not between", value1, value2, "pos"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java index c52089a5ab..e5e4893d84 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java @@ -69,6 +69,10 @@ public class TestPlanReportApiScenario implements Serializable { @Schema(description = "场景用例执行报告ID") private String apiScenarioExecuteReportId; + @Schema(description = "自定义排序", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{test_plan_report_api_scenario.pos.not_blank}", groups = {Created.class}) + private Long pos; + private static final long serialVersionUID = 1L; public enum Column { @@ -85,7 +89,8 @@ public class TestPlanReportApiScenario implements Serializable { apiScenarioPriority("api_scenario_priority", "apiScenarioPriority", "VARCHAR", false), apiScenarioExecuteUser("api_scenario_execute_user", "apiScenarioExecuteUser", "VARCHAR", false), apiScenarioExecuteResult("api_scenario_execute_result", "apiScenarioExecuteResult", "VARCHAR", false), - apiScenarioExecuteReportId("api_scenario_execute_report_id", "apiScenarioExecuteReportId", "VARCHAR", false); + apiScenarioExecuteReportId("api_scenario_execute_report_id", "apiScenarioExecuteReportId", "VARCHAR", false), + pos("pos", "pos", "BIGINT", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java index bc65945b57..6a9526b5a0 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java @@ -1063,6 +1063,66 @@ public class TestPlanReportApiScenarioExample { addCriterion("api_scenario_execute_report_id not between", value1, value2, "apiScenarioExecuteReportId"); return (Criteria) this; } + + public Criteria andPosIsNull() { + addCriterion("pos is null"); + return (Criteria) this; + } + + public Criteria andPosIsNotNull() { + addCriterion("pos is not null"); + return (Criteria) this; + } + + public Criteria andPosEqualTo(Long value) { + addCriterion("pos =", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotEqualTo(Long value) { + addCriterion("pos <>", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosGreaterThan(Long value) { + addCriterion("pos >", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosGreaterThanOrEqualTo(Long value) { + addCriterion("pos >=", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosLessThan(Long value) { + addCriterion("pos <", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosLessThanOrEqualTo(Long value) { + addCriterion("pos <=", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosIn(List values) { + addCriterion("pos in", values, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotIn(List values) { + addCriterion("pos not in", values, "pos"); + return (Criteria) this; + } + + public Criteria andPosBetween(Long value1, Long value2) { + addCriterion("pos between", value1, value2, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotBetween(Long value1, Long value2) { + addCriterion("pos not between", value1, value2, "pos"); + 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 79a0a893d6..e997283972 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 @@ -65,6 +65,10 @@ public class TestPlanReportFunctionCase implements Serializable { @Size(min = 1, max = 50, message = "{test_plan_report_function_case.test_plan_collection_id.length_range}", groups = {Created.class, Updated.class}) private String testPlanCollectionId; + @Schema(description = "自定义排序", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{test_plan_report_function_case.pos.not_blank}", groups = {Created.class}) + private Long pos; + private static final long serialVersionUID = 1L; public enum Column { @@ -79,7 +83,8 @@ public class TestPlanReportFunctionCase implements Serializable { functionCaseExecuteUser("function_case_execute_user", "functionCaseExecuteUser", "VARCHAR", false), functionCaseBugCount("function_case_bug_count", "functionCaseBugCount", "BIGINT", false), functionCaseExecuteResult("function_case_execute_result", "functionCaseExecuteResult", "VARCHAR", false), - testPlanCollectionId("test_plan_collection_id", "testPlanCollectionId", "VARCHAR", false); + testPlanCollectionId("test_plan_collection_id", "testPlanCollectionId", "VARCHAR", false), + pos("pos", "pos", "BIGINT", 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 695aca85ae..04d6e97c89 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 @@ -923,6 +923,66 @@ public class TestPlanReportFunctionCaseExample { addCriterion("test_plan_collection_id not between", value1, value2, "testPlanCollectionId"); return (Criteria) this; } + + public Criteria andPosIsNull() { + addCriterion("pos is null"); + return (Criteria) this; + } + + public Criteria andPosIsNotNull() { + addCriterion("pos is not null"); + return (Criteria) this; + } + + public Criteria andPosEqualTo(Long value) { + addCriterion("pos =", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotEqualTo(Long value) { + addCriterion("pos <>", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosGreaterThan(Long value) { + addCriterion("pos >", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosGreaterThanOrEqualTo(Long value) { + addCriterion("pos >=", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosLessThan(Long value) { + addCriterion("pos <", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosLessThanOrEqualTo(Long value) { + addCriterion("pos <=", value, "pos"); + return (Criteria) this; + } + + public Criteria andPosIn(List values) { + addCriterion("pos in", values, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotIn(List values) { + addCriterion("pos not in", values, "pos"); + return (Criteria) this; + } + + public Criteria andPosBetween(Long value1, Long value2) { + addCriterion("pos between", value1, value2, "pos"); + return (Criteria) this; + } + + public Criteria andPosNotBetween(Long value1, Long value2) { + addCriterion("pos not between", value1, value2, "pos"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml index 2e6bfd4b99..5383651c1c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml @@ -15,6 +15,7 @@ + @@ -77,7 +78,7 @@ id, test_plan_report_id, test_plan_collection_id, environment_id, test_plan_api_case_id, api_case_id, api_case_num, api_case_name, api_case_module, api_case_priority, api_case_execute_user, - api_case_execute_result, api_case_execute_report_id + api_case_execute_result, api_case_execute_report_id, pos @@ -254,6 +261,9 @@ api_case_execute_report_id = #{record.apiCaseExecuteReportId,jdbcType=VARCHAR}, + + pos = #{record.pos,jdbcType=BIGINT}, + @@ -273,7 +283,8 @@ api_case_priority = #{record.apiCasePriority,jdbcType=VARCHAR}, api_case_execute_user = #{record.apiCaseExecuteUser,jdbcType=VARCHAR}, api_case_execute_result = #{record.apiCaseExecuteResult,jdbcType=VARCHAR}, - api_case_execute_report_id = #{record.apiCaseExecuteReportId,jdbcType=VARCHAR} + api_case_execute_report_id = #{record.apiCaseExecuteReportId,jdbcType=VARCHAR}, + pos = #{record.pos,jdbcType=BIGINT} @@ -317,6 +328,9 @@ api_case_execute_report_id = #{apiCaseExecuteReportId,jdbcType=VARCHAR}, + + pos = #{pos,jdbcType=BIGINT}, + where id = #{id,jdbcType=VARCHAR} @@ -333,14 +347,15 @@ api_case_priority = #{apiCasePriority,jdbcType=VARCHAR}, api_case_execute_user = #{apiCaseExecuteUser,jdbcType=VARCHAR}, api_case_execute_result = #{apiCaseExecuteResult,jdbcType=VARCHAR}, - api_case_execute_report_id = #{apiCaseExecuteReportId,jdbcType=VARCHAR} + api_case_execute_report_id = #{apiCaseExecuteReportId,jdbcType=VARCHAR}, + pos = #{pos,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} insert into test_plan_report_api_case (id, test_plan_report_id, test_plan_collection_id, environment_id, test_plan_api_case_id, api_case_id, api_case_num, api_case_name, api_case_module, api_case_priority, api_case_execute_user, - api_case_execute_result, api_case_execute_report_id) + api_case_execute_result, api_case_execute_report_id, pos) values (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanCollectionId,jdbcType=VARCHAR}, @@ -348,7 +363,7 @@ #{item.apiCaseId,jdbcType=VARCHAR}, #{item.apiCaseNum,jdbcType=BIGINT}, #{item.apiCaseName,jdbcType=VARCHAR}, #{item.apiCaseModule,jdbcType=VARCHAR}, #{item.apiCasePriority,jdbcType=VARCHAR}, #{item.apiCaseExecuteUser,jdbcType=VARCHAR}, #{item.apiCaseExecuteResult,jdbcType=VARCHAR}, - #{item.apiCaseExecuteReportId,jdbcType=VARCHAR}) + #{item.apiCaseExecuteReportId,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT}) @@ -400,6 +415,9 @@ #{item.apiCaseExecuteReportId,jdbcType=VARCHAR} + + #{item.pos,jdbcType=BIGINT} + ) diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml index 1ee3b2582b..f2b57dcc74 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml @@ -16,6 +16,7 @@ + @@ -78,7 +79,8 @@ id, test_plan_report_id, test_plan_collection_id, grouped, environment_id, test_plan_api_scenario_id, api_scenario_id, api_scenario_num, api_scenario_name, api_scenario_module, api_scenario_priority, - api_scenario_execute_user, api_scenario_execute_result, api_scenario_execute_report_id + api_scenario_execute_user, api_scenario_execute_result, api_scenario_execute_report_id, + pos @@ -266,6 +274,9 @@ api_scenario_execute_report_id = #{record.apiScenarioExecuteReportId,jdbcType=VARCHAR}, + + pos = #{record.pos,jdbcType=BIGINT}, + @@ -286,7 +297,8 @@ api_scenario_priority = #{record.apiScenarioPriority,jdbcType=VARCHAR}, api_scenario_execute_user = #{record.apiScenarioExecuteUser,jdbcType=VARCHAR}, api_scenario_execute_result = #{record.apiScenarioExecuteResult,jdbcType=VARCHAR}, - api_scenario_execute_report_id = #{record.apiScenarioExecuteReportId,jdbcType=VARCHAR} + api_scenario_execute_report_id = #{record.apiScenarioExecuteReportId,jdbcType=VARCHAR}, + pos = #{record.pos,jdbcType=BIGINT} @@ -333,6 +345,9 @@ api_scenario_execute_report_id = #{apiScenarioExecuteReportId,jdbcType=VARCHAR}, + + pos = #{pos,jdbcType=BIGINT}, + where id = #{id,jdbcType=VARCHAR} @@ -350,15 +365,16 @@ api_scenario_priority = #{apiScenarioPriority,jdbcType=VARCHAR}, api_scenario_execute_user = #{apiScenarioExecuteUser,jdbcType=VARCHAR}, api_scenario_execute_result = #{apiScenarioExecuteResult,jdbcType=VARCHAR}, - api_scenario_execute_report_id = #{apiScenarioExecuteReportId,jdbcType=VARCHAR} + api_scenario_execute_report_id = #{apiScenarioExecuteReportId,jdbcType=VARCHAR}, + pos = #{pos,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} insert into test_plan_report_api_scenario (id, test_plan_report_id, test_plan_collection_id, grouped, environment_id, test_plan_api_scenario_id, api_scenario_id, api_scenario_num, api_scenario_name, api_scenario_module, api_scenario_priority, - api_scenario_execute_user, api_scenario_execute_result, api_scenario_execute_report_id - ) + api_scenario_execute_user, api_scenario_execute_result, api_scenario_execute_report_id, + pos) values (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanCollectionId,jdbcType=VARCHAR}, @@ -366,8 +382,8 @@ #{item.apiScenarioId,jdbcType=VARCHAR}, #{item.apiScenarioNum,jdbcType=BIGINT}, #{item.apiScenarioName,jdbcType=VARCHAR}, #{item.apiScenarioModule,jdbcType=VARCHAR}, #{item.apiScenarioPriority,jdbcType=VARCHAR}, #{item.apiScenarioExecuteUser,jdbcType=VARCHAR}, - #{item.apiScenarioExecuteResult,jdbcType=VARCHAR}, #{item.apiScenarioExecuteReportId,jdbcType=VARCHAR} - ) + #{item.apiScenarioExecuteResult,jdbcType=VARCHAR}, #{item.apiScenarioExecuteReportId,jdbcType=VARCHAR}, + #{item.pos,jdbcType=BIGINT}) @@ -422,6 +438,9 @@ #{item.apiScenarioExecuteReportId,jdbcType=VARCHAR} + + #{item.pos,jdbcType=BIGINT} + ) diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml index 20ac2d878a..6bdaaaa15e 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml @@ -14,6 +14,7 @@ + @@ -76,7 +77,7 @@ 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, test_plan_collection_id + function_case_bug_count, function_case_execute_result, test_plan_collection_id, pos @@ -246,6 +253,9 @@ test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + + pos = #{record.pos,jdbcType=BIGINT}, + @@ -264,7 +274,8 @@ function_case_execute_user = #{record.functionCaseExecuteUser,jdbcType=VARCHAR}, function_case_bug_count = #{record.functionCaseBugCount,jdbcType=BIGINT}, function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR}, - test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR} + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + pos = #{record.pos,jdbcType=BIGINT} @@ -305,6 +316,9 @@ test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + + pos = #{pos,jdbcType=BIGINT}, + where id = #{id,jdbcType=VARCHAR} @@ -320,14 +334,16 @@ function_case_execute_user = #{functionCaseExecuteUser,jdbcType=VARCHAR}, function_case_bug_count = #{functionCaseBugCount,jdbcType=BIGINT}, function_case_execute_result = #{functionCaseExecuteResult,jdbcType=VARCHAR}, - test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR} + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + pos = #{pos,jdbcType=BIGINT} 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, function_case_num, function_case_name, function_case_module, function_case_priority, function_case_execute_user, - function_case_bug_count, function_case_execute_result, test_plan_collection_id) + function_case_bug_count, function_case_execute_result, test_plan_collection_id, + pos) values (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanFunctionCaseId,jdbcType=VARCHAR}, @@ -335,7 +351,7 @@ #{item.functionCaseName,jdbcType=VARCHAR}, #{item.functionCaseModule,jdbcType=VARCHAR}, #{item.functionCasePriority,jdbcType=VARCHAR}, #{item.functionCaseExecuteUser,jdbcType=VARCHAR}, #{item.functionCaseBugCount,jdbcType=BIGINT}, #{item.functionCaseExecuteResult,jdbcType=VARCHAR}, - #{item.testPlanCollectionId,jdbcType=VARCHAR}) + #{item.testPlanCollectionId,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT}) @@ -384,6 +400,9 @@ #{item.testPlanCollectionId,jdbcType=VARCHAR} + + #{item.pos,jdbcType=BIGINT} + ) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql b/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql index 7f730f1438..046840d498 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql @@ -190,12 +190,13 @@ CREATE TABLE IF NOT EXISTS test_plan_report_api_case( `api_case_execute_user` VARCHAR(50) COMMENT '接口用例执行人' , `api_case_execute_result` VARCHAR(50) COMMENT '接口用例执行结果' , `api_case_execute_report_id` VARCHAR(50) COMMENT '接口用例执行报告ID' , + `pos` BIGINT NOT NULL COMMENT '自定义排序' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容接口用例部分'; CREATE INDEX idx_test_plan_report_id ON test_plan_report_api_case(test_plan_report_id); CREATE INDEX idx_test_plan_collection_id ON test_plan_report_api_case(test_plan_collection_id); +CREATE INDEX idx_pos ON test_plan_report_api_case(pos); --- 测试计划报告场景详情部分 CREATE TABLE IF NOT EXISTS test_plan_report_api_scenario( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' , @@ -211,10 +212,12 @@ CREATE TABLE IF NOT EXISTS test_plan_report_api_scenario( `api_scenario_execute_user` VARCHAR(50) COMMENT '场景用例执行人' , `api_scenario_execute_result` VARCHAR(50) COMMENT '场景用例执行结果' , `api_scenario_execute_report_id` VARCHAR(50) COMMENT '场景用例执行报告ID' , + `pos` BIGINT NOT NULL COMMENT '自定义排序' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容接口场景部分'; CREATE INDEX idx_test_plan_report_id ON test_plan_report_api_scenario(test_plan_report_id); CREATE INDEX idx_test_plan_collection_id ON test_plan_report_api_scenario(test_plan_collection_id); +CREATE INDEX idx_pos ON test_plan_report_api_scenario(pos); -- 测试计划报告 ALTER TABLE test_plan_report ADD `execute_rate` DECIMAL(10, 4) COMMENT '执行率'; @@ -222,7 +225,9 @@ ALTER TABLE test_plan_report ADD `parent_id` VARCHAR(50) COMMENT '独立报告 -- 计划报告功能用例明细表 ALTER TABLE test_plan_report_function_case ADD `test_plan_collection_id` VARCHAR(50) NOT NULL COMMENT '测试集ID'; +ALTER TABLE test_plan_report_function_case ADD `pos` BIGINT NOT NULL COMMENT '自定义排序'; CREATE INDEX idx_test_plan_collection_id ON test_plan_report_function_case(test_plan_collection_id); +CREATE INDEX idx_pos ON test_plan_report_function_case(pos); -- set innodb lock wait timeout to default SET SESSION innodb_lock_wait_timeout = DEFAULT; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java index 5838b174b8..a14ba6970f 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java @@ -38,4 +38,7 @@ public class TestPlanReportGenPreParam { @Schema(description = "计划组报告ID, 独立报告需要") private String groupReportId; + + @Schema(description = "是否手动生成报告") + private Boolean useManual; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml index 0af02affae..65ffaba976 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml @@ -11,7 +11,7 @@ select tpac.id as testPlanApiCaseId, atc.id as apiCaseId, atc.num as apiCaseNum, atc.name as apiCaseName, atc.priority as apiCasePriority, tpac.test_plan_collection_id testPlanCollectionId, tpac.environment_id as environmentId, if(ad.module_id = 'root','未规划用例', ad.module_id) as apiCaseModule, tpac.execute_user as apiCaseExecuteUser, - ifnull(tpac.last_exec_result, 'PENDING') as apiCaseExecuteResult + ifnull(tpac.last_exec_result, 'PENDING') as apiCaseExecuteResult, tpac.last_exec_report_id apiCaseExecuteReportId, tpac.pos pos from test_plan_api_case tpac join api_test_case atc on atc.id = tpac.api_case_id left join api_definition ad on atc.api_definition_id = ad.id left join api_definition_module adm on ad.module_id = adm.id @@ -22,7 +22,7 @@ select tpfc.id as testPlanFunctionCaseId, fc.id as functionCaseId, fc.num as functionCaseNum, fc.name as functionCaseName, tpfc.test_plan_collection_id testPlanCollectionId, if(fc.module_id = 'root','未规划用例', fc.module_id) as functionCaseModule, tpfc.execute_user as functionCaseExecuteUser, - count(brc.id) as functionCaseBugCount, ifnull(tpfc.last_exec_result, 'PENDING') as functionCaseExecuteResult + count(brc.id) as functionCaseBugCount, ifnull(tpfc.last_exec_result, 'PENDING') as functionCaseExecuteResult, tpfc.pos pos from test_plan_functional_case tpfc join functional_case fc on tpfc.functional_case_id = fc.id left join functional_case_module fcm on fcm.id = fc.module_id left join bug_relation_case brc on brc.test_plan_case_id = tpfc.id @@ -16,7 +16,7 @@