From 39f48e35830be05d5db384204bdc2993d962d076 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 23 Mar 2021 11:40:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/base/mapper/ext/ExtTestCaseMapper.xml | 5 ++++- .../track/request/testcase/QueryTestCaseRequest.java | 2 ++ .../io/metersphere/track/service/TestCaseService.java | 10 ++++++++-- .../components/track/case/components/TestCaseList.vue | 4 ++++ .../track/home/components/RelevanceCaseCard.vue | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) 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 22a4d71d62..82948829e2 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 @@ -306,9 +306,12 @@ or test_case.num like CONCAT('%', #{request.name},'%') or test_case.tags like CONCAT('%', #{request.name},'%')) - + and test_case.id in (select test_case_id from test_case_test where test_case_test.create_time >= #{request.createTime}) + + and test_case.create_time >= #{request.createTime} + and test_case.node_id in diff --git a/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java b/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java index e024a581b0..69cbe332a8 100644 --- a/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java @@ -24,8 +24,10 @@ public class QueryTestCaseRequest extends BaseQueryRequest { private String reviewId; private boolean isSelectThisWeedData = false; + private boolean isSelectThisWeedRelevanceData = false; private String caseCoverage; private long createTime = 0; + private long relevanceCreateTime = 0; } diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 4956b8c653..958c40d87a 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -210,13 +210,19 @@ public class TestCaseService { */ private void initRequest(QueryTestCaseRequest request, boolean checkThisWeekData) { if (checkThisWeekData) { + Map weekFirstTimeAndLastTime = DateUtils.getWeedFirstTimeAndLastTime(new Date()); + Date weekFirstTime = weekFirstTimeAndLastTime.get("firstTime"); if (request.isSelectThisWeedData()) { - Map weekFirstTimeAndLastTime = DateUtils.getWeedFirstTimeAndLastTime(new Date()); - Date weekFirstTime = weekFirstTimeAndLastTime.get("firstTime"); if (weekFirstTime != null) { request.setCreateTime(weekFirstTime.getTime()); } } + if (request.isSelectThisWeedRelevanceData()) { + if (weekFirstTime != null) { + request.setRelevanceCreateTime(weekFirstTime.getTime()); + } + } + } } diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 3c767df70e..46d95aecf2 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -409,11 +409,15 @@ export default { getData() { this.getSelectDataRange(); this.condition.selectThisWeedData = false; + this.condition.selectThisWeedRelevanceData = false; this.condition.caseCoverage = null; switch (this.selectDataRange) { case 'thisWeekCount': this.condition.selectThisWeedData = true; break; + case 'thisWeekRelevanceCount': + this.condition.selectThisWeedRelevanceData = true; + break; case 'uncoverage': this.condition.caseCoverage = 'uncoverage'; break; diff --git a/frontend/src/business/components/track/home/components/RelevanceCaseCard.vue b/frontend/src/business/components/track/home/components/RelevanceCaseCard.vue index be96f80db9..12b2518244 100644 --- a/frontend/src/business/components/track/home/components/RelevanceCaseCard.vue +++ b/frontend/src/business/components/track/home/components/RelevanceCaseCard.vue @@ -40,7 +40,7 @@ {{$t('api_test.home_page.api_details_card.this_week_add')}} - {{relevanceCountData.thisWeekAddedCount}} + {{relevanceCountData.thisWeekAddedCount}} {{$t('api_test.home_page.unit_of_measurement')}}