diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java index c6a1aebbb8..900c8bd88b 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java @@ -187,7 +187,7 @@ public class ProjectTaskHubController { @Operation(summary = "项目-任务中心-后台任务更新cron表达式") @RequiresPermissions(PermissionConstants.PROJECT_SCHEDULE_TASK_CENTER_READ_UPDATE) public void updateValue(@Validated @RequestBody ScheduleRequest request) { - baseTaskHubService.updateCron(request); + baseTaskHubService.updateCron(request, SessionUtils.getUserId(), "/project/task-center/schedule/update-cron", OperationLogModule.PROJECT_MANAGEMENT_TASK_CENTER); } @PostMapping("/exec-task/batch/page") diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java index 09f19dc5e0..0260bceed6 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java @@ -182,7 +182,7 @@ public class OrganizationTaskHubController { public void batchEnable(@Validated @RequestBody TableBatchProcessDTO request) { List projectList = baseProjectMapper.getProjectOptionsByOrgId(SessionUtils.getCurrentOrganizationId()); List projectIds = projectList.stream().map(OptionDTO::getId).toList(); - baseTaskHubService.scheduleBatchOperation(request, SessionUtils.getUserId(), SessionUtils.getCurrentProjectId(), "/organization/task-center/schedule/batch-enable", OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER, true,projectIds); + baseTaskHubService.scheduleBatchOperation(request, SessionUtils.getUserId(), SessionUtils.getCurrentProjectId(), "/organization/task-center/schedule/batch-enable", OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER, true, projectIds); } @@ -200,7 +200,7 @@ public class OrganizationTaskHubController { @Operation(summary = "组织-任务中心-后台任务更新cron表达式") @RequiresPermissions(PermissionConstants.ORGANIZATION_SCHEDULE_TASK_CENTER_READ_UPDATE) public void updateValue(@Validated @RequestBody ScheduleRequest request) { - baseTaskHubService.updateCron(request); + baseTaskHubService.updateCron(request, SessionUtils.getUserId(), "/organization/task-center/schedule/update-cron", OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER); } @PostMapping("/exec-task/batch/page") diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java index c2ed338c78..63cd56a8aa 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java @@ -206,7 +206,7 @@ public class SystemTaskHubController { @Operation(summary = "系统-任务中心-后台任务更新cron表达式") @RequiresPermissions(PermissionConstants.SYSTEM_SCHEDULE_TASK_CENTER_READ_UPDATE) public void updateValue(@Validated @RequestBody ScheduleRequest request) { - baseTaskHubService.updateCron(request); + baseTaskHubService.updateCron(request, SessionUtils.getUserId(), "/system/task-center/schedule/update-cron", OperationLogModule.SETTING_SYSTEM_TASK_CENTER); } } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java index 1818a8d600..32863e853a 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/BaseTaskHubService.java @@ -888,13 +888,14 @@ public class BaseTaskHubService { return list; } - public void updateCron(ScheduleRequest request) { + public void updateCron(ScheduleRequest request, String userId, String path, String module) { Schedule schedule = checkScheduleExit(request.getId()); schedule.setValue(request.getCron()); scheduleService.editSchedule(schedule); try { scheduleService.addOrUpdateCronJob(schedule, new JobKey(schedule.getKey(), schedule.getJob()), new TriggerKey(schedule.getKey(), schedule.getJob()), Class.forName(schedule.getJob())); + saveLog(List.of(schedule), userId, path, HttpMethodConstants.GET.name(), module, OperationLogType.UPDATE.name()); } catch (ClassNotFoundException e) { LogUtils.error(e); throw new RuntimeException(e);