From 9837330cf6e48c27c0c3f93b80ce977599ec14b7 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 19 Dec 2024 14:03:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=94=A8=E4=BE=8B=E8=AF=A6=E6=83=85=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E5=88=97=E8=A1=A8=E8=BF=87=E6=BB=A4=E6=8E=89=E5=9B=9E?= =?UTF-8?q?=E6=94=B6=E7=AB=99=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1050549 --user=宋昌昌 【测试计划】计划-计划详情-功能用例详情-缺陷列表-缺陷删除后,该缺陷列表还显示关联缺陷 https://www.tapd.cn/55049933/s/1634413 --- .../io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml | 4 ++-- .../plan/service/TestPlanFunctionalCaseService.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml index 4f40a08c96..c6e64ca2e9 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml @@ -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 + b.deleted = false and brc.test_plan_case_id = #{request.testPlanCaseId} - and b.title like concat('%', #{request.keyword},'%') diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java index c6e487cb5b..dea41d35be 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java @@ -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 associateBugs = hasAssociateBugPage(associateBugPageRequest); + response.setBugListCount(CollectionUtils.isNotEmpty(associateBugs) ? associateBugs.size() : 0); return response; }