|
|
@ -5,9 +5,11 @@ import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.TimeZone;
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
public class PaperScheduler {
|
|
|
|
public class PaperScheduler {
|
|
|
|
private final static boolean IS_DEADLINE_NOTIFICATION_AFTER_WEEK = true;
|
|
|
|
private final static boolean IS_DEADLINE_NOTIFICATION_BEFORE_WEEK = true;
|
|
|
|
|
|
|
|
|
|
|
|
private final Logger log = LoggerFactory.getLogger(PaperScheduler.class);
|
|
|
|
private final Logger log = LoggerFactory.getLogger(PaperScheduler.class);
|
|
|
|
|
|
|
|
|
|
|
@ -21,21 +23,21 @@ public class PaperScheduler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 8 * 1 ?")
|
|
|
|
@Scheduled(cron = "0 0 8 * 1 ?", zone = "Europe/Samara")
|
|
|
|
public void checkDeadlineBeforeWeek() {
|
|
|
|
public void checkDeadlineBeforeWeek() {
|
|
|
|
log.debug("PaperScheduler.checkDeadlineBeforeWeek started");
|
|
|
|
log.debug("PaperScheduler.checkDeadlineBeforeWeek started");
|
|
|
|
paperNotificationService.sendDeadlineNotifications(paperService.findAll(), !IS_DEADLINE_NOTIFICATION_AFTER_WEEK);
|
|
|
|
paperNotificationService.sendDeadlineNotifications(paperService.findAll(), IS_DEADLINE_NOTIFICATION_BEFORE_WEEK);
|
|
|
|
log.debug("PaperScheduler.checkDeadlineBeforeWeek finished");
|
|
|
|
log.debug("PaperScheduler.checkDeadlineBeforeWeek finished");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 8 * * ?")
|
|
|
|
@Scheduled(cron = "0 0 8 * * ?", zone = "Europe/Samara")
|
|
|
|
public void checkDeadlineAfterWeek() {
|
|
|
|
public void checkDeadlineAfterWeek() {
|
|
|
|
log.debug("PaperScheduler.checkDeadlineAfterWeek started");
|
|
|
|
log.debug("PaperScheduler.checkDeadlineAfterWeek started");
|
|
|
|
paperNotificationService.sendDeadlineNotifications(paperService.findAll(), IS_DEADLINE_NOTIFICATION_AFTER_WEEK);
|
|
|
|
paperNotificationService.sendDeadlineNotifications(paperService.findAll(), !IS_DEADLINE_NOTIFICATION_BEFORE_WEEK);
|
|
|
|
log.debug("PaperScheduler.checkDeadlineAfterWeek finished");
|
|
|
|
log.debug("PaperScheduler.checkDeadlineAfterWeek finished");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 6 * * ?")
|
|
|
|
@Scheduled(cron = "0 0 6 * * ?", zone = "Europe/Samara")
|
|
|
|
public void closeFailedPapers() {
|
|
|
|
public void closeFailedPapers() {
|
|
|
|
log.debug("PaperScheduler.closeFailedPapers started");
|
|
|
|
log.debug("PaperScheduler.closeFailedPapers started");
|
|
|
|
paperService.closeFailedPapers();
|
|
|
|
paperService.closeFailedPapers();
|
|
|
|