From 091b03c0eea69db0fc1b2f4c4b5789cf52cc275a Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 3 Aug 2022 10:52:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BC=BA=E9=99=B7=E6=95=B0=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E7=BB=9F=E8=AE=A1=E5=B7=B2=E5=85=B3=E9=97=AD=E7=9A=84?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015398 --user=李玉号 【测试跟踪】首页缺陷数应该不统计已关闭的缺陷 https://www.tapd.cn/55049933/s/1218089 --- .../ext/ExtCustomFieldTemplateMapper.java | 2 + .../ext/ExtCustomFieldTemplateMapper.xml | 7 +++ .../base/mapper/ext/ExtTestCaseMapper.java | 2 +- .../base/mapper/ext/ExtTestCaseMapper.xml | 6 +- .../commons/constants/SystemCustomField.java | 9 +++ .../service/CustomFieldService.java | 35 +++++++++-- .../service/CustomFieldTemplateService.java | 4 ++ .../track/service/IssuesService.java | 59 ++++++++++++------- .../track/service/TrackService.java | 25 +++++--- 9 files changed, 113 insertions(+), 36 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/commons/constants/SystemCustomField.java diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.java index af2697c45e..ab3c5bcc86 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.java @@ -13,4 +13,6 @@ public interface ExtCustomFieldTemplateMapper { List list(@Param("request") CustomFieldTemplate request); List lisSimple(@Param("request") CustomFieldTemplate request); + + List getSystemCustomField(@Param("templateId") String templateId, @Param("fieldName") String fieldName); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml index 742abe654d..7508fdc110 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml @@ -31,4 +31,11 @@ where cft.template_id = #{request.templateId} + diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java index 0bf4521b2a..6605adda9e 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java @@ -94,7 +94,7 @@ public interface ExtTestCaseMapper { List countRelevanceMaintainer(@Param("projectId") String projectId); - int getTestPlanBug(@Param("planId") String planId); + List getTestPlanBug(@Param("planId") String planId); int getTestPlanCase(@Param("planId") String planId); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index 87e4a13a4a..55caf288c4 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -859,8 +859,8 @@ and tc.status != 'Trash' and tc.latest = 1 and tc.id in (select distinct test_case_test.test_case_id from test_case_test) group by tc.maintainer - + select distinct tci.issues_id from test_plan_test_case tptc join test_case_issues tci on tptc.id = tci.resource_id right join test_case @@ -868,8 +868,6 @@ join issues on tci.issues_id = issues.id where tptc.plan_id = #{planId} - and (issues.status != 'closed' - or issues.status is null) and test_case.status != 'Trash';