Subversion Repositories SmartDukaan

Rev

Rev 24681 | Rev 24841 | 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
 
24121 govind 3
import java.io.IOException;
24420 amit.gupta 4
import java.time.LocalDateTime;
24135 govind 5
import java.util.List;
24121 govind 6
 
7
import javax.mail.MessagingException;
8
 
23756 amit.gupta 9
import org.apache.logging.log4j.LogManager;
10
import org.apache.logging.log4j.Logger;
24188 govind 11
import org.apache.poi.EncryptedDocumentException;
12
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
23756 amit.gupta 13
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.scheduling.annotation.Scheduled;
15
import org.springframework.stereotype.Component;
16
 
17
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
24121 govind 18
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
24135 govind 19
import com.spice.profitmandi.dao.entity.fofo.SaleHeadDetails;
20
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
23756 amit.gupta 21
 
22
@Component
23
public class ScheduledSkeleton {
23794 govind 24
 
23756 amit.gupta 25
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
26
 
27
	@Autowired
24784 amit.gupta 28
	private ScheduledTasks scheduledTasks;
29
 
30
	@Autowired
31
	private Reconciliation reconciliation;
23756 amit.gupta 32
 
33
	@Autowired
34
	NagiosMonitorTasks nagiosMonitorTasks;
24188 govind 35
 
24135 govind 36
	@Autowired
37
	private FofoStoreRepository fofoStoreRepository;
23756 amit.gupta 38
 
24679 amit.gupta 39
	@Scheduled(cron = "0 0 2 * * *")
24420 amit.gupta 40
	public void processDailySchemes() throws Exception {
24568 amit.gupta 41
		scheduledTasks.processScheme(LocalDateTime.now().minusDays(21), LocalDateTime.now());
24420 amit.gupta 42
	}
43
 
23761 amit.gupta 44
	@Scheduled(cron = "0 15 0 * * *")
23756 amit.gupta 45
	public void reconcileRecharge() throws Exception {
46
		scheduledTasks.reconcileRecharge();
47
	}
48
 
23759 amit.gupta 49
	@Scheduled(cron = "0 05 0 1,16 * ?")
23756 amit.gupta 50
	public void processRechargeCashback() throws Throwable {
51
		scheduledTasks.processRechargeCashback();
52
	}
23794 govind 53
 
24679 amit.gupta 54
	@Scheduled(cron = "0 0 1 * * *")
24681 amit.gupta 55
	public void sendPartnerInvestmentDetails() throws Throwable {
23929 amit.gupta 56
		scheduledTasks.sendPartnerInvestmentDetails();
24679 amit.gupta 57
	}
24681 amit.gupta 58
 
59
	@Scheduled(cron = "0 0 8 * * *")
60
	public void sendStockAgeingReport() throws Throwable {
61
		scheduledTasks.sendAgeingReport();
62
	}
24131 govind 63
 
24420 amit.gupta 64
	@Scheduled(cron = " 0 0 23 * * *")
24131 govind 65
	public void sendMail() throws MessagingException, ProfitMandiBusinessException, IOException {
24121 govind 66
		log.info("sending mail");
24188 govind 67
 
68
		List<SaleHeadDetails> saleHeadDetails = fofoStoreRepository.selectAllSalesHeadDetails();
69
		for (SaleHeadDetails saleHeadDetail : saleHeadDetails) {
24174 govind 70
			scheduledTasks.sendMailToSalesHeadAboutTargetAndSales(saleHeadDetail);
24135 govind 71
		}
24188 govind 72
 
24121 govind 73
	}
24188 govind 74
 
24420 amit.gupta 75
	@Scheduled(cron = "0 30 23 * * *")
24188 govind 76
	public void sendMailToPartner() throws MessagingException, ProfitMandiBusinessException, IOException,
77
			EncryptedDocumentException, InvalidFormatException {
78
		log.info("sending mail To Partner");
79
 
80
		scheduledTasks.sendMailToPartnerAboutTargetAndSales();
81
	}
24564 amit.gupta 82
	@Scheduled(cron="0 0/30 * * * *")
24533 govind 83
	public void escalateTicket() throws ProfitMandiBusinessException
84
	{
24653 govind 85
		log.info("escalate ticket");
24533 govind 86
		scheduledTasks.escalateTicket();
87
	}
24664 govind 88
	@Scheduled(cron="0 0 11 * * *")
24653 govind 89
	public void alertTicketToUser() throws Exception
90
	{
91
		log.info("alert for ticket");
92
		scheduledTasks.alertforTicket();
93
	}
24678 govind 94
	@Scheduled(cron="0 0 15,17,19,23 ? * *")
24653 govind 95
	public void dailySaleNotification() throws Exception
96
	{
97
		log.info("daily send Notification");
98
		scheduledTasks.sendDailySalesReportNotificationToPartner();
99
	}
24784 amit.gupta 100
	@Scheduled(cron="0 0 6 * * *")
101
	public void dailyReconciliation() throws Exception
102
	{
103
		reconciliation.dailyReconciliation();
104
	}
24653 govind 105
 
23756 amit.gupta 106
}