Subversion Repositories SmartDukaan

Rev

Rev 34725 | Rev 34757 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34725 Rev 34756
Line 14... Line 14...
14
import org.springframework.scheduling.annotation.Scheduled;
14
import org.springframework.scheduling.annotation.Scheduled;
15
import org.springframework.stereotype.Component;
15
import org.springframework.stereotype.Component;
16
 
16
 
17
import java.time.LocalDate;
17
import java.time.LocalDate;
18
import java.time.LocalDateTime;
18
import java.time.LocalDateTime;
-
 
19
import java.time.LocalTime;
19
import java.util.Date;
20
import java.util.Date;
20
import java.util.LinkedHashMap;
21
import java.util.LinkedHashMap;
21
 
22
 
22
@Component
23
@Component
23
//@ConditionalOnProperty(name = "scheduled", havingValue = "true", matchIfMissing = true)
24
//@ConditionalOnProperty(name = "scheduled", havingValue = "true", matchIfMissing = true)
Line 659... Line 660...
659
 
660
 
660
    //  @Scheduled(cron = "0 */5 2-22 * * *")
661
    //  @Scheduled(cron = "0 */5 2-22 * * *")
661
    @Scheduled(fixedDelay = 1 * 60 * 1000)
662
    @Scheduled(fixedDelay = 1 * 60 * 1000)
662
    //@Scheduled(cron = "0 0 23 * * *")
663
    //@Scheduled(cron = "0 0 23 * * *")
663
    public void loanSettlement() throws Throwable {
664
    public void loanSettlement() throws Throwable {
-
 
665
        LocalTime now = LocalTime.now();
-
 
666
        LocalTime start = LocalTime.of(23, 0);
-
 
667
        LocalTime end = LocalTime.of(06, 0);
-
 
668
 
-
 
669
        if (now.isBefore(start) || now.isAfter(end)) {
664
        scheduledTasks.loanSettlement();
670
            scheduledTasks.loanSettlement();
-
 
671
            System.out.println("Task executed at " + now);
-
 
672
        } else {
-
 
673
            System.out.println("Task skipped during restricted hours: " + now);
-
 
674
        }
665
    }
675
    }
666
 
676
 
667
    @Scheduled(cron = "0 */15 * * * *")
677
    @Scheduled(cron = "0 */15 * * * *")
668
    public void ccAvenueSettlement() throws Throwable {
678
    public void ccAvenueSettlement() throws Throwable {
669
        scheduledTasks.settleCCAvePayments();
679
        scheduledTasks.settleCCAvePayments();