Exemple #1
0
 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());
   }
 }
Exemple #2
0
 public void reminder(WorkflowTask task) throws Exception {
   String[] reminderStyles = task.getReminderStyle().split(",");
   for (String style : reminderStyles) {
     if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.EMAIL_STYLE)) {
       emailReminder(task);
     } else if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.RTX_STYLE)) {
       rtxReminder(task);
     } else if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.SMS_STYLE)) {
       smsReminder(task);
     } else if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.SWING_STYLE)) {
       swingReminder(task);
     }
   }
 }