|
@@ -125,10 +125,11 @@ public class JobFailMonitorHelper {
|
|
|
"<table border=\"1\" cellpadding=\"3\" style=\"border-collapse:collapse; width:80%;\" >\n" +
|
|
|
" <thead style=\"font-weight: bold;color: #ffffff;background-color: #ff8c00;\" >" +
|
|
|
" <tr>\n" +
|
|
|
- " <td>"+ I18nUtil.getString("jobinfo_field_jobgroup") +"</td>\n" +
|
|
|
- " <td>"+ I18nUtil.getString("jobinfo_field_id") +"</td>\n" +
|
|
|
- " <td>"+ I18nUtil.getString("jobinfo_field_jobdesc") +"</td>\n" +
|
|
|
- " <td>"+ I18nUtil.getString("jobconf_monitor_alarm_title") +"</td>\n" +
|
|
|
+ " <td width=\"20%\" >"+ I18nUtil.getString("jobinfo_field_jobgroup") +"</td>\n" +
|
|
|
+ " <td width=\"10%\" >"+ I18nUtil.getString("jobinfo_field_id") +"</td>\n" +
|
|
|
+ " <td width=\"20%\" >"+ I18nUtil.getString("jobinfo_field_jobdesc") +"</td>\n" +
|
|
|
+ " <td width=\"10%\" >"+ I18nUtil.getString("jobconf_monitor_alarm_title") +"</td>\n" +
|
|
|
+ " <td width=\"40%\" >"+ I18nUtil.getString("jobconf_monitor_alarm_content") +"</td>\n" +
|
|
|
" </tr>\n" +
|
|
|
" <thead/>\n" +
|
|
|
" <tbody>\n" +
|
|
@@ -137,6 +138,7 @@ public class JobFailMonitorHelper {
|
|
|
" <td>{1}</td>\n" +
|
|
|
" <td>{2}</td>\n" +
|
|
|
" <td>"+ I18nUtil.getString("jobconf_monitor_alarm_type") +"</td>\n" +
|
|
|
+ " <td>{3}</td>\n" +
|
|
|
" </tr>\n" +
|
|
|
" <tbody>\n" +
|
|
|
"</table>";
|
|
@@ -152,12 +154,24 @@ public class JobFailMonitorHelper {
|
|
|
XxlJobInfo info = XxlJobDynamicScheduler.xxlJobInfoDao.loadById(jobLog.getJobId());
|
|
|
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
|
|
|
|
|
|
+ String alarmContent = "Alarm Job LogId=" + jobLog.getId();
|
|
|
+ if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) {
|
|
|
+ alarmContent += "<br>TriggerMsg=" + jobLog.getTriggerMsg();
|
|
|
+ }
|
|
|
+ if (jobLog.getHandleCode()>0 && jobLog.getHandleCode() != ReturnT.SUCCESS_CODE) {
|
|
|
+ alarmContent += "<br>HandleCode=" + jobLog.getHandleMsg();
|
|
|
+ }
|
|
|
+
|
|
|
Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmEmail().split(",")));
|
|
|
for (String email: emailSet) {
|
|
|
XxlJobGroup group = XxlJobDynamicScheduler.xxlJobGroupDao.load(Integer.valueOf(info.getJobGroup()));
|
|
|
|
|
|
String title = I18nUtil.getString("jobconf_monitor");
|
|
|
- String content = MessageFormat.format(mailBodyTemplate, group!=null?group.getTitle():"null", info.getId(), info.getJobDesc());
|
|
|
+ String content = MessageFormat.format(mailBodyTemplate,
|
|
|
+ group!=null?group.getTitle():"null",
|
|
|
+ info.getId(),
|
|
|
+ info.getJobDesc(),
|
|
|
+ alarmContent);
|
|
|
|
|
|
MailUtil.sendMail(email, title, content);
|
|
|
}
|