|
@@ -343,10 +343,15 @@ public class SysEarlyWarningServiceImpl extends ServiceImpl<SysEarlyWarningMappe
|
343
|
343
|
|
344
|
344
|
CalendarIntervalScheduleBuilder calendarIntervalScheduleBuilder = getCalendarIntervalScheduleBuilder(timePeriodParam[1], Integer.parseInt(timePeriodParam[0]));
|
345
|
345
|
//
|
346
|
|
- CalendarIntervalTrigger toBeDoneCalendarTrigger = newTrigger().withIdentity(triggerName, group)
|
|
346
|
+ TriggerBuilder<CalendarIntervalTrigger> calendarIntervalTriggerBuilder = newTrigger().withIdentity(triggerName, group)
|
347
|
347
|
.startAt(startAt)//设置开始调度时间
|
348
|
|
- .withSchedule(calendarIntervalScheduleBuilder)//设置调度频率
|
349
|
|
- .build();
|
|
348
|
+ .withSchedule(calendarIntervalScheduleBuilder);//设置调度频率
|
|
349
|
+
|
|
350
|
+ if(timePeriodParam[1].equals(GrainConstant.STR_WEEKDAY)) {
|
|
351
|
+ calendarIntervalTriggerBuilder.modifiedByCalendar("weekly");//weekly在Scheduler初始化时,已注册
|
|
352
|
+ }
|
|
353
|
+
|
|
354
|
+ CalendarIntervalTrigger toBeDoneCalendarTrigger = calendarIntervalTriggerBuilder.build();
|
350
|
355
|
|
351
|
356
|
return toBeDoneCalendarTrigger;
|
352
|
357
|
}
|
|
@@ -377,9 +382,9 @@ public class SysEarlyWarningServiceImpl extends ServiceImpl<SysEarlyWarningMappe
|
377
|
382
|
String periodType = value[1];
|
378
|
383
|
|
379
|
384
|
if(! periodType.equals(GrainConstant.STR_SECOND) && ! periodType.equals(GrainConstant.STR_MINUTE) && ! periodType.equals(GrainConstant.STR_HOUR) &&
|
380
|
|
- ! periodType.equals(GrainConstant.STR_DAY) && ! periodType.equals(GrainConstant.STR_WEEK) && ! periodType.equals(GrainConstant.STR_MONTH) &&
|
381
|
|
- ! periodType.equals(GrainConstant.STR_SEASON) && ! periodType.equals(GrainConstant.STR_YEAR) ) {
|
382
|
|
- throw new IllegalArgumentException(paramDesc + "值'_'后的值必须为second、minute、hour、day、week、month、season、year中的一种");
|
|
385
|
+ ! periodType.equals(GrainConstant.STR_DAY) && ! periodType.equals(GrainConstant.STR_WEEKDAY) && ! periodType.equals(GrainConstant.STR_WEEK) &&
|
|
386
|
+ ! periodType.equals(GrainConstant.STR_MONTH) && ! periodType.equals(GrainConstant.STR_SEASON) && ! periodType.equals(GrainConstant.STR_YEAR) ) {
|
|
387
|
+ throw new IllegalArgumentException(paramDesc + "值'_'后的值必须为second、minute、hour、day、weekday、week、month、season、year中的一种");
|
383
|
388
|
}
|
384
|
389
|
|
385
|
390
|
}
|
|
@@ -400,7 +405,7 @@ public class SysEarlyWarningServiceImpl extends ServiceImpl<SysEarlyWarningMappe
|
400
|
405
|
startAt = DateUtil.getCurrMinute();
|
401
|
406
|
} else if(periodType.equals(GrainConstant.STR_HOUR)) {
|
402
|
407
|
startAt = DateUtil.getCurrHour();
|
403
|
|
- } else if(periodType.equals(GrainConstant.STR_DAY)) {
|
|
408
|
+ } else if(periodType.equals(GrainConstant.STR_DAY) || periodType.equals(GrainConstant.STR_WEEKDAY)) {
|
404
|
409
|
startAt = DateUtil.getCurrDate();
|
405
|
410
|
} else if(periodType.equals(GrainConstant.STR_WEEK)) {
|
406
|
411
|
startAt = DateUtil.getFirstDateOfCurrWeek();
|
|
@@ -486,7 +491,7 @@ public class SysEarlyWarningServiceImpl extends ServiceImpl<SysEarlyWarningMappe
|
486
|
491
|
return calendarIntervalSchedule().withIntervalInMonths(periodNum);
|
487
|
492
|
} else if(periodType.equals(GrainConstant.STR_WEEK)) {
|
488
|
493
|
return calendarIntervalSchedule().withIntervalInWeeks(periodNum);
|
489
|
|
- } else if(periodType.equals(GrainConstant.STR_DAY)) {
|
|
494
|
+ } else if(periodType.equals(GrainConstant.STR_DAY) || periodType.equals(GrainConstant.STR_WEEKDAY)) {
|
490
|
495
|
return calendarIntervalSchedule().withIntervalInDays(periodNum);
|
491
|
496
|
} else if(periodType.equals(GrainConstant.STR_HOUR)) {
|
492
|
497
|
return calendarIntervalSchedule().withIntervalInHours(periodNum);
|