fix(测试计划): 计划用例详情缺陷列表过滤掉回收站的缺陷

--bug=1050549 --user=宋昌昌 【测试计划】计划-计划详情-功能用例详情-缺陷列表-缺陷删除后,该缺陷列表还显示关联缺陷 https://www.tapd.cn/55049933/s/1634413
This commit is contained in:
song-cc-rock 2024-12-19 14:03:07 +08:00 committed by Craftsman
parent 422c016e67
commit 9837330cf6
2 changed files with 7 additions and 3 deletions

View File

@ -298,12 +298,12 @@
bug_relation_case brc
INNER JOIN bug b ON brc.bug_id = b.id
INNER JOIN bug_content bc ON brc.bug_id = bc.bug_id
left join test_plan tp on brc.test_plan_id = tp.id
LEFT JOIN test_plan tp on brc.test_plan_id = tp.id
LEFT JOIN user createUser ON b.create_user = createUser.id
<where>
b.deleted = false
<if test="request.testPlanCaseId != null and request.testPlanCaseId != ''">
and brc.test_plan_case_id = #{request.testPlanCaseId}
</if>
<if test="request.keyword != null and request.keyword != ''">
and b.title like concat('%', #{request.keyword},'%')

View File

@ -700,7 +700,11 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
testPlanCaseExecuteHistoryExample.createCriteria().andCaseIdEqualTo(caseId).andTestPlanCaseIdEqualTo(id).andDeletedEqualTo(false);
testPlanCaseExecuteHistoryExample.setOrderByClause("create_time DESC");
response.setRunListCount((int) testPlanCaseExecuteHistoryMapper.countByExample(testPlanCaseExecuteHistoryExample));
response.setBugListCount(getBugListCount(id, planFunctionalCase.getTestPlanId()));
AssociateBugPageRequest associateBugPageRequest = new AssociateBugPageRequest();
associateBugPageRequest.setTestPlanCaseId(id);
associateBugPageRequest.setProjectId(functionalCaseDetail.getProjectId());
List<BugProviderDTO> associateBugs = hasAssociateBugPage(associateBugPageRequest);
response.setBugListCount(CollectionUtils.isNotEmpty(associateBugs) ? associateBugs.size() : 0);
return response;
}