This commit is contained in:
xueli.xue 2017-03-12 18:34:56 +08:00
parent 8d99be356a
commit 7d31e9838a
2 changed files with 12 additions and 14 deletions

View File

@ -168,6 +168,7 @@ public class XxlJobServiceImpl implements IXxlJobService {
// stage job info // stage job info
XxlJobInfo exists_jobInfo = xxlJobInfoDao.loadById(jobInfo.getId()); XxlJobInfo exists_jobInfo = xxlJobInfoDao.loadById(jobInfo.getId());
String old_cron = exists_jobInfo.getJobCron();
if (exists_jobInfo == null) { if (exists_jobInfo == null) {
return new ReturnT<String>(500, "参数异常"); return new ReturnT<String>(500, "参数异常");
} }
@ -181,19 +182,16 @@ public class XxlJobServiceImpl implements IXxlJobService {
exists_jobInfo.setExecutorParam(jobInfo.getExecutorParam()); exists_jobInfo.setExecutorParam(jobInfo.getExecutorParam());
exists_jobInfo.setGlueSwitch(jobInfo.getGlueSwitch()); exists_jobInfo.setGlueSwitch(jobInfo.getGlueSwitch());
exists_jobInfo.setChildJobKey(jobInfo.getChildJobKey()); exists_jobInfo.setChildJobKey(jobInfo.getChildJobKey());
xxlJobInfoDao.update(exists_jobInfo);
try { try {
// fresh quartz // fresh quartz
boolean ret = XxlJobDynamicScheduler.rescheduleJob(String.valueOf(exists_jobInfo.getJobGroup()), String.valueOf(exists_jobInfo.getId()), exists_jobInfo.getJobCron()); boolean ret = XxlJobDynamicScheduler.rescheduleJob(String.valueOf(exists_jobInfo.getJobGroup()), String.valueOf(exists_jobInfo.getId()), exists_jobInfo.getJobCron());
if (ret) { return ret?ReturnT.SUCCESS:ReturnT.FAIL;
xxlJobInfoDao.update(exists_jobInfo);
return ReturnT.SUCCESS;
} else {
return new ReturnT<String>(500, "更新任务失败");
}
} catch (SchedulerException e) { } catch (SchedulerException e) {
logger.error("", e); logger.error("", e);
} }
return ReturnT.FAIL; return ReturnT.FAIL;
} }

View File

@ -11,7 +11,7 @@ $(function() {
dataType : "json", dataType : "json",
success : function(data){ success : function(data){
if (data.code == 200) { if (data.code == 200) {
$("#jobId").html('<option value="" >请选择</option>'); $("#jobId").html('<option value="0" >请选择</option>');
$.each(data.content, function (n, value) { $.each(data.content, function (n, value) {
$("#jobId").append('<option value="' + value.id + '" >' + value.jobDesc + '</option>'); $("#jobId").append('<option value="' + value.id + '" >' + value.jobDesc + '</option>');
}); });