Subversion Repositories SmartDukaan

Rev

Rev 25564 | Rev 25585 | 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
 
11
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
24121 govind 12
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
23756 amit.gupta 13
 
14
@Component
15
public class ScheduledSkeleton {
23794 govind 16
 
23756 amit.gupta 17
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
18
 
19
	@Autowired
24784 amit.gupta 20
	private ScheduledTasks scheduledTasks;
24841 govind 21
 
24784 amit.gupta 22
	@Autowired
23
	private Reconciliation reconciliation;
23756 amit.gupta 24
 
25
	@Autowired
26
	NagiosMonitorTasks nagiosMonitorTasks;
24188 govind 27
 
24135 govind 28
	@Autowired
24841 govind 29
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
30
 
25504 amit.gupta 31
	//@Scheduled(cron = "0 0 2 * * *")
24420 amit.gupta 32
	public void processDailySchemes() throws Exception {
24568 amit.gupta 33
		scheduledTasks.processScheme(LocalDateTime.now().minusDays(21), LocalDateTime.now());
24420 amit.gupta 34
	}
24841 govind 35
 
23761 amit.gupta 36
	@Scheduled(cron = "0 15 0 * * *")
23756 amit.gupta 37
	public void reconcileRecharge() throws Exception {
38
		scheduledTasks.reconcileRecharge();
39
	}
25300 tejbeer 40
 
23759 amit.gupta 41
	@Scheduled(cron = "0 05 0 1,16 * ?")
23756 amit.gupta 42
	public void processRechargeCashback() throws Throwable {
43
		scheduledTasks.processRechargeCashback();
44
	}
23794 govind 45
 
24679 amit.gupta 46
	@Scheduled(cron = "0 0 1 * * *")
25563 amit.gupta 47
	public void sendPartnerInvestmentDetails() throws Exception {
23929 amit.gupta 48
		scheduledTasks.sendPartnerInvestmentDetails();
25564 amit.gupta 49
		//scheduledTasks.sendTargetVsSalesReport(null);
24679 amit.gupta 50
	}
24841 govind 51
 
25370 amit.gupta 52
 
24681 amit.gupta 53
	@Scheduled(cron = "0 0 8 * * *")
54
	public void sendStockAgeingReport() throws Throwable {
55
		scheduledTasks.sendAgeingReport();
56
	}
24131 govind 57
 
25370 amit.gupta 58
	/*@Scheduled(cron = " 0 0 23 * * *")
25312 amit.gupta 59
	public void sendMail() throws Exception {
24121 govind 60
		log.info("sending mail");
25312 amit.gupta 61
		scheduledTasks.sendPartnerInvestmentDetails();
25370 amit.gupta 62
	}*/
24188 govind 63
 
24890 amit.gupta 64
	@Scheduled(cron = "0 0/30 1-23 * * *")
24841 govind 65
	public void escalateTicket() throws ProfitMandiBusinessException {
24653 govind 66
		log.info("escalate ticket");
24841 govind 67
		ticketRelatedScheduledTask.escalateTicket();
24533 govind 68
	}
24841 govind 69
 
70
	@Scheduled(cron = "0 0 11 * * *")
71
	public void alertTicketToUser() throws Exception {
24653 govind 72
		log.info("alert for ticket");
24841 govind 73
		ticketRelatedScheduledTask.alertforTicket();
24653 govind 74
	}
24841 govind 75
 
25370 amit.gupta 76
	/*@Scheduled(cron = "0 0 15,17,19,23 ? * *")
24841 govind 77
	public void dailySaleNotification() throws Exception {
24653 govind 78
		log.info("daily send Notification");
24855 amit.gupta 79
		scheduledTasks.sendDailySalesReportNotificationToPartner(null);
25370 amit.gupta 80
	}*/
24841 govind 81
 
82
	@Scheduled(cron = "0 0 6 * * *")
83
	public void dailyReconciliation() throws Exception {
24784 amit.gupta 84
		reconciliation.dailyReconciliation();
85
	}
25300 tejbeer 86
 
87
 
25575 amit.gupta 88
	@Scheduled(cron = "0 */15 * * * *")
25300 tejbeer 89
	public void sendNotification() throws Throwable {
25343 tejbeer 90
		log.info("startTime"+LocalDateTime.now());
25300 tejbeer 91
		scheduledTasks.sendNotification();
25343 tejbeer 92
		log.info("endTime"+LocalDateTime.now());
25300 tejbeer 93
	}
24841 govind 94
 
23756 amit.gupta 95
}