Commit f734b5f6 authored by Vijay Akula's avatar Vijay Akula

Provided options for cron expressions in LeaveMailNotification

parent 5f63bed4
...@@ -36,6 +36,7 @@ public class LeaveNotificationScheduler { ...@@ -36,6 +36,7 @@ public class LeaveNotificationScheduler {
private static final Logger logger = LoggerFactory.getLogger(LeaveNotificationScheduler.class); private static final Logger logger = LoggerFactory.getLogger(LeaveNotificationScheduler.class);
private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@Autowired @Autowired
private IMailService mailService; private IMailService mailService;
...@@ -52,6 +53,13 @@ public class LeaveNotificationScheduler { ...@@ -52,6 +53,13 @@ public class LeaveNotificationScheduler {
private IFunctionalGroupService functionalGroupService; private IFunctionalGroupService functionalGroupService;
private final String SHIFT1_CRON_EXP=environment.getProperty("email.leave.notification.shift1.cron");
private final String SHIFT2_CRON_EXP=environment.getProperty("email.leave.notification.shift2.cron");
private final String SHIFT3_CRON_EXP=environment.getProperty("email.leave.notification.shift3.cron");
private final String SHIFT4_CRON_EXP=environment.getProperty("email.leave.notification.shift4.cron");
private final String SHIFT5_CRON_EXP=environment.getProperty("email.leave.notification.shift5.cron");
//@Scheduled(cron = "0 * * * * ?") //@Scheduled(cron = "0 * * * * ?")
@Scheduled(cron = "00 00 15 * * 1-5") @Scheduled(cron = "00 00 15 * * 1-5")
public void scheduleLeaveMailForShift1Empls() throws IOException, MessagingException, MyTeamException { public void scheduleLeaveMailForShift1Empls() throws IOException, MessagingException, MyTeamException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment