|
@@ -125,10 +125,11 @@ public class JobFailMonitorHelper {
|
125
|
125
|
"<table border=\"1\" cellpadding=\"3\" style=\"border-collapse:collapse; width:80%;\" >\n" +
|
126
|
126
|
" <thead style=\"font-weight: bold;color: #ffffff;background-color: #ff8c00;\" >" +
|
127
|
127
|
" <tr>\n" +
|
128
|
|
- " <td>"+ I18nUtil.getString("jobinfo_field_jobgroup") +"</td>\n" +
|
129
|
|
- " <td>"+ I18nUtil.getString("jobinfo_field_id") +"</td>\n" +
|
130
|
|
- " <td>"+ I18nUtil.getString("jobinfo_field_jobdesc") +"</td>\n" +
|
131
|
|
- " <td>"+ I18nUtil.getString("jobconf_monitor_alarm_title") +"</td>\n" +
|
|
128
|
+ " <td width=\"20%\" >"+ I18nUtil.getString("jobinfo_field_jobgroup") +"</td>\n" +
|
|
129
|
+ " <td width=\"10%\" >"+ I18nUtil.getString("jobinfo_field_id") +"</td>\n" +
|
|
130
|
+ " <td width=\"20%\" >"+ I18nUtil.getString("jobinfo_field_jobdesc") +"</td>\n" +
|
|
131
|
+ " <td width=\"10%\" >"+ I18nUtil.getString("jobconf_monitor_alarm_title") +"</td>\n" +
|
|
132
|
+ " <td width=\"40%\" >"+ I18nUtil.getString("jobconf_monitor_alarm_content") +"</td>\n" +
|
132
|
133
|
" </tr>\n" +
|
133
|
134
|
" <thead/>\n" +
|
134
|
135
|
" <tbody>\n" +
|
|
@@ -137,6 +138,7 @@ public class JobFailMonitorHelper {
|
137
|
138
|
" <td>{1}</td>\n" +
|
138
|
139
|
" <td>{2}</td>\n" +
|
139
|
140
|
" <td>"+ I18nUtil.getString("jobconf_monitor_alarm_type") +"</td>\n" +
|
|
141
|
+ " <td>{3}</td>\n" +
|
140
|
142
|
" </tr>\n" +
|
141
|
143
|
" <tbody>\n" +
|
142
|
144
|
"</table>";
|
|
@@ -152,12 +154,24 @@ public class JobFailMonitorHelper {
|
152
|
154
|
XxlJobInfo info = XxlJobDynamicScheduler.xxlJobInfoDao.loadById(jobLog.getJobId());
|
153
|
155
|
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
|
154
|
156
|
|
|
157
|
+ String alarmContent = "Alarm Job LogId=" + jobLog.getId();
|
|
158
|
+ if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) {
|
|
159
|
+ alarmContent += "<br>TriggerMsg=" + jobLog.getTriggerMsg();
|
|
160
|
+ }
|
|
161
|
+ if (jobLog.getHandleCode()>0 && jobLog.getHandleCode() != ReturnT.SUCCESS_CODE) {
|
|
162
|
+ alarmContent += "<br>HandleCode=" + jobLog.getHandleMsg();
|
|
163
|
+ }
|
|
164
|
+
|
155
|
165
|
Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmEmail().split(",")));
|
156
|
166
|
for (String email: emailSet) {
|
157
|
167
|
XxlJobGroup group = XxlJobDynamicScheduler.xxlJobGroupDao.load(Integer.valueOf(info.getJobGroup()));
|
158
|
168
|
|
159
|
169
|
String title = I18nUtil.getString("jobconf_monitor");
|
160
|
|
- String content = MessageFormat.format(mailBodyTemplate, group!=null?group.getTitle():"null", info.getId(), info.getJobDesc());
|
|
170
|
+ String content = MessageFormat.format(mailBodyTemplate,
|
|
171
|
+ group!=null?group.getTitle():"null",
|
|
172
|
+ info.getId(),
|
|
173
|
+ info.getJobDesc(),
|
|
174
|
+ alarmContent);
|
161
|
175
|
|
162
|
176
|
MailUtil.sendMail(email, title, content);
|
163
|
177
|
}
|