From 486575eb6abb4eec9652f10cb360cab7860e2887 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Fri, 26 Jan 2024 11:05:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B):?= =?UTF-8?q?=20=E5=90=8E=E7=AB=AF=E5=A4=84=E7=90=86=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E5=85=B3=E8=81=94=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=B7=B2=E5=85=B3=E8=81=94ids?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ExtFunctionalCaseMapper.xml | 18 ++++++++---------- .../request/FunctionalCasePageRequest.java | 4 ++-- ...aseReviewFunctionalCaseControllerTests.java | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml index 0d4820cb4d..76c440a8f5 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml @@ -127,11 +127,10 @@ ) - - AND functional_case.id not in - - #{excludeId} - + + AND functional_case.id not in ( + select case_id from case_review_functional_case where review_id = #{request.reviewId} + ) @@ -594,11 +593,10 @@ ) - - AND id not in - - #{excludeId} - + + AND functional_case.id not in ( + select case_id from case_review_functional_case where review_id = #{request.reviewId} + ) GROUP BY module_id diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java index bd137db5a1..072394bb3c 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java @@ -41,8 +41,8 @@ public class FunctionalCasePageRequest extends BasePageRequest implements Serial @Schema(description = "关联缺陷") private AssociationDTO associationBug; - @Schema(description = "排除ids") - private List excludeIds; + @Schema(description = "评审id") + private String reviewId; diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java index 85bc6752c5..6fbe403801 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java @@ -77,7 +77,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { request.setProjectId("100001100001"); request.setCurrent(1); request.setPageSize(10); - request.setExcludeIds(Arrays.asList("TEST_FUNCTIONAL_CASE_ID_1")); + request.setReviewId("wx_review_id_1"); Map map = new HashMap<>(); map.put("customs", Arrays.asList(new LinkedHashMap() {{ put("id", "TEST_FIELD_ID"); @@ -86,7 +86,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { put("type", "List"); }})); request.setCombine(map); - this.requestPost(FUNCTIONAL_CASE_LIST_URL, request); + this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_LIST_URL, request); }