diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java index 90491495c5..775c04f8b4 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java @@ -579,8 +579,8 @@ public class FunctionalCaseMinderService { beforeNode = sources; afterNode = new ArrayList<>(); } else { - beforeNode = sources.subList(0, targetIndex-1); - afterNode = sources.subList(targetIndex-1, sources.size()); + beforeNode = sources.subList(0, targetIndex - 1); + afterNode = sources.subList(targetIndex - 1, sources.size()); } } else { beforeNode = sources.subList(0, targetIndex); @@ -878,7 +878,7 @@ public class FunctionalCaseMinderService { checkModules(module, parentIdInDBMap, OperationLogType.ADD.toString()); moduleMapper.insert(module); } - functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.ADD.name()); + functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.ADD.name(), ""); } //处理更新(更新的情况是可能换数据本身,可能换父节点,可能换顺序) List updateList = resourceMap.get(OperationLogType.UPDATE.toString()); @@ -901,7 +901,7 @@ public class FunctionalCaseMinderService { checkModules(module, parentIdInDBMap, OperationLogType.UPDATE.toString()); moduleMapper.updateByPrimaryKeySelective(module); } - functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.UPDATE.name()); + functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.UPDATE.name(), ""); } } setDTOTargetMap(functionalMinderUpdateDTO, sourceIdAndTargetIdsMap); @@ -1242,7 +1242,7 @@ public class FunctionalCaseMinderService { FunctionalCaseModuleExample moduleExample = new FunctionalCaseModuleExample(); moduleExample.createCriteria().andIdIn(moduleIds); List modules = functionalCaseModuleMapper.selectByExample(moduleExample); - functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), user.getId(), "/functional/mind/case/edit", OperationLogType.DELETE.name()); + functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), user.getId(), "/functional/mind/case/edit", OperationLogType.DELETE.name(), " " + Translator.get("log.delete_module")); List functionalCases = functionalCaseModuleService.deleteModuleByIds(moduleIds, new ArrayList<>(), user.getId()); functionalCaseModuleLogService.batchDelLog(functionalCases, request.getProjectId(), user.getId(), "/functional/mind/case/edit"); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleLogService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleLogService.java index 2742d058fd..16e2cef3d7 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleLogService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseModuleLogService.java @@ -6,7 +6,6 @@ import io.metersphere.project.domain.Project; import io.metersphere.project.mapper.ProjectMapper; import io.metersphere.sdk.constants.HttpMethodConstants; import io.metersphere.sdk.util.JSON; -import io.metersphere.sdk.util.Translator; import io.metersphere.system.dto.builder.LogDTOBuilder; import io.metersphere.system.log.constants.OperationLogModule; import io.metersphere.system.log.constants.OperationLogType; @@ -113,7 +112,7 @@ public class FunctionalCaseModuleLogService { * @param userId * @param path */ - public void handleModuleLog(List deleteModule, String projectId, String userId, String path, String type) { + public void handleModuleLog(List deleteModule, String projectId, String userId, String path, String type, String deleteDesc) { Project project = projectMapper.selectByPrimaryKey(projectId); List dtoList = new ArrayList<>(); deleteModule.forEach(item -> { @@ -124,7 +123,7 @@ public class FunctionalCaseModuleLogService { userId, type, OperationLogModule.CASE_MANAGEMENT_CASE_MODULE, - item.getName() + " " + Translator.get("log.delete_module")); + item.getName() + deleteDesc); dto.setPath(path); dto.setMethod(HttpMethodConstants.GET.name()); dto.setOriginalValue(JSON.toJSONBytes(item)); 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 b5e3be173d..106640378e 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 @@ -132,7 +132,7 @@ public class FunctionalCaseModuleService extends ModuleTreeService { //用例日志 functionalCaseModuleLogService.batchDelLog(functionalCases, deleteModule.getProjectId(), userId, "/functional/case/module/delete/" + moduleId); //模块日志 - functionalCaseModuleLogService.handleModuleLog(List.of(deleteModule), deleteModule.getProjectId(), userId, "/functional/case/module/delete/" + moduleId, OperationLogType.DELETE.name()); + functionalCaseModuleLogService.handleModuleLog(List.of(deleteModule), deleteModule.getProjectId(), userId, "/functional/case/module/delete/" + moduleId, OperationLogType.DELETE.name(), " " + Translator.get("log.delete_module")); List ids = functionalCases.stream().map(FunctionalCase::getId).toList(); User user = userMapper.selectByPrimaryKey(userId); functionalCaseNoticeService.batchSendNotice(deleteModule.getProjectId(), ids, user, NoticeConstants.Event.DELETE);