From 231f4b869ec80e4aa91f85d7bbbbea2c83d1fdf5 Mon Sep 17 00:00:00 2001
From: xuxueli <931591021@qq.com>
Date: Sat, 20 Jan 2018 13:49:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=E4=BB=A3=E7=A0=81=E5=9B=BD?=
=?UTF-8?q?=E9=99=85=E5=8C=96=E5=AE=9A=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../job/admin/core/trigger/XxlJobTrigger.java | 4 ++--
.../job/admin/service/impl/AdminBizImpl.java | 23 ++++++++++++-------
.../main/resources/i18n/message.properties | 6 +++++
3 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
index 90d3aae5..11e9e601 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
@@ -104,7 +104,7 @@ public class XxlJobTrigger {
// 4.3、trigger (fail retry)
if (triggerResult.getCode()!=ReturnT.SUCCESS_CODE && failStrategy == ExecutorFailStrategyEnum.FAIL_RETRY) {
triggerResult = runExecutor(triggerParam, address); // update04
- triggerMsgSb.append("
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_fail_retry") +"<<<<<<<<<<<
").append(triggerResult.getMsg());
+ triggerMsgSb.append("
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_fail_retry") +"<<<<<<<<<<<
").append(triggerResult.getMsg());
}
}
@@ -172,7 +172,7 @@ public class XxlJobTrigger {
// 4.3、trigger (fail retry)
if (triggerResult.getCode()!=ReturnT.SUCCESS_CODE && failStrategy == ExecutorFailStrategyEnum.FAIL_RETRY) {
triggerResult = executorRouteStrategyEnum.getRouter().routeRun(triggerParam, addressList);
- triggerMsgSb.append("
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_fail_retry") +"<<<<<<<<<<<
").append(triggerResult.getMsg());
+ triggerMsgSb.append("
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_fail_retry") +"<<<<<<<<<<<
").append(triggerResult.getMsg());
}
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java
index 352b4c95..ddaa6bd0 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java
@@ -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.XxlJobLog;
+import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.admin.dao.XxlJobInfoDao;
import com.xxl.job.admin.dao.XxlJobLogDao;
import com.xxl.job.admin.dao.XxlJobRegistryDao;
@@ -64,7 +65,7 @@ public class AdminBizImpl implements AdminBiz {
if (IJobHandler.SUCCESS.getCode() == handleCallbackParam.getExecuteResult().getCode()) {
XxlJobInfo xxlJobInfo = xxlJobInfoDao.loadById(log.getJobId());
if (xxlJobInfo!=null && StringUtils.isNotBlank(xxlJobInfo.getChildJobId())) {
- callbackMsg = "
>>>>>>>>>>>触发子任务<<<<<<<<<<<
";
+ callbackMsg = "
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_child_run") +"<<<<<<<<<<<
";
String[] childJobIds = xxlJobInfo.getChildJobId().split(",");
for (int i = 0; i < childJobIds.length; i++) {
@@ -73,21 +74,27 @@ public class AdminBizImpl implements AdminBiz {
ReturnT triggerChildResult = xxlJobService.triggerJob(childJobId);
// add msg
- callbackMsg += MessageFormat.format("{0}/{1} [任务ID={2}], 触发{3}, 触发备注: {4}
",
- (i+1), childJobIds.length, childJobIds[i], (triggerChildResult.getCode()==ReturnT.SUCCESS_CODE?"成功":"失败"), triggerChildResult.getMsg());
+ callbackMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_child_msg1"),
+ (i+1),
+ childJobIds.length,
+ childJobIds[i],
+ (triggerChildResult.getCode()==ReturnT.SUCCESS_CODE?I18nUtil.getString("system_success"):I18nUtil.getString("system_fail")),
+ triggerChildResult.getMsg());
} else {
- callbackMsg += MessageFormat.format(" {0}/{1} [任务ID={2}], 触发失败, 触发备注: 任务ID格式错误
",
- (i+1), childJobIds.length, childJobIds[i]);
+ callbackMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_child_msg2"),
+ (i+1),
+ childJobIds.length,
+ childJobIds[i]);
}
}
}
} else if (IJobHandler.FAIL_RETRY.getCode() == handleCallbackParam.getExecuteResult().getCode()){
ReturnT retryTriggerResult = xxlJobService.triggerJob(log.getJobId());
- callbackMsg = "
>>>>>>>>>>>执行失败重试<<<<<<<<<<<
";
+ callbackMsg = "
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_exe_fail_retry") +"<<<<<<<<<<<
";
- callbackMsg += MessageFormat.format("触发{0}, 触发备注: {1}",
- (retryTriggerResult.getCode()==ReturnT.SUCCESS_CODE?"成功":"失败"), retryTriggerResult.getMsg());
+ callbackMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_msg1"),
+ (retryTriggerResult.getCode()==ReturnT.SUCCESS_CODE?I18nUtil.getString("system_success"):I18nUtil.getString("system_fail")), retryTriggerResult.getMsg());
}
// handle msg
diff --git a/xxl-job-admin/src/main/resources/i18n/message.properties b/xxl-job-admin/src/main/resources/i18n/message.properties
index 5f80a2b1..4bcff703 100644
--- a/xxl-job-admin/src/main/resources/i18n/message.properties
+++ b/xxl-job-admin/src/main/resources/i18n/message.properties
@@ -217,6 +217,12 @@ jobconf_trigger_exe_regtype=执行器-注册方式
jobconf_trigger_exe_regaddress=执行器-地址列表
jobconf_trigger_address_empty=调度失败:执行器地址为空
jobconf_trigger_run=触发调度
+jobconf_trigger_child_run=触发子任务
+jobconf_trigger_fail_retry=调度失败重试
+jobconf_exe_fail_retry=执行失败重试
+jobconf_callback_child_msg1={0}/{1} [任务ID={2}], 触发{3}, 触发备注: {4}
+jobconf_callback_child_msg2={0}/{1} [任务ID={2}], 触发失败, 触发备注: 任务ID格式错误
+jobconf_callback_msg1=触发{0}, 触发备注: {1}
## help
job_help=使用教程