refactor(测试计划): 优化聚合报告详情页

This commit is contained in:
song-cc-rock 2024-06-14 11:47:00 +08:00 committed by 刘瑞斌
parent 2b2f9de087
commit 6026df57e2
16 changed files with 356 additions and 61 deletions

View File

@ -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 = "`";

View File

@ -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<Long> values) {
addCriterion("pos in", values, "pos");
return (Criteria) this;
}
public Criteria andPosNotIn(List<Long> 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 {

View File

@ -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 = "`";

View File

@ -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<Long> values) {
addCriterion("pos in", values, "pos");
return (Criteria) this;
}
public Criteria andPosNotIn(List<Long> 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 {

View File

@ -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 = "`";

View File

@ -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<Long> values) {
addCriterion("pos in", values, "pos");
return (Criteria) this;
}
public Criteria andPosNotIn(List<Long> 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 {

View File

@ -15,6 +15,7 @@
<result column="api_case_execute_user" jdbcType="VARCHAR" property="apiCaseExecuteUser" />
<result column="api_case_execute_result" jdbcType="VARCHAR" property="apiCaseExecuteResult" />
<result column="api_case_execute_report_id" jdbcType="VARCHAR" property="apiCaseExecuteReportId" />
<result column="pos" jdbcType="BIGINT" property="pos" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -77,7 +78,7 @@
<sql id="Base_Column_List">
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
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportApiCaseExample" resultMap="BaseResultMap">
select
@ -114,12 +115,12 @@
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_report_id, pos)
values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{testPlanCollectionId,jdbcType=VARCHAR},
#{environmentId,jdbcType=VARCHAR}, #{testPlanApiCaseId,jdbcType=VARCHAR}, #{apiCaseId,jdbcType=VARCHAR},
#{apiCaseNum,jdbcType=BIGINT}, #{apiCaseName,jdbcType=VARCHAR}, #{apiCaseModule,jdbcType=VARCHAR},
#{apiCasePriority,jdbcType=VARCHAR}, #{apiCaseExecuteUser,jdbcType=VARCHAR}, #{apiCaseExecuteResult,jdbcType=VARCHAR},
#{apiCaseExecuteReportId,jdbcType=VARCHAR})
#{apiCaseExecuteReportId,jdbcType=VARCHAR}, #{pos,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportApiCase">
insert into test_plan_report_api_case
@ -163,6 +164,9 @@
<if test="apiCaseExecuteReportId != null">
api_case_execute_report_id,
</if>
<if test="pos != null">
pos,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -204,6 +208,9 @@
<if test="apiCaseExecuteReportId != null">
#{apiCaseExecuteReportId,jdbcType=VARCHAR},
</if>
<if test="pos != null">
#{pos,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportApiCaseExample" resultType="java.lang.Long">
@ -254,6 +261,9 @@
<if test="record.apiCaseExecuteReportId != null">
api_case_execute_report_id = #{record.apiCaseExecuteReportId,jdbcType=VARCHAR},
</if>
<if test="record.pos != null">
pos = #{record.pos,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -317,6 +328,9 @@
<if test="apiCaseExecuteReportId != null">
api_case_execute_report_id = #{apiCaseExecuteReportId,jdbcType=VARCHAR},
</if>
<if test="pos != null">
pos = #{pos,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -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}
</update>
<insert id="batchInsert" parameterType="map">
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
<foreach collection="list" item="item" separator=",">
(#{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})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
@ -400,6 +415,9 @@
<if test="'api_case_execute_report_id'.toString() == column.value">
#{item.apiCaseExecuteReportId,jdbcType=VARCHAR}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT}
</if>
</foreach>
)
</foreach>

View File

@ -16,6 +16,7 @@
<result column="api_scenario_execute_user" jdbcType="VARCHAR" property="apiScenarioExecuteUser" />
<result column="api_scenario_execute_result" jdbcType="VARCHAR" property="apiScenarioExecuteResult" />
<result column="api_scenario_execute_report_id" jdbcType="VARCHAR" property="apiScenarioExecuteReportId" />
<result column="pos" jdbcType="BIGINT" property="pos" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -78,7 +79,8 @@
<sql id="Base_Column_List">
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
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportApiScenarioExample" resultMap="BaseResultMap">
select
@ -116,13 +118,13 @@
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_report_id, pos)
values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{testPlanCollectionId,jdbcType=VARCHAR},
#{grouped,jdbcType=BIT}, #{environmentId,jdbcType=VARCHAR}, #{testPlanApiScenarioId,jdbcType=VARCHAR},
#{apiScenarioId,jdbcType=VARCHAR}, #{apiScenarioNum,jdbcType=BIGINT}, #{apiScenarioName,jdbcType=VARCHAR},
#{apiScenarioModule,jdbcType=VARCHAR}, #{apiScenarioPriority,jdbcType=VARCHAR},
#{apiScenarioExecuteUser,jdbcType=VARCHAR}, #{apiScenarioExecuteResult,jdbcType=VARCHAR},
#{apiScenarioExecuteReportId,jdbcType=VARCHAR})
#{apiScenarioExecuteReportId,jdbcType=VARCHAR}, #{pos,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportApiScenario">
insert into test_plan_report_api_scenario
@ -169,6 +171,9 @@
<if test="apiScenarioExecuteReportId != null">
api_scenario_execute_report_id,
</if>
<if test="pos != null">
pos,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -213,6 +218,9 @@
<if test="apiScenarioExecuteReportId != null">
#{apiScenarioExecuteReportId,jdbcType=VARCHAR},
</if>
<if test="pos != null">
#{pos,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportApiScenarioExample" resultType="java.lang.Long">
@ -266,6 +274,9 @@
<if test="record.apiScenarioExecuteReportId != null">
api_scenario_execute_report_id = #{record.apiScenarioExecuteReportId,jdbcType=VARCHAR},
</if>
<if test="record.pos != null">
pos = #{record.pos,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -333,6 +345,9 @@
<if test="apiScenarioExecuteReportId != null">
api_scenario_execute_report_id = #{apiScenarioExecuteReportId,jdbcType=VARCHAR},
</if>
<if test="pos != null">
pos = #{pos,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -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}
</update>
<insert id="batchInsert" parameterType="map">
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
<foreach collection="list" item="item" separator=",">
(#{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})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
@ -422,6 +438,9 @@
<if test="'api_scenario_execute_report_id'.toString() == column.value">
#{item.apiScenarioExecuteReportId,jdbcType=VARCHAR}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT}
</if>
</foreach>
)
</foreach>

View File

@ -14,6 +14,7 @@
<result column="function_case_bug_count" jdbcType="BIGINT" property="functionCaseBugCount" />
<result column="function_case_execute_result" jdbcType="VARCHAR" property="functionCaseExecuteResult" />
<result column="test_plan_collection_id" jdbcType="VARCHAR" property="testPlanCollectionId" />
<result column="pos" jdbcType="BIGINT" property="pos" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -76,7 +77,7 @@
<sql id="Base_Column_List">
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
</sql>
<select id="selectByExample" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCaseExample" resultMap="BaseResultMap">
select
@ -113,14 +114,14 @@
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_execute_result, test_plan_collection_id,
pos)
values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{testPlanFunctionCaseId,jdbcType=VARCHAR},
#{functionCaseId,jdbcType=VARCHAR}, #{functionCaseNum,jdbcType=BIGINT}, #{functionCaseName,jdbcType=VARCHAR},
#{functionCaseModule,jdbcType=VARCHAR}, #{functionCasePriority,jdbcType=VARCHAR},
#{functionCaseExecuteUser,jdbcType=VARCHAR}, #{functionCaseBugCount,jdbcType=BIGINT},
#{functionCaseExecuteResult,jdbcType=VARCHAR}, #{testPlanCollectionId,jdbcType=VARCHAR}
)
#{functionCaseExecuteResult,jdbcType=VARCHAR}, #{testPlanCollectionId,jdbcType=VARCHAR},
#{pos,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
insert into test_plan_report_function_case
@ -161,6 +162,9 @@
<if test="testPlanCollectionId != null">
test_plan_collection_id,
</if>
<if test="pos != null">
pos,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -199,6 +203,9 @@
<if test="testPlanCollectionId != null">
#{testPlanCollectionId,jdbcType=VARCHAR},
</if>
<if test="pos != null">
#{pos,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.plan.domain.TestPlanReportFunctionCaseExample" resultType="java.lang.Long">
@ -246,6 +253,9 @@
<if test="record.testPlanCollectionId != null">
test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR},
</if>
<if test="record.pos != null">
pos = #{record.pos,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -305,6 +316,9 @@
<if test="testPlanCollectionId != null">
test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR},
</if>
<if test="pos != null">
pos = #{pos,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -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}
</update>
<insert id="batchInsert" parameterType="map">
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
<foreach collection="list" item="item" separator=",">
(#{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})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
@ -384,6 +400,9 @@
<if test="'test_plan_collection_id'.toString() == column.value">
#{item.testPlanCollectionId,jdbcType=VARCHAR}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT}
</if>
</foreach>
)
</foreach>

