From 9470dc6027ec6d4128fd47965a3e5a0703c18f88 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 10 May 2024 15:13:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E7=94=A8=E4=BE=8B=E8=AF=A6=E6=83=85=E5=85=B3=E8=81=94?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=95=B0=E9=87=8F=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=85=B3=E8=81=94=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/service/FunctionalCaseService.java | 5 +++++ .../components/tabContent/tabBug/tabDefect.vue | 2 +- .../components/tabContent/tabTestPlan.vue | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java index 4867715d7c..5910320d24 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java @@ -390,6 +390,11 @@ public class FunctionalCaseService { BugRelationCaseExample bugRelationCaseExample = new BugRelationCaseExample(); bugRelationCaseExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId()); functionalCaseDetailDTO.setBugCount((int) bugRelationCaseMapper.countByExample(bugRelationCaseExample)); + //获取在测试计划中关联缺陷的数量 + bugRelationCaseExample = new BugRelationCaseExample(); + bugRelationCaseExample.createCriteria().andTestPlanCaseIdEqualTo(functionalCaseDetailDTO.getId()); + long planBugCount = bugRelationCaseMapper.countByExample(bugRelationCaseExample); + functionalCaseDetailDTO.setBugCount(functionalCaseDetailDTO.getBugCount() + (int) planBugCount); //获取已关联依赖关系数量 FunctionalCaseRelationshipEdgeExample relationshipEdgeExample = new FunctionalCaseRelationshipEdgeExample(); relationshipEdgeExample.createCriteria() diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue index e20daa0f86..47d20943c8 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/tabDefect.vue @@ -562,7 +562,7 @@ // 去测试计划页面 function goToPlan(record: BugListItem) { router.push({ - name: TestPlanRouteEnum.TEST_PLAN_INDEX, + name: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL, query: { ...route.query, id: record.testPlanId, diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue index 363cd36ba0..a5266a633f 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue @@ -249,7 +249,7 @@ // 去测试计划页面 function goToPlan(record: AssociateFunctionalCaseItem) { router.push({ - name: TestPlanRouteEnum.TEST_PLAN_INDEX, + name: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL, query: { ...route.query, id: record.testPlanId,