refactor(用例管理): 增加测试计划执行历史的计划id的获取

This commit is contained in:
guoyuqi 2024-05-14 15:04:12 +08:00 committed by 刘瑞斌
parent fa35b376f7
commit 7110f47191
5 changed files with 33 additions and 1 deletions

View File

@ -25,4 +25,8 @@ public class TestPlanCaseExecuteHistoryDTO extends TestPlanCaseExecuteHistory {
@Schema(description = "测试计划名称")
private String testPlanName;
@Schema(description = "测试计划id")
private String testPlanId;
}

View File

@ -91,6 +91,7 @@
u.name as userName,
ux.avatar as userLogo,
tp.name as testPlanName,
tp.id as testPlanId,
u.email as email
FROM
test_plan_case_execute_history tpceh

View File

@ -0,0 +1,10 @@
package io.metersphere.plan.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtTestPlanCaseExecuteHistoryMapper {
void updateDeleted(@Param("testPlanCaseIds") List<String> testPlanCaseIds, @Param("deleted") boolean deleted);
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.plan.mapper.ExtTestPlanCaseExecuteHistoryMapper">
<update id="updateDeleted">
UPDATE
test_plan_case_execute_history
SET deleted =#{deleted}
WHERE test_plan_case_id IN
<foreach collection="testPlanCaseIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>

View File

@ -101,6 +101,8 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
@Resource
private TestPlanCaseExecuteHistoryMapper testPlanCaseExecuteHistoryMapper;
@Resource
private ExtTestPlanCaseExecuteHistoryMapper extTestPlanCaseExecuteHistoryMapper;
@Resource
private FunctionalCaseAttachmentService functionalCaseAttachmentService;
@Resource
private TestPlanSendNoticeService testPlanSendNoticeService;
@ -140,7 +142,7 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
BugRelationCaseExample example = new BugRelationCaseExample();
example.createCriteria().andTestPlanCaseIdIn(associationParam.getResourceIdList());
bugRelationCaseMapper.deleteByExample(example);
//TODO:更新执行历史的删除状态为true
extTestPlanCaseExecuteHistoryMapper.updateDeleted(associationParam.getResourceIdList(), true);
}
public TestPlanResourceSortResponse sortNode(ResourceSortRequest request, LogInsertModule logInsertModule) {