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