Subversion Repositories SmartDukaan

Rev

Rev 25783 | Rev 25828 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23756 amit.gupta 1
package com.smartdukaan.cron.scheduled;
2
 
24420 amit.gupta 3
import java.time.LocalDateTime;
24121 govind 4
 
23756 amit.gupta 5
import org.apache.logging.log4j.LogManager;
6
import org.apache.logging.log4j.Logger;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.scheduling.annotation.Scheduled;
9
import org.springframework.stereotype.Component;
10
 
25782 amit.gupta 11
import com.smartdukaan.cron.migrations.RunOnceTasks;
23756 amit.gupta 12
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
24121 govind 13
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
23756 amit.gupta 14
 
15
@Component
16
public class ScheduledSkeleton {
23794 govind 17
 
23756 amit.gupta 18
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
19
 
20
	@Autowired
24784 amit.gupta 21
	private ScheduledTasks scheduledTasks;
24841 govind 22
 
24784 amit.gupta 23
	@Autowired
24
	private Reconciliation reconciliation;
25822 amit.gupta 25
 
25782 amit.gupta 26
	@Autowired
27
	private RunOnceTasks runOnceTasks;
23756 amit.gupta 28
 
29
	@Autowired
30
	NagiosMonitorTasks nagiosMonitorTasks;
24188 govind 31
 
24135 govind 32
	@Autowired
24841 govind 33
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
34
 
25585 amit.gupta 35
	@Scheduled(cron = "0 0 2 * * *")
24420 amit.gupta 36
	public void processDailySchemes() throws Exception {
25585 amit.gupta 37
		scheduledTasks.processScheme(LocalDateTime.now().minusDays(21), LocalDateTime.now(), true);
24420 amit.gupta 38
	}
24841 govind 39
 
23761 amit.gupta 40
	@Scheduled(cron = "0 15 0 * * *")
25782 amit.gupta 41
	public void runOnceTasks() throws Exception {
23756 amit.gupta 42
		scheduledTasks.reconcileRecharge();
43
	}
25822 amit.gupta 44
 
25782 amit.gupta 45
	@Scheduled(cron = "0 0 8 * * *")
46
	public void mailDashboardScreenshots() throws Exception {
25783 amit.gupta 47
		runOnceTasks.mailDashboardScreenshots();
25782 amit.gupta 48
	}
25721 tejbeer 49
 
23759 amit.gupta 50
	@Scheduled(cron = "0 05 0 1,16 * ?")
23756 amit.gupta 51
	public void processRechargeCashback() throws Throwable {
52
		scheduledTasks.processRechargeCashback();
53
	}
23794 govind 54
 
24679 amit.gupta 55
	@Scheduled(cron = "0 0 1 * * *")
25563 amit.gupta 56
	public void sendPartnerInvestmentDetails() throws Exception {
23929 amit.gupta 57
		scheduledTasks.sendPartnerInvestmentDetails();
25721 tejbeer 58
		// scheduledTasks.sendTargetVsSalesReport(null);
24679 amit.gupta 59
	}
24841 govind 60
 
24681 amit.gupta 61
	@Scheduled(cron = "0 0 8 * * *")
62
	public void sendStockAgeingReport() throws Throwable {
63
		scheduledTasks.sendAgeingReport();
64
	}
24131 govind 65
 
24890 amit.gupta 66
	@Scheduled(cron = "0 0/30 1-23 * * *")
24841 govind 67
	public void escalateTicket() throws ProfitMandiBusinessException {
24653 govind 68
		log.info("escalate ticket");
24841 govind 69
		ticketRelatedScheduledTask.escalateTicket();
24533 govind 70
	}
24841 govind 71
 
72
	@Scheduled(cron = "0 0 11 * * *")
73
	public void alertTicketToUser() throws Exception {
24653 govind 74
		log.info("alert for ticket");
24841 govind 75
		ticketRelatedScheduledTask.alertforTicket();
24653 govind 76
	}
24841 govind 77
 
25822 amit.gupta 78
	@Scheduled(cron = "0 0 15,17,19,23 ? * *")
79
	public void dailySaleNotification() throws Exception {
80
		log.info("daily send Notification");
81
		scheduledTasks.sendDailySalesReportNotificationToPartner(null);
82
	}
24841 govind 83
 
84
	@Scheduled(cron = "0 0 6 * * *")
85
	public void dailyReconciliation() throws Exception {
24784 amit.gupta 86
		reconciliation.dailyReconciliation();
87
	}
25721 tejbeer 88
 
25575 amit.gupta 89
	@Scheduled(cron = "0 */15 * * * *")
25300 tejbeer 90
	public void sendNotification() throws Throwable {
25721 tejbeer 91
		log.info("startTime" + LocalDateTime.now());
25300 tejbeer 92
		scheduledTasks.sendNotification();
25721 tejbeer 93
		log.info("endTime" + LocalDateTime.now());
25300 tejbeer 94
	}
24841 govind 95
 
25721 tejbeer 96
	@Scheduled(cron = "0 0 11 * * *")
97
	public void checkfocusedModelInPartnerStock() throws Throwable {
98
		log.info("startTime" + LocalDateTime.now());
99
		scheduledTasks.checkfocusedModelInPartnerStock();
100
 
101
		log.info("endTime" + LocalDateTime.now());
102
	}
103
 
23756 amit.gupta 104
}