From 8ee1f1abc3a949dcfc7052716d718c97c670b9de Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 6 Mar 2024 14:44:27 +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=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1036810 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036810 --bug=1036809 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036809 --bug=1036783 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036783 --bug=1036746 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036746 --bug=1036642 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036642 --- .../controller/FunctionalCaseController.java | 2 +- .../FunctionalCaseModuleController.java | 2 +- .../mapper/ExtFunctionalCaseMapper.java | 2 +- .../mapper/ExtFunctionalCaseMapper.xml | 2 +- .../service/FunctionalCaseModuleService.java | 10 ++--- .../FunctionalCaseModuleControllerTests.java | 2 +- .../components/caseTable.vue | 19 +++++----- .../components/recycleCaseTable.vue | 37 ++++++++++--------- .../tabContent/tabChangeHistory.vue | 4 +- 9 files changed, 41 insertions(+), 39 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java index eebece18c2..f2b0867902 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java @@ -246,7 +246,7 @@ public class FunctionalCaseController { @CheckOwner(resourceId = "#request.getSourceId()", resourceType = "functional_case") public Pager> operationHistoryList(@Validated @RequestBody OperationHistoryRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - org.apache.commons.lang3.StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); + StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); return PageUtils.setPageInfo(page, functionalCaseService.operationHistoryList(request)); } } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseModuleController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseModuleController.java index a0252e7405..3c27f699b1 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseModuleController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseModuleController.java @@ -62,7 +62,7 @@ public class FunctionalCaseModuleController { @RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ_DELETE) @CheckOwner(resourceId = "#moduleId", resourceType = "functional_case_module") public void deleteNode(@PathVariable String moduleId) { - functionalCaseModuleService.deleteModule(moduleId); + functionalCaseModuleService.deleteModule(moduleId, SessionUtils.getUserId()); } @GetMapping("/trash/tree/{projectId}") diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.java b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.java index 25c6589017..f3d8ca2c47 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.java @@ -27,7 +27,7 @@ public interface ExtFunctionalCaseMapper { List getFunctionalCaseIds(@Param("projectId") String projectId); - void removeToTrashByModuleIds(@Param("moduleIds") List deleteIds); + void removeToTrashByModuleIds(@Param("moduleIds") List deleteIds, @Param("userId") String userId); List checkCaseByModuleIds(@Param("moduleIds") List deleteIds); 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 b447aeff16..f514ddfc27 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 @@ -77,7 +77,7 @@ - UPDATE functional_case SET deleted = true, module_id = 'root' WHERE module_id IN + UPDATE functional_case SET deleted = true, module_id = 'root', delete_time = unix_timestamp()*1000, delete_user = #{userId} WHERE module_id IN #{id} diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleService.java index b2695b3413..e4798d9145 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleService.java @@ -117,10 +117,10 @@ public class FunctionalCaseModuleService extends ModuleTreeService { super.sort(nodeSortDTO); } - public void deleteModule(String moduleId) { + public void deleteModule(String moduleId, String userId) { FunctionalCaseModule deleteModule = functionalCaseModuleMapper.selectByPrimaryKey(moduleId); if (deleteModule != null) { - List functionalCases = this.deleteModuleByIds(Collections.singletonList(moduleId), new ArrayList<>()); + List functionalCases = this.deleteModuleByIds(Collections.singletonList(moduleId), new ArrayList<>(), userId); batchDelLog(functionalCases, deleteModule.getProjectId()); } } @@ -145,7 +145,7 @@ public class FunctionalCaseModuleService extends ModuleTreeService { operationLogService.batchAdd(dtoList); } - public List deleteModuleByIds(List deleteIds, List functionalCases) { + public List deleteModuleByIds(List deleteIds, List functionalCases, String userId) { if (CollectionUtils.isEmpty(deleteIds)) { return functionalCases; } @@ -156,10 +156,10 @@ public class FunctionalCaseModuleService extends ModuleTreeService { if (CollectionUtils.isNotEmpty(functionalCaseList)) { functionalCases.addAll(functionalCaseList); } - extFunctionalCaseMapper.removeToTrashByModuleIds(deleteIds); + extFunctionalCaseMapper.removeToTrashByModuleIds(deleteIds, userId); List childrenIds = extFunctionalCaseModuleMapper.selectChildrenIdsByParentIds(deleteIds); if (CollectionUtils.isNotEmpty(childrenIds)) { - deleteModuleByIds(childrenIds, functionalCases); + deleteModuleByIds(childrenIds, functionalCases, userId); } return functionalCases; } diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseModuleControllerTests.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseModuleControllerTests.java index c2e97f02f1..dd7326c91f 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseModuleControllerTests.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseModuleControllerTests.java @@ -702,7 +702,7 @@ public class FunctionalCaseModuleControllerTests extends BaseTest { this.requestGetWithOk(URL_MODULE_TREE_DELETE + ModuleConstants.DEFAULT_NODE_ID); //service层判断:测试删除空集合 - functionalCaseModuleService.deleteModuleByIds(new ArrayList<>(), new ArrayList<>()); + functionalCaseModuleService.deleteModuleByIds(new ArrayList<>(), new ArrayList<>(), "admin"); checkLog(functionalCase.getId(), OperationLogType.DELETE, URL_MODULE_TREE_DELETE); diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue index 63c2291972..904a1da9c8 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue @@ -522,15 +522,15 @@ width: 200, showDrag: true, }, - { - title: 'caseManagement.featureCase.tableColumnExecutionResult', - dataIndex: 'lastExecuteResult', - slotName: 'lastExecuteResult', - titleSlotName: 'executeResultFilter', - showInTable: true, - width: 200, - showDrag: true, - }, + // { + // title: 'caseManagement.featureCase.tableColumnExecutionResult', + // dataIndex: 'lastExecuteResult', + // slotName: 'lastExecuteResult', + // titleSlotName: 'executeResultFilter', + // showInTable: true, + // width: 200, + // showDrag: true, + // }, // { // title: 'caseManagement.featureCase.tableColumnVersion', // slotName: 'versionName', @@ -1094,6 +1094,7 @@ projectId: currentProjectId.value, selectIds: selectAll ? [] : selectedIds, excludeIds: excludeIds || [], + moduleIds: props.activeFolder === 'all' ? [] : [props.activeFolder, ...props.offspringIds], condition: { keyword: keyword.value, filter: propsRes.value.filter, diff --git a/frontend/src/views/case-management/caseManagementFeature/components/recycleCaseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/recycleCaseTable.vue index 80a21a5fa7..d087874be5 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/recycleCaseTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/recycleCaseTable.vue @@ -381,24 +381,24 @@ width: 200, showDrag: true, }, - { - title: 'caseManagement.featureCase.tableColumnExecutionResult', - dataIndex: 'lastExecuteResult', - slotName: 'lastExecuteResult', - titleSlotName: 'executeResultFilter', - showInTable: true, - width: 200, - showDrag: true, - }, - { - title: 'caseManagement.featureCase.tableColumnVersion', - slotName: 'versionName', - dataIndex: 'versionName', - width: 300, - showTooltip: true, - showInTable: true, - showDrag: true, - }, + // { + // title: 'caseManagement.featureCase.tableColumnExecutionResult', + // dataIndex: 'lastExecuteResult', + // slotName: 'lastExecuteResult', + // titleSlotName: 'executeResultFilter', + // showInTable: true, + // width: 200, + // showDrag: true, + // }, + // { + // title: 'caseManagement.featureCase.tableColumnVersion', + // slotName: 'versionName', + // dataIndex: 'versionName', + // width: 300, + // showTooltip: true, + // showInTable: true, + // showDrag: true, + // }, { title: 'caseManagement.featureCase.tableColumnModule', slotName: 'moduleId', @@ -476,6 +476,7 @@ showInTable: true, sortable: { sortDirections: ['ascend', 'descend'], + sorter: true, }, width: 200, showDrag: true, diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue index 528d9a07eb..2842b4f27b 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue @@ -240,8 +240,8 @@ setLoadListParams({ projectId: appStore.currentProjectId, sourceId: props.caseId, - type: ['IMPORT', 'ADD', 'UPDATE'], - module: ['CASE_MANAGEMENT_CASE_CREATE', 'CASE_MANAGEMENT_CASE_UPDATE'], + types: ['IMPORT', 'ADD', 'UPDATE'], + modules: ['CASE_MANAGEMENT_CASE_CREATE', 'CASE_MANAGEMENT_CASE_UPDATE'], }); await loadList(); featureCaseStore.getCaseCounts(props.caseId);