public void reminder(List<WorkflowTask> tasks) { try { for (WorkflowTask task : tasks) { if (neetReminder(task)) { if (task.getReminderLimitTimes() != 0 && task.getReminderLimitTimes().equals(task.getAlreadyReminderTimes())) { if (StringUtils.isNotEmpty(task.getReminderNoticeStyle())) { informSettingUser(task); } } if (task.getReminderLimitTimes() == 0 || task.getReminderLimitTimes() > task.getAlreadyReminderTimes()) { if (StringUtils.isNotEmpty(task.getReminderStyle())) { reminder(task); } task.setLastReminderTime(new Date(System.currentTimeMillis())); task.setAlreadyReminderTimes(task.getAlreadyReminderTimes() + 1); } } } taskService.saveTasks(tasks); } catch (Exception e) { log.error("定时催办异常:" + e.getMessage()); } }
/* * 催办超出次数限制,通知相关人员 */ public void informSettingUser(WorkflowTask task) throws Exception { String[] reminderNoticeStyle = task.getReminderNoticeStyle().split(","); for (String style : reminderNoticeStyle) { if (style.equalsIgnoreCase(CommonStrings.EMAIL_STYLE)) { emailInform(task); } else if (style.equalsIgnoreCase(CommonStrings.RTX_STYLE)) { RtxInform(task); } else if (style.equalsIgnoreCase(CommonStrings.SMS_STYLE)) { smsInform(task); } else if (style.equalsIgnoreCase(CommonStrings.SWING_STYLE)) { swingInform(task); } } }