View File

@ -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;

View File

@ -38,4 +38,7 @@ public class TestPlanReportGenPreParam {
@Schema(description = "计划组报告ID, 独立报告需要")
private String groupReportId;
@Schema(description = "是否手动生成报告")
private Boolean useManual;
}

View File

@ -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 id="getGroupExecuteCases" resultType="io.metersphere.plan.domain.TestPlanReportApiCase">
select tpac.id as testPlanApiCaseId, atc.id as apiCaseId, atc.num as apiCaseNum, atc.name as apiCaseName, atc.priority as apiCasePriority,
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
@ -42,7 +42,7 @@
<!-- ID、用例名称、所属模块、用例等级、执行人、执行结果、缺陷数 -->
select distinct tprac.api_case_id as id, tprac.api_case_num as num, tprac.api_case_name as name,
tprac.api_case_module as moduleName, tprac.api_case_priority as priority, tprac.api_case_execute_report_id reportId,
tprac.api_case_execute_result as executeResult, tprac.api_case_execute_user as executeUser
tprac.api_case_execute_result as executeResult, tprac.api_case_execute_user as executeUser, 0 as bugCount
from test_plan_report_api_case tprac
where tprac.test_plan_report_id = #{request.reportId}
<include refid="filter"/>
@ -58,6 +58,10 @@
and tprfc.function_case_execute_result in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
<when test="key == 'priority'">
and tprac.api_case_priority in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose>
</if>
</foreach>

