|
|
@ -2,6 +2,7 @@ package com.xxl.job.admin.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobInfo;
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobInfo;
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobLog;
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobLog;
|
|
|
|
|
|
|
|
import com.xxl.job.admin.core.util.I18nUtil;
|
|
|
|
import com.xxl.job.admin.dao.XxlJobInfoDao;
|
|
|
|
import com.xxl.job.admin.dao.XxlJobInfoDao;
|
|
|
|
import com.xxl.job.admin.dao.XxlJobLogDao;
|
|
|
|
import com.xxl.job.admin.dao.XxlJobLogDao;
|
|
|
|
import com.xxl.job.admin.dao.XxlJobRegistryDao;
|
|
|
|
import com.xxl.job.admin.dao.XxlJobRegistryDao;
|
|
|
@ -64,7 +65,7 @@ public class AdminBizImpl implements AdminBiz {
|
|
|
|
if (IJobHandler.SUCCESS.getCode() == handleCallbackParam.getExecuteResult().getCode()) {
|
|
|
|
if (IJobHandler.SUCCESS.getCode() == handleCallbackParam.getExecuteResult().getCode()) {
|
|
|
|
XxlJobInfo xxlJobInfo = xxlJobInfoDao.loadById(log.getJobId());
|
|
|
|
XxlJobInfo xxlJobInfo = xxlJobInfoDao.loadById(log.getJobId());
|
|
|
|
if (xxlJobInfo!=null && StringUtils.isNotBlank(xxlJobInfo.getChildJobId())) {
|
|
|
|
if (xxlJobInfo!=null && StringUtils.isNotBlank(xxlJobInfo.getChildJobId())) {
|
|
|
|
callbackMsg = "<br><br><span style=\"color:#00c0ef;\" > >>>>>>>>>>>触发子任务<<<<<<<<<<< </span><br>";
|
|
|
|
callbackMsg = "<br><br><span style=\"color:#00c0ef;\" > >>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_child_run") +"<<<<<<<<<<< </span><br>";
|
|
|
|
|
|
|
|
|
|
|
|
String[] childJobIds = xxlJobInfo.getChildJobId().split(",");
|
|
|
|
String[] childJobIds = xxlJobInfo.getChildJobId().split(",");
|
|
|
|
for (int i = 0; i < childJobIds.length; i++) {
|
|
|
|
for (int i = 0; i < childJobIds.length; i++) {
|
|
|
@ -73,21 +74,27 @@ public class AdminBizImpl implements AdminBiz {
|
|
|
|
ReturnT<String> triggerChildResult = xxlJobService.triggerJob(childJobId);
|
|
|
|
ReturnT<String> triggerChildResult = xxlJobService.triggerJob(childJobId);
|
|
|
|
|
|
|
|
|
|
|
|
// add msg
|
|
|
|
// add msg
|
|
|
|
callbackMsg += MessageFormat.format("{0}/{1} [任务ID={2}], 触发{3}, 触发备注: {4} <br>",
|
|
|
|
callbackMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_child_msg1"),
|
|
|
|
(i+1), childJobIds.length, childJobIds[i], (triggerChildResult.getCode()==ReturnT.SUCCESS_CODE?"成功":"失败"), triggerChildResult.getMsg());
|
|
|
|
(i+1),
|
|
|
|
|
|
|
|
childJobIds.length,
|
|
|
|
|
|
|
|
childJobIds[i],
|
|
|
|
|
|
|
|
(triggerChildResult.getCode()==ReturnT.SUCCESS_CODE?I18nUtil.getString("system_success"):I18nUtil.getString("system_fail")),
|
|
|
|
|
|
|
|
triggerChildResult.getMsg());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
callbackMsg += MessageFormat.format(" {0}/{1} [任务ID={2}], 触发失败, 触发备注: 任务ID格式错误 <br>",
|
|
|
|
callbackMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_child_msg2"),
|
|
|
|
(i+1), childJobIds.length, childJobIds[i]);
|
|
|
|
(i+1),
|
|
|
|
|
|
|
|
childJobIds.length,
|
|
|
|
|
|
|
|
childJobIds[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (IJobHandler.FAIL_RETRY.getCode() == handleCallbackParam.getExecuteResult().getCode()){
|
|
|
|
} else if (IJobHandler.FAIL_RETRY.getCode() == handleCallbackParam.getExecuteResult().getCode()){
|
|
|
|
ReturnT<String> retryTriggerResult = xxlJobService.triggerJob(log.getJobId());
|
|
|
|
ReturnT<String> retryTriggerResult = xxlJobService.triggerJob(log.getJobId());
|
|
|
|
callbackMsg = "<br><br><span style=\"color:#F39C12;\" > >>>>>>>>>>>执行失败重试<<<<<<<<<<< </span><br>";
|
|
|
|
callbackMsg = "<br><br><span style=\"color:#F39C12;\" > >>>>>>>>>>>"+ I18nUtil.getString("jobconf_exe_fail_retry") +"<<<<<<<<<<< </span><br>";
|
|
|
|
|
|
|
|
|
|
|
|
callbackMsg += MessageFormat.format("触发{0}, 触发备注: {1}",
|
|
|
|
callbackMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_msg1"),
|
|
|
|
(retryTriggerResult.getCode()==ReturnT.SUCCESS_CODE?"成功":"失败"), retryTriggerResult.getMsg());
|
|
|
|
(retryTriggerResult.getCode()==ReturnT.SUCCESS_CODE?I18nUtil.getString("system_success"):I18nUtil.getString("system_fail")), retryTriggerResult.getMsg());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// handle msg
|
|
|
|
// handle msg
|
|
|
|