From 72ea7664da22cd34ae3f20328be2f1d9ebea7ec9 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Wed, 11 Jun 2025 19:16:21 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=AE=A1=E7=90=86=E9=A1=B5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E5=88=97=E6=98=BE=E7=A4=BA=E4=BD=9C=E4=B8=9A=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=B7=B2=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1441426846482432]定时作业管理页增加一列显示作业是否已加载 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1441426846482432 --- .../api/schedule/ListDeployScheduleApi.java | 11 +++ .../dao/mapper/DeployScheduleMapper.xml | 77 ++++++++++++++----- 2 files changed, 69 insertions(+), 19 deletions(-) diff --git a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java index fada341f..ca10cb3d 100644 --- a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java +++ b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java @@ -38,6 +38,8 @@ import neatlogic.framework.deploy.dto.schedule.DeployScheduleVo; import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; +import neatlogic.framework.scheduler.core.SchedulerManager; +import neatlogic.framework.scheduler.dto.JobStatusVo; import neatlogic.framework.util.TableResultUtil; import neatlogic.module.deploy.dao.mapper.DeployPipelineMapper; import neatlogic.module.deploy.dao.mapper.DeployScheduleMapper; @@ -59,6 +61,9 @@ public class ListDeployScheduleApi extends PrivateApiComponentBase { @Resource private DeployPipelineMapper deployPipelineMapper; + @Resource + private SchedulerManager schedulerManager; + @Override public String getToken() { return "deploy/schedule/list"; @@ -186,6 +191,12 @@ public class ListDeployScheduleApi extends PrivateApiComponentBase { } } } + boolean isLoad = false; + JobStatusVo jobStatusVo = scheduleVo.getJobStatus(); + if (jobStatusVo != null && StringUtils.isNotBlank(jobStatusVo.getJobName()) && StringUtils.isNotBlank(jobStatusVo.getJobGroup())) { + isLoad = schedulerManager.checkJobIsExists(jobStatusVo.getJobName(), jobStatusVo.getJobGroup()); + } + scheduleVo.setIsLoad(isLoad ? 1 : 0); } } } diff --git a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployScheduleMapper.xml b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployScheduleMapper.xml index 209e481e..dac88fd5 100644 --- a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployScheduleMapper.xml +++ b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployScheduleMapper.xml @@ -112,26 +112,65 @@ along with this program. If not, see .--> LIMIT #{startNum}, #{pageSize} - SELECT - `id`, - `uuid`, - `name`, - `begin_time` AS beginTime, - `end_time` AS endTime, - `cron`, - `is_active` AS isActive, - `config` AS configStr, - `type`, - `fcd`, - `fcu`, - `lcd`, - `lcu`, - `app_system_id` AS appSystemId, - `app_module_id` AS appModuleId, - `pipeline_id` AS pipelineId, - `pipeline_type` AS pipelineType - FROM `deploy_schedule` + a.`id`, + a.`uuid`, + a.`name`, + a.`begin_time` AS beginTime, + a.`end_time` AS endTime, + a.`cron`, + a.`is_active` AS isActive, + a.`config` AS configStr, + a.`type`, + a.`fcd`, + a.`fcu`, + a.`lcd`, + a.`lcu`, + a.`app_system_id` AS appSystemId, + a.`app_module_id` AS appModuleId, + a.`pipeline_id` AS pipelineId, + a.`pipeline_type` AS pipelineType, + b.job_name as jobName, + b.job_group as jobGroup, + b.handler, + b.last_finish_time as lastFinishTime, + b.last_fire_time as lastFireTime, + b.next_fire_time as nextFireTime, + b.exec_count as execCount + FROM `deploy_schedule` a + LEFT JOIN `schedule_job_status` b ON a.uuid = b.job_name WHERE `id` IN #{id} -- Gitee