View File

@ -11,7 +11,7 @@
select tpas.id as testPlanApiScenarioId, aso.id as apiScenarioId, aso.num as apiScenarioNum, aso.name as apiScenarioName, aso.priority as apiScenarioPriority,
tpas.test_plan_collection_id testPlanCollectionId, tpas.grouped grouped, tpas.environment_id environmentId,
if(aso.module_id = 'root','未规划用例', aso.module_id) as apiScenarioModule, tpas.execute_user as apiScenarioExecuteUser,
ifnull(tpas.last_exec_result, 'PENDING') as apiScenarioExecuteResult
ifnull(tpas.last_exec_result, 'PENDING') as apiScenarioExecuteResult, tpas.last_exec_report_id apiScenarioExecuteReportId, tpas.pos pos
from test_plan_api_scenario tpas join api_scenario aso on aso.id = tpas.api_scenario_id
left join api_scenario_module asm on aso.module_id = asm.id
where tpas.test_plan_id = #{id} and aso.deleted = false
@ -22,7 +22,7 @@
select tpas.id as testPlanApiScenarioId, aso.id as apiScenarioId, aso.num as apiScenarioNum, aso.name as apiScenarioName, aso.priority as apiScenarioPriority,
tpas.test_plan_collection_id testPlanCollectionId, tpas.grouped grouped, tpas.environment_id environmentId,
if(aso.module_id = 'root','未规划用例', aso.module_id) as apiScenarioModule, tpas.execute_user as apiScenarioExecuteUser,
ifnull(tpas.last_exec_result, 'PENDING') as apiScenarioExecuteResult
ifnull(tpas.last_exec_result, 'PENDING') as apiScenarioExecuteResult, tpas.last_exec_report_id apiScenarioExecuteReportId, tpas.pos pos
from test_plan_api_scenario tpas join api_scenario aso on aso.id = tpas.api_scenario_id
left join api_scenario_module asm on aso.module_id = asm.id
where aso.deleted = false and tpas.test_plan_id in
@ -41,7 +41,7 @@
<!-- ID、用例名称、所属模块、用例等级、执行人、执行结果、缺陷数 -->
select distinct tpras.api_scenario_id as id, tpras.api_scenario_num as num, tpras.api_scenario_name as name,
tpras.api_scenario_module as moduleName, tpras.api_scenario_priority as priority, tpras.api_scenario_execute_report_id reportId,
tpras.api_scenario_execute_result as executeResult, tpras.api_scenario_execute_user as executeUser
tpras.api_scenario_execute_result as executeResult, tpras.api_scenario_execute_user as executeUser, 0 as bugCount
from test_plan_report_api_scenario tpras
where tpras.test_plan_report_id = #{request.reportId}
<include refid="filter"/>
@ -57,6 +57,10 @@
and tpras.api_scenario_execute_result in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
<when test="key == 'priority'">
and tpras.api_scenario_priority in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose>
</if>
</foreach>

