Subversion Repositories SmartDukaan

Rev

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

Rev 24305 Rev 24420
Line 1... Line 1...
1
package com.smartdukaan.cron.scheduled;
1
package com.smartdukaan.cron.scheduled;
2
 
2
 
3
import java.io.IOException;
3
import java.io.IOException;
4
import java.text.MessageFormat;
4
import java.text.MessageFormat;
5
import java.time.LocalDate;
5
import java.time.LocalDate;
-
 
6
import java.time.LocalDateTime;
6
import java.util.List;
7
import java.util.List;
7
 
8
 
8
import javax.mail.MessagingException;
9
import javax.mail.MessagingException;
9
 
10
 
10
import org.apache.logging.log4j.LogManager;
11
import org.apache.logging.log4j.LogManager;
Line 32... Line 33...
32
	NagiosMonitorTasks nagiosMonitorTasks;
33
	NagiosMonitorTasks nagiosMonitorTasks;
33
 
34
 
34
	@Autowired
35
	@Autowired
35
	private FofoStoreRepository fofoStoreRepository;
36
	private FofoStoreRepository fofoStoreRepository;
36
 
37
 
-
 
38
	@Scheduled(cron = "0 0 1 * * *")
-
 
39
	public void processDailySchemes() throws Exception {
-
 
40
		scheduledTasks.processScheme(LocalDateTime.now().minusDays(2), LocalDateTime.now());
-
 
41
	}
-
 
42
	
37
	@Scheduled(cron = "0 15 0 * * *")
43
	@Scheduled(cron = "0 15 0 * * *")
38
	public void reconcileRecharge() throws Exception {
44
	public void reconcileRecharge() throws Exception {
39
		scheduledTasks.reconcileRecharge();
45
		scheduledTasks.reconcileRecharge();
40
	}
46
	}
41
 
47
 
Line 47... Line 53...
47
	/*
53
	/*
48
	 * Value so big so that it got to run only once.
54
	 * Value so big so that it got to run only once.
49
	 * 
55
	 * 
50
	 */
56
	 */
51
 
57
 
52
	@Scheduled(cron = "0 0 1 ? * *")
58
	@Scheduled(cron = "0 0 1 * * *")
53
	public void migrateLineItems() throws Throwable {
59
	public void migrateLineItems() throws Throwable {
54
		log.info("Started run Once");
60
		log.info("Started run Once");
55
		scheduledTasks.sendPartnerInvestmentDetails();
61
		scheduledTasks.sendPartnerInvestmentDetails();
56
	}
62
	}
57
 
63
 
58
	@Scheduled(cron = " 0 0 23 ? * *")
64
	@Scheduled(cron = " 0 0 23 * * *")
59
	public void sendMail() throws MessagingException, ProfitMandiBusinessException, IOException {
65
	public void sendMail() throws MessagingException, ProfitMandiBusinessException, IOException {
60
		log.info("sending mail");
66
		log.info("sending mail");
61
 
67
 
62
		List<SaleHeadDetails> saleHeadDetails = fofoStoreRepository.selectAllSalesHeadDetails();
68
		List<SaleHeadDetails> saleHeadDetails = fofoStoreRepository.selectAllSalesHeadDetails();
63
		for (SaleHeadDetails saleHeadDetail : saleHeadDetails) {
69
		for (SaleHeadDetails saleHeadDetail : saleHeadDetails) {
64
			scheduledTasks.sendMailToSalesHeadAboutTargetAndSales(saleHeadDetail);
70
			scheduledTasks.sendMailToSalesHeadAboutTargetAndSales(saleHeadDetail);
65
		}
71
		}
66
 
72
 
67
	}
73
	}
68
 
74
 
69
	@Scheduled(cron = "0 30 23 ? * *")
75
	@Scheduled(cron = "0 30 23 * * *")
70
	public void sendMailToPartner() throws MessagingException, ProfitMandiBusinessException, IOException,
76
	public void sendMailToPartner() throws MessagingException, ProfitMandiBusinessException, IOException,
71
			EncryptedDocumentException, InvalidFormatException {
77
			EncryptedDocumentException, InvalidFormatException {
72
		log.info("sending mail To Partner");
78
		log.info("sending mail To Partner");
73
 
79
 
74
		scheduledTasks.sendMailToPartnerAboutTargetAndSales();
80
		scheduledTasks.sendMailToPartnerAboutTargetAndSales();