From 7c0aaea0b6392a5b8b43dd294a09253865936545 Mon Sep 17 00:00:00 2001 From: "xueli.xue" Date: Sun, 12 Jun 2016 20:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=BB=88=E6=AD=A2fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xxl/job/admin/controller/JobLogController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java index e80cf856..073af8c7 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java @@ -18,7 +18,9 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.xxl.job.admin.core.constant.Constants.JobGroupEnum; import com.xxl.job.admin.core.model.ReturnT; +import com.xxl.job.admin.core.model.XxlJobInfo; import com.xxl.job.admin.core.model.XxlJobLog; +import com.xxl.job.admin.dao.IXxlJobInfoDao; import com.xxl.job.admin.dao.IXxlJobLogDao; import com.xxl.job.core.handler.HandlerRepository.ActionEnum; import com.xxl.job.core.handler.HandlerRepository.HandlerParamEnum; @@ -35,6 +37,8 @@ public class JobLogController { @Resource public IXxlJobLogDao xxlJobLogDao; + @Resource + public IXxlJobInfoDao xxlJobInfoDao; @RequestMapping public String index(Model model, String jobGroup, String jobName) { @@ -132,7 +136,8 @@ public class JobLogController { public ReturnT logKill(int id){ // base check XxlJobLog log = xxlJobLogDao.load(id); - if (log == null) { + XxlJobInfo jobInfo = xxlJobInfoDao.load(log.getJobGroup(), log.getJobName()); + if (log == null || jobInfo==null) { return new ReturnT(500, "参数异常"); } if (!RemoteCallBack.SUCCESS.equals(log.getTriggerStatus())) { @@ -143,6 +148,7 @@ public class JobLogController { Map reqMap = new HashMap(); reqMap.put(HandlerParamEnum.TIMESTAMP.name(), String.valueOf(System.currentTimeMillis())); reqMap.put(HandlerParamEnum.ACTION.name(), ActionEnum.KILL.name()); + reqMap.put(HandlerParamEnum.GLUE_SWITCH.name(), String.valueOf(jobInfo.getGlueSwitch())); reqMap.put(HandlerParamEnum.EXECUTOR_HANDLER.name(), log.getExecutorHandler()); reqMap.put(HandlerParamEnum.JOB_GROUP.name(), log.getJobGroup()); reqMap.put(HandlerParamEnum.JOB_NAME.name(), log.getJobName());