From cdd22425e715043ce88c21aab06c36b8bdb8a005 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 24 Apr 2024 18:56:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1040041 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001040041 --bug=1040039 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001040039 --- .../functional/mapper/ExtCaseReviewMapper.xml | 7 +++---- .../functional/service/CaseReviewService.java | 4 ++++ .../controller/CaseReviewControllerTests.java | 3 +++ .../src/models/caseManagement/caseReview.ts | 2 -- .../caseReview/components/index/reviewTable.vue | 17 +++++++++++++++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewMapper.xml index 2a574c94e2..4bd314d456 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewMapper.xml @@ -174,18 +174,17 @@ and case_review.status in - + and case_review.review_pass_rule in - + and case_review.create_user in - + and case_review.id in ( select case_review_user.review_id from case_review_user where case_review_user.user_id in - in #{value} diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java index 1fb06a4610..78ef911948 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java @@ -26,6 +26,7 @@ import io.metersphere.system.uid.NumGenerator; import io.metersphere.system.utils.ServiceUtils; import jakarta.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; @@ -588,6 +589,9 @@ public class CaseReviewService { public void batchMoveCaseReview(CaseReviewBatchRequest request, String userId) { List ids; + if (StringUtils.isBlank(request.getMoveModuleId())) { + throw new MSException(Translator.get("functional_case.module_id.not_blank")); + } if (request.isSelectAll()) { ids = extCaseReviewMapper.getIds(request, request.getProjectId()); if (CollectionUtils.isNotEmpty(request.getExcludeIds())) { diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java index 4b6aa6cca0..007c3c6f38 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewControllerTests.java @@ -613,6 +613,9 @@ public class CaseReviewControllerTests extends BaseTest { caseReviews = getCaseReviews("创建评审更新1"); String moduleIdNewOne = caseReviews.get(0).getModuleId(); Assertions.assertTrue(StringUtils.equals(moduleIdNewOne, moduleIdNew)); + request.setMoveModuleId(null); + request.setSelectAll(false); + this.requestPost(BATCH_MOVE_CASE_REVIEW, request).andExpect(status().is5xxServerError()); } @Test diff --git a/frontend/src/models/caseManagement/caseReview.ts b/frontend/src/models/caseManagement/caseReview.ts index 4fbb4e528e..3ddfd09295 100644 --- a/frontend/src/models/caseManagement/caseReview.ts +++ b/frontend/src/models/caseManagement/caseReview.ts @@ -94,9 +94,7 @@ export interface FollowReviewParams { } // 批量操作评审参数 export interface BatchMoveReviewParams extends BatchApiParams { - projectId: string; moveModuleId: string; // 移动到的评审模块id - moduleIds: string[]; } // 评审拖拽排序类型 export type ReviewMoveMode = 'BEFORE' | 'AFTER' | 'APPEND'; diff --git a/frontend/src/views/case-management/caseReview/components/index/reviewTable.vue b/frontend/src/views/case-management/caseReview/components/index/reviewTable.vue index e72b48bcf9..24288ff84b 100644 --- a/frontend/src/views/case-management/caseReview/components/index/reviewTable.vue +++ b/frontend/src/views/case-management/caseReview/components/index/reviewTable.vue @@ -495,6 +495,7 @@ width: hasOperationPermission.value ? 110 : 50, }, ]; + const selectedModuleKeys = ref([]); const tableStore = useTableStore(); await tableStore.initColumn(TableKeyEnum.CASE_MANAGEMENT_REVIEW, columns, 'drawer', true); const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable( @@ -546,7 +547,6 @@ moduleIds = [props.activeFolder, ...props.offspringIds]; } } - const params = { keyword: keyword.value, projectId: appStore.currentProjectId, @@ -677,12 +677,25 @@ } const moveModalVisible = ref(false); - const selectedModuleKeys = ref([]); + const batchMoveFileLoading = ref(false); async function handleReviewMove() { try { batchMoveFileLoading.value = true; + tableQueryParams.value = { + ...tableQueryParams.value, + moveModuleId: selectedModuleKeys.value[0], + selectIds: batchParams.value?.selectedIds || [], + selectAll: !!batchParams.value?.selectAll, + excludeIds: batchParams.value?.excludeIds || [], + currentSelectCount: batchParams.value?.currentSelectCount || 0, + condition: { + keyword: keyword.value, + filter: { status: statusFilters.value, reviewers: reviewersFilters.value }, + combine: batchParams.value.condition, + }, + }; await moveReview({ ...tableQueryParams.value, });