From 5551cbde21071cc738fbe7e401e971c43a57fb0a Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Mon, 29 Jan 2024 16:53:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E8=AF=84=E5=AE=A1=E4=BA=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/service/CaseReviewFunctionalCaseService.java | 4 +++- .../controller/CaseReviewFunctionalCaseControllerTests.java | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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