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); }