View File

@ -5,7 +5,7 @@
<select id="getPlanExecuteCases" resultType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
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 @@
<select id="getGroupPlanExecuteCases" resultType="io.metersphere.plan.domain.TestPlanReportFunctionCase">
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
@ -78,6 +78,10 @@
and tprfc.function_case_execute_result in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
<when test="key == 'priority'">
and tprfc.function_case_priority in
<include refid="io.metersphere.system.mapper.BaseMapper.filterInWrapper"/>
</when>
</choose>
</if>
</foreach>

View File

@ -81,6 +81,10 @@ public class TestPlanReportService {
private TestPlanReportSummaryMapper testPlanReportSummaryMapper;
@Resource
private TestPlanReportFunctionCaseMapper testPlanReportFunctionCaseMapper;
@Resource
private TestPlanReportApiCaseMapper testPlanReportApiCaseMapper;
@Resource
private TestPlanReportApiScenarioMapper testPlanReportApiScenarioMapper;
@Resource
private TestPlanReportBugMapper testPlanReportBugMapper;
@Resource
@ -184,7 +188,6 @@ public class TestPlanReportService {
}
private void deleteTestPlanReportBlobs(List<String> reportIdList) {
// todo 后续版本增加 api_case\ api_scenario 的清理
TestPlanReportSummaryExample summaryExample = new TestPlanReportSummaryExample();
summaryExample.createCriteria().andTestPlanReportIdIn(reportIdList);
testPlanReportSummaryMapper.deleteByExample(summaryExample);
@ -193,6 +196,14 @@ public class TestPlanReportService {
testPlanReportFunctionCaseExample.createCriteria().andTestPlanReportIdIn(reportIdList);
testPlanReportFunctionCaseMapper.deleteByExample(testPlanReportFunctionCaseExample);
TestPlanReportApiCaseExample testPlanReportApiCaseExample = new TestPlanReportApiCaseExample();
testPlanReportApiCaseExample.createCriteria().andTestPlanReportIdIn(reportIdList);
testPlanReportApiCaseMapper.deleteByExample(testPlanReportApiCaseExample);
TestPlanReportApiScenarioExample testPlanReportApiScenarioExample = new TestPlanReportApiScenarioExample();
testPlanReportApiScenarioExample.createCriteria().andTestPlanReportIdIn(reportIdList);
testPlanReportApiScenarioMapper.deleteByExample(testPlanReportApiScenarioExample);
TestPlanReportBugExample testPlanReportBugExample = new TestPlanReportBugExample();
testPlanReportBugExample.createCriteria().andTestPlanReportIdIn(reportIdList);
testPlanReportBugMapper.deleteByExample(testPlanReportBugExample);
@ -205,7 +216,7 @@ public class TestPlanReportService {
* @param currentUser 当前用户
*/
public void genReportByManual(TestPlanReportGenRequest request, String currentUser) {
genReport(request, false, currentUser, "/test-plan/report/gen");
genReport(request, true, currentUser, "/test-plan/report/gen");
}
/**
@ -215,10 +226,10 @@ public class TestPlanReportService {
* @param currentUser 当前用户
*/
public void genReportByExecution(TestPlanReportGenRequest request, String currentUser) {
genReport(request, true, currentUser, "/test-plan/report/gen");
genReport(request, false, currentUser, "/test-plan/report/gen");
}
public void genReport(TestPlanReportGenRequest request, boolean isExecute, String currentUser, String logPath) {
public void genReport(TestPlanReportGenRequest request, boolean manual, String currentUser, String logPath) {
// 所有计划
List<TestPlan> plans = getPlans(request.getTestPlanId());
// 模块参数
@ -235,13 +246,14 @@ public class TestPlanReportService {
plans.forEach(plan -> {
request.setTestPlanId(plan.getId());
TestPlanReportGenPreParam genPreParam = buildReportGenParam(request, plan, groupReportId.get());
genPreParam.setUseManual(manual);
TestPlanReport preReport = preGenReport(genPreParam, currentUser, logPath, moduleParam, childPlanIds);
if (genPreParam.getIntegrated()) {
// 如果是计划组的报告, 初始化组的报告ID
groupReportId.set(preReport.getId());
}
if (!isExecute) {
if (manual) {
// 汇总
summaryReport(preReport.getId());
// 手动生成的报告, 汇总结束后直接进行后置处理
@ -344,6 +356,12 @@ public class TestPlanReportService {
reportApiCase.setTestPlanReportId(report.getId());
reportApiCase.setApiCaseModule(moduleParam.getApiModuleMap().getOrDefault(reportApiCase.getApiCaseModule(),
ModuleTreeUtils.MODULE_PATH_PREFIX + reportApiCase.getApiCaseModule()));
if (!genParam.getUseManual()) {
// 接口执行时才更新结果
reportApiCase.setApiCaseExecuteResult(null);
reportApiCase.setApiCaseExecuteUser(null);
reportApiCase.setApiCaseExecuteReportId(IDGenerator.nextStr());
}
});
// 插入计划接口用例关联数据 -> 报告内容
TestPlanReportApiCaseMapper batchMapper = sqlSession.getMapper(TestPlanReportApiCaseMapper.class);
@ -363,6 +381,12 @@ public class TestPlanReportService {
reportApiScenario.setTestPlanReportId(report.getId());
reportApiScenario.setApiScenarioModule(moduleParam.getScenarioModuleMap().getOrDefault(reportApiScenario.getApiScenarioModule(),
ModuleTreeUtils.MODULE_PATH_PREFIX + reportApiScenario.getApiScenarioModule()));
if (!genParam.getUseManual()) {
// 接口执行时才更新结果
reportApiScenario.setApiScenarioExecuteResult(null);
reportApiScenario.setApiScenarioExecuteUser(null);
reportApiScenario.setApiScenarioExecuteReportId(IDGenerator.nextStr());
}
});
// 插入计划场景用例关联数据 -> 报告内容
TestPlanReportApiScenarioMapper batchMapper = sqlSession.getMapper(TestPlanReportApiScenarioMapper.class);
@ -372,24 +396,24 @@ public class TestPlanReportService {
// 计划报告缺陷内容
List<TestPlanReportBug> reportBugs;
if (genParam.getIntegrated()) {
reportBugs = extTestPlanReportBugMapper.getGroupBugs(childPlanIds);
reportBugs = CollectionUtils.isEmpty(childPlanIds) ? new ArrayList<>() : extTestPlanReportBugMapper.getGroupBugs(childPlanIds);
} else {
reportBugs = extTestPlanReportBugMapper.getPlanBugs(genParam.getTestPlanId());;
}
// MS处理人会与第三方的值冲突, 分开查询
List<SelectOption> headerOptions = bugCommonService.getHeaderHandlerOption(genParam.getProjectId());
Map<String, String> headerHandleUserMap = headerOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
List<SelectOption> localOptions = bugCommonService.getLocalHandlerOption(genParam.getProjectId());
Map<String, String> localHandleUserMap = localOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
Map<String, String> allStatusMap = bugCommonService.getAllStatusMap(genParam.getProjectId());
reportBugs.forEach(reportBug -> {
reportBug.setId(IDGenerator.nextStr());
reportBug.setTestPlanReportId(report.getId());
reportBug.setBugHandleUser(headerHandleUserMap.containsKey(reportBug.getBugHandleUser()) ?
headerHandleUserMap.get(reportBug.getBugHandleUser()) : localHandleUserMap.get(reportBug.getBugHandleUser()));
reportBug.setBugStatus(allStatusMap.get(reportBug.getBugStatus()));
});
if (CollectionUtils.isNotEmpty(reportBugs)) {
// MS处理人会与第三方的值冲突, 分开查询
List<SelectOption> headerOptions = bugCommonService.getHeaderHandlerOption(genParam.getProjectId());
Map<String, String> headerHandleUserMap = headerOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
List<SelectOption> localOptions = bugCommonService.getLocalHandlerOption(genParam.getProjectId());
Map<String, String> localHandleUserMap = localOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
Map<String, String> allStatusMap = bugCommonService.getAllStatusMap(genParam.getProjectId());
reportBugs.forEach(reportBug -> {
reportBug.setId(IDGenerator.nextStr());
reportBug.setTestPlanReportId(report.getId());
reportBug.setBugHandleUser(headerHandleUserMap.containsKey(reportBug.getBugHandleUser()) ?
headerHandleUserMap.get(reportBug.getBugHandleUser()) : localHandleUserMap.get(reportBug.getBugHandleUser()));
reportBug.setBugStatus(allStatusMap.get(reportBug.getBugStatus()));
});
// 插入计划关联用例缺陷数据(去重) -> 报告内容
TestPlanReportBugMapper batchMapper = sqlSession.getMapper(TestPlanReportBugMapper.class);
batchMapper.batchInsert(reportBugs);
@ -452,10 +476,10 @@ public class TestPlanReportService {
/*
* 统计用例执行数据
*/
planReportDetail.setFunctionalCount(JSON.parseObject(new String(reportSummary.getFunctionalExecuteResult()), CaseCount.class));
planReportDetail.setApiCaseCount(JSON.parseObject(new String(reportSummary.getApiExecuteResult()), CaseCount.class));
planReportDetail.setApiScenarioCount(JSON.parseObject(new String(reportSummary.getScenarioExecuteResult()), CaseCount.class));
planReportDetail.setExecuteCount(JSON.parseObject(new String(reportSummary.getExecuteResult()), CaseCount.class));
planReportDetail.setFunctionalCount(reportSummary.getFunctionalExecuteResult() == null ? CaseCount.builder().build() : JSON.parseObject(new String(reportSummary.getFunctionalExecuteResult()), CaseCount.class));
planReportDetail.setApiCaseCount(reportSummary.getApiExecuteResult() == null ? CaseCount.builder().build() : JSON.parseObject(new String(reportSummary.getApiExecuteResult()), CaseCount.class));
planReportDetail.setApiScenarioCount(reportSummary.getScenarioExecuteResult() == null ? CaseCount.builder().build() : JSON.parseObject(new String(reportSummary.getScenarioExecuteResult()), CaseCount.class));
planReportDetail.setExecuteCount(reportSummary.getExecuteResult() == null ? CaseCount.builder().build() : JSON.parseObject(new String(reportSummary.getExecuteResult()), CaseCount.class));
return planReportDetail;
}

View File

@ -308,7 +308,7 @@ public class TestPlanService extends TestPlanBaseUtilsService {
historyExample.createCriteria().andTestPlanIdIn(testPlanIds);
testPlanCaseExecuteHistoryMapper.deleteByExample(historyExample);
//删除测试计划报告 todo: 正式版增加接口用例报告接口场景报告的清理
//删除测试计划报告
testPlanReportService.deleteByTestPlanIds(testPlanIds);
//删除定时任务
scheduleService.deleteByResourceIds(testPlanIds, TestPlanScheduleJob.class.getName());