use of com.easy.cloud.core.worker.scheduler.pojo.dto.EcHolidayDTO in project dq-easy-cloud by dq-open-cloud.
the class EcTaskSchedulerManager method buildCalendar.
private Trigger buildCalendar(final EcTaskSchedulerDTO taskSchedulerDTO, final Trigger trigger) throws SchedulerException {
logger.info("holidayName:" + taskSchedulerDTO.getHolidayName());
logger.info("holidays:" + taskSchedulerDTO.getHolidayDTOs());
if (taskSchedulerDTO.getHolidayName() != null && EcCollectionsUtils.isNotEmpty(taskSchedulerDTO.getHolidayDTOs())) {
AnnualCalendar holidays = new AnnualCalendar();
for (EcHolidayDTO holidayDTO : taskSchedulerDTO.getHolidayDTOs()) {
Calendar calendar = new GregorianCalendar(holidayDTO.getYear(), holidayDTO.getMonth() - 1, holidayDTO.getDay());
holidays.setDayExcluded(calendar, true);
}
scheduler.addCalendar(taskSchedulerDTO.getHolidayName(), holidays, true, true);
return trigger.getTriggerBuilder().modifiedByCalendar(taskSchedulerDTO.getHolidayName()).build();
} else {
return trigger.getTriggerBuilder().modifiedByCalendar(null).build();
}
// return trigger;
}
Aggregations