diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java index ae58cd4a3c..e91e883200 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java @@ -568,7 +568,9 @@ public class CaseReviewFunctionalCaseService { list.add(caseUser); }); }); - caseReviewFunctionalCaseUserMapper.batchInsert(list); + if (CollectionUtils.isNotEmpty(list)) { + caseReviewFunctionalCaseUserMapper.batchInsert(list); + } } else { //更新评审人 extCaseReviewFunctionalCaseUserMapper.deleteByCaseIds(caseIds, request.getReviewId()); 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 faaa254dae..e9f6824023 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 @@ -369,6 +369,11 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { request.setReviewerId(List.of("wx11")); request.setSelectIds(List.of("wx_test_10")); this.requestPostWithOkAndReturn(BATCH_EDIT_REVIEWERS, request); + //覆盖率 + request.setReviewId("wx_review_id_4"); + request.setReviewerId(List.of("wx11")); + request.setSelectIds(List.of("wx_test_10")); + this.requestPostWithOkAndReturn(BATCH_EDIT_REVIEWERS, request); } @Test