Subversion Repositories SmartDukaan

Rev

Rev 28377 | Rev 28709 | 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;
27007 amit.gupta 13
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
24121 govind 14
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
23756 amit.gupta 15
 
16
@Component
17
public class ScheduledSkeleton {
23794 govind 18
 
23756 amit.gupta 19
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
20
 
21
	@Autowired
24784 amit.gupta 22
	private ScheduledTasks scheduledTasks;
28205 tejbeer 23
 
27007 amit.gupta 24
	@Autowired
25
	private LeadSyncRunner leadSyncRunner;
24841 govind 26
 
24784 amit.gupta 27
	@Autowired
28
	private Reconciliation reconciliation;
25822 amit.gupta 29
 
25782 amit.gupta 30
	@Autowired
31
	private RunOnceTasks runOnceTasks;
23756 amit.gupta 32
 
33
	@Autowired
34
	NagiosMonitorTasks nagiosMonitorTasks;
24188 govind 35
 
24135 govind 36
	@Autowired
24841 govind 37
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
38
 
25585 amit.gupta 39
	@Scheduled(cron = "0 0 2 * * *")
24420 amit.gupta 40
	public void processDailySchemes() throws Exception {
28183 amit.gupta 41
		scheduledTasks.processScheme(LocalDateTime.now().minusDays(7), LocalDateTime.now(), false);
24420 amit.gupta 42
	}
24841 govind 43
 
23761 amit.gupta 44
	@Scheduled(cron = "0 15 0 * * *")
25782 amit.gupta 45
	public void runOnceTasks() throws Exception {
23756 amit.gupta 46
		scheduledTasks.reconcileRecharge();
47
	}
25822 amit.gupta 48
 
28205 tejbeer 49
	/*
50
	 * @Scheduled(cron = "0 0 8 * * *") public void mailDashboardScreenshots()
51
	 * throws Exception { runOnceTasks.mailDashboardScreenshots(); }
52
	 */
25721 tejbeer 53
 
23759 amit.gupta 54
	@Scheduled(cron = "0 05 0 1,16 * ?")
23756 amit.gupta 55
	public void processRechargeCashback() throws Throwable {
56
		scheduledTasks.processRechargeCashback();
57
	}
23794 govind 58
 
27267 amit.gupta 59
	@Scheduled(cron = "0 0 6 * * *")
25563 amit.gupta 60
	public void sendPartnerInvestmentDetails() throws Exception {
23929 amit.gupta 61
		scheduledTasks.sendPartnerInvestmentDetails();
25893 amit.gupta 62
	}
28632 amit.gupta 63
 
64
	@Scheduled(cron = "0 0 10,15,17 * * *")
65
	public void sendIndentTertiaryReport() throws Exception {
66
		scheduledTasks.sendIndentTertiary();
67
	}
26790 tejbeer 68
 
24681 amit.gupta 69
	@Scheduled(cron = "0 0 8 * * *")
70
	public void sendStockAgeingReport() throws Throwable {
71
		scheduledTasks.sendAgeingReport();
72
	}
24131 govind 73
 
24890 amit.gupta 74
	@Scheduled(cron = "0 0/30 1-23 * * *")
24841 govind 75
	public void escalateTicket() throws ProfitMandiBusinessException {
24653 govind 76
		log.info("escalate ticket");
24841 govind 77
		ticketRelatedScheduledTask.escalateTicket();
24533 govind 78
	}
24841 govind 79
 
80
	@Scheduled(cron = "0 0 11 * * *")
81
	public void alertTicketToUser() throws Exception {
24653 govind 82
		log.info("alert for ticket");
24841 govind 83
		ticketRelatedScheduledTask.alertforTicket();
24653 govind 84
	}
24841 govind 85
 
26943 amit.gupta 86
	@Scheduled(cron = "0 0 12,18,23 ? * *")
25822 amit.gupta 87
	public void dailySaleNotification() throws Exception {
88
		log.info("daily send Notification");
25837 amit.gupta 89
		scheduledTasks.sendDailySalesNotificationToPartner(null);
25822 amit.gupta 90
	}
24841 govind 91
 
92
	@Scheduled(cron = "0 0 6 * * *")
93
	public void dailyReconciliation() throws Exception {
24784 amit.gupta 94
		reconciliation.dailyReconciliation();
95
	}
28205 tejbeer 96
 
27441 amit.gupta 97
	@Scheduled(cron = "0 0 1 * * *")
98
	public void processActivation() throws Exception {
99
		scheduledTasks.processActivation();
100
	}
25721 tejbeer 101
 
26944 amit.gupta 102
	@Scheduled(cron = "0 */5 * * * *")
25300 tejbeer 103
	public void sendNotification() throws Throwable {
104
		scheduledTasks.sendNotification();
105
	}
28205 tejbeer 106
 
28377 tejbeer 107
	@Scheduled(cron = "0 */15 * * * *")
108
	public void checkRazorPayPaymentStatus() throws Throwable {
109
		scheduledTasks.checkRazorPayPaymentStatus();
110
	}
111
 
27686 amit.gupta 112
	@Scheduled(cron = "0 */10 * * * *")
113
	public void attachToffeeInvoices() throws Throwable {
114
		scheduledTasks.attachToffeeInvoices();
115
	}
24841 govind 116
 
26283 tejbeer 117
	@Scheduled(cron = "0 0 5 * * *")
118
	public void ticketClosed() throws Throwable {
119
 
120
		scheduledTasks.ticketClosed();
121
 
122
	}
123
 
27269 amit.gupta 124
	@Scheduled(cron = "0 45 8 * * *")
25721 tejbeer 125
	public void checkfocusedModelInPartnerStock() throws Throwable {
126
		log.info("startTime" + LocalDateTime.now());
127
		scheduledTasks.checkfocusedModelInPartnerStock();
128
 
129
		log.info("endTime" + LocalDateTime.now());
130
	}
28205 tejbeer 131
 
26083 amit.gupta 132
	@Scheduled(cron = "0 0 8,10,12,14,16,18,20 * * *")
25909 amit.gupta 133
	public void notifyLead() throws Throwable {
134
		scheduledTasks.notifyLead();
28205 tejbeer 135
		// scheduledTasks.notifyVisits();
25909 amit.gupta 136
	}
25721 tejbeer 137
 
26214 amit.gupta 138
	@Scheduled(cron = "0 0 1 * * *")
139
	public void fetchImeiActivation() throws Throwable {
26408 amit.gupta 140
		runOnceTasks.fetchImeiActivation(0);
26214 amit.gupta 141
	}
26790 tejbeer 142
 
143
	@Scheduled(cron = "0 0 1 * * *")
144
	public void checkValidateReferral() throws Throwable {
145
		log.info("startTime" + LocalDateTime.now());
146
		scheduledTasks.checkValidateReferral();
147
 
148
		log.info("endTime" + LocalDateTime.now());
149
	}
150
 
28231 tejbeer 151
	@Scheduled(cron = "0 0 8 * * *")
28205 tejbeer 152
	public void partnerProblemAlert() throws Throwable {
153
		log.info("startTime" + LocalDateTime.now());
154
		scheduledTasks.partnerProblemAlert();
155
 
156
		log.info("endTime" + LocalDateTime.now());
157
	}
23756 amit.gupta 158
}