diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/FileModuleController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/FileModuleController.java index c8d11cdbe3..e035b6b7ab 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/FileModuleController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/FileModuleController.java @@ -54,7 +54,7 @@ public class FileModuleController { @RequiresPermissions(PermissionConstants.PROJECT_FILE_MANAGEMENT_READ_DELETE) @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#deleteId)", msClass = FileModuleLogService.class) public void deleteNode(@PathVariable String deleteId) { - fileModuleService.deleteModule(deleteId); + fileModuleService.deleteModule(deleteId, SessionUtils.getUserId()); } @PostMapping("/move") @@ -66,6 +66,6 @@ public class FileModuleController { * 1.判断移动后的parentID,判断是否是移动到其余的目录下 * 2.拖拽后的前后ID。 用于排序。 */ - fileModuleService.moveNode(request); + fileModuleService.moveNode(request, SessionUtils.getUserId()); } } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java index a8be387ae2..9c0b8f5eeb 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java @@ -267,7 +267,7 @@ public class ProjectApplicationController { @RequiresPermissions(PermissionConstants.PROJECT_APPLICATION_ISSUE_UPDATE) @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateIssueSyncLog(#projectId, #configs)", msClass = ProjectApplicationService.class) public void syncIssueConfig(@PathVariable("projectId") String projectId, @RequestBody Map configs) { - projectApplicationService.syncIssueConfig(projectId, configs); + projectApplicationService.syncIssueConfig(projectId, configs, SessionUtils.getUserId()); } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java index e0cf991fc8..b9470b251b 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java @@ -147,12 +147,12 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje } - public void deleteModule(String deleteId) { + public void deleteModule(String deleteId, String currentUser) { FileModule deleteModule = fileModuleMapper.selectByPrimaryKey(deleteId); if (deleteModule != null) { this.deleteModule(Collections.singletonList(deleteId)); //记录日志 - fileModuleLogService.saveDeleteLog(deleteModule, SessionUtils.getUserId()); + fileModuleLogService.saveDeleteLog(deleteModule, currentUser); } } public void deleteModule(List deleteIds) { @@ -168,7 +168,7 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje } } - public void moveNode(NodeMoveRequest request) { + public void moveNode(NodeMoveRequest request, String currentUser) { FileModuleExample example = new FileModuleExample(); example.createCriteria().andParentIdEqualTo(request.getParentId()).andIdEqualTo(request.getNodeId()); if (fileModuleMapper.countByExample(example) == 0) { @@ -181,7 +181,7 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje this.sort(request); //记录日志 - fileModuleLogService.saveMoveLog(request, SessionUtils.getUserId()); + fileModuleLogService.saveMoveLog(request, currentUser); } @Override diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java index e78235fdbc..811e29e0c5 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java @@ -210,10 +210,10 @@ public class ProjectApplicationService { * @param projectId * @param configs */ - public void syncIssueConfig(String projectId, Map configs) { + public void syncIssueConfig(String projectId, Map configs, String currentUser) { List issueSyncConfigs = configs.entrySet().stream().map(config -> new ProjectApplication(projectId, ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + config.getKey().toUpperCase(), config.getValue())).collect(Collectors.toList()); //处理同步缺陷定时任务配置 - doSaveOrUpdateSchedule(issueSyncConfigs, projectId); + doSaveOrUpdateSchedule(issueSyncConfigs, projectId, currentUser); ProjectApplicationExample example = new ProjectApplicationExample(); example.createCriteria().andProjectIdEqualTo(projectId).andTypeLike(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "%"); if (projectApplicationMapper.countByExample(example) > 0) { @@ -226,7 +226,7 @@ public class ProjectApplicationService { } } - private void doSaveOrUpdateSchedule(List issueSyncConfigs, String projectId) { + private void doSaveOrUpdateSchedule(List issueSyncConfigs, String projectId, String currentUser) { List syncCron = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.CRON_EXPRESSION.name())).collect(Collectors.toList()); List syncEnable = issueSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.ISSUE.ISSUE_SYNC.name() + "_" + ProjectApplicationType.ISSUE_SYNC_CONFIG.ENABLE.name())).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(syncCron)) { @@ -249,7 +249,7 @@ public class ProjectApplicationService { request.setKey(projectId); request.setProjectId(projectId); request.setEnable(enable); - request.setCreateUser(SessionUtils.getUserId()); + request.setCreateUser(currentUser); request.setType(ScheduleType.CRON.name()); // 每天凌晨2点执行清理任务 request.setValue(typeValue);