From c671c8a5572156437ce133f5858f59738843583a Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 30 Sep 2020 11:20:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E7=94=A8=E4=BE=8B=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E6=97=B6=E4=BC=9A=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/service/TestCaseReviewService.java | 20 ++++++++++++------- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java index d0b7e590f9..74f1c842a6 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseReviewService.java @@ -272,14 +272,20 @@ public class TestCaseReviewService { List projects = projectMapper.selectByExample(projectExample); List projectIds = projects.stream().map(Project::getId).collect(Collectors.toList()); - TestCaseReviewProjectExample testCaseReviewProjectExample = new TestCaseReviewProjectExample(); - testCaseReviewProjectExample.createCriteria().andProjectIdIn(projectIds); - List testCaseReviewProjects = testCaseReviewProjectMapper.selectByExample(testCaseReviewProjectExample); - List reviewIds = testCaseReviewProjects.stream().map(TestCaseReviewProject::getReviewId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(projectIds)) { + TestCaseReviewProjectExample testCaseReviewProjectExample = new TestCaseReviewProjectExample(); + testCaseReviewProjectExample.createCriteria().andProjectIdIn(projectIds); + List testCaseReviewProjects = testCaseReviewProjectMapper.selectByExample(testCaseReviewProjectExample); + List reviewIds = testCaseReviewProjects.stream().map(TestCaseReviewProject::getReviewId).collect(Collectors.toList()); - TestCaseReviewExample testCaseReviewExample = new TestCaseReviewExample(); - testCaseReviewExample.createCriteria().andIdIn(reviewIds); - return testCaseReviewMapper.selectByExample(testCaseReviewExample); + if (!CollectionUtils.isEmpty(reviewIds)) { + TestCaseReviewExample testCaseReviewExample = new TestCaseReviewExample(); + testCaseReviewExample.createCriteria().andIdIn(reviewIds); + return testCaseReviewMapper.selectByExample(testCaseReviewExample); + } + } + + return new ArrayList<>(); } public void testReviewRelevance(ReviewRelevanceRequest request) { diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index cf6b065263..c2dacf960c 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit cf6b06526324326a563d933e07118fac014a63b4 +Subproject commit c2dacf960cdb1ed35664bdd3432120b1203b73d8 diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 06d935cd1d..cc38137a69 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1 +Subproject commit cc38137a69a0f20fadece9c0f9f50a9468c4ace9