Subversion Repositories SmartDukaan

Rev

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

Rev 25300 Rev 25312
Line 1... Line 1...
1
package com.smartdukaan.cron.scheduled;
1
package com.smartdukaan.cron.scheduled;
2
 
2
 
3
import java.io.IOException;
-
 
4
import java.time.LocalDateTime;
3
import java.time.LocalDateTime;
5
import java.util.List;
-
 
6
 
-
 
7
import javax.mail.MessagingException;
-
 
8
 
4
 
9
import org.apache.logging.log4j.LogManager;
5
import org.apache.logging.log4j.LogManager;
10
import org.apache.logging.log4j.Logger;
6
import org.apache.logging.log4j.Logger;
11
import org.apache.poi.EncryptedDocumentException;
-
 
12
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-
 
13
import org.springframework.beans.factory.annotation.Autowired;
7
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.scheduling.annotation.Scheduled;
8
import org.springframework.scheduling.annotation.Scheduled;
15
import org.springframework.stereotype.Component;
9
import org.springframework.stereotype.Component;
16
 
10
 
17
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
11
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
18
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
12
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
19
import com.spice.profitmandi.dao.entity.fofo.SaleHeadDetails;
-
 
20
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
-
 
21
 
13
 
22
@Component
14
@Component
23
public class ScheduledSkeleton {
15
public class ScheduledSkeleton {
24
 
16
 
25
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
17
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
Line 32... Line 24...
32
 
24
 
33
	@Autowired
25
	@Autowired
34
	NagiosMonitorTasks nagiosMonitorTasks;
26
	NagiosMonitorTasks nagiosMonitorTasks;
35
 
27
 
36
	@Autowired
28
	@Autowired
37
	private FofoStoreRepository fofoStoreRepository;
-
 
38
 
-
 
39
	@Autowired
-
 
40
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
29
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
41
 
30
 
42
	@Scheduled(cron = "0 0 2 * * *")
31
	@Scheduled(cron = "0 0 2 * * *")
43
	public void processDailySchemes() throws Exception {
32
	public void processDailySchemes() throws Exception {
44
		scheduledTasks.processScheme(LocalDateTime.now().minusDays(21), LocalDateTime.now());
33
		scheduledTasks.processScheme(LocalDateTime.now().minusDays(21), LocalDateTime.now());
Line 63... Line 52...
63
	public void sendStockAgeingReport() throws Throwable {
52
	public void sendStockAgeingReport() throws Throwable {
64
		scheduledTasks.sendAgeingReport();
53
		scheduledTasks.sendAgeingReport();
65
	}
54
	}
66
 
55
 
67
	@Scheduled(cron = " 0 0 23 * * *")
56
	@Scheduled(cron = " 0 0 23 * * *")
68
	public void sendMail() throws MessagingException, ProfitMandiBusinessException, IOException {
57
	public void sendMail() throws Exception {
69
		log.info("sending mail");
58
		log.info("sending mail");
70
 
-
 
71
		List<SaleHeadDetails> saleHeadDetails = fofoStoreRepository.selectAllSalesHeadDetails();
-
 
72
		for (SaleHeadDetails saleHeadDetail : saleHeadDetails) {
-
 
73
			scheduledTasks.sendMailToSalesHeadAboutTargetAndSales(saleHeadDetail);
-
 
74
		}
-
 
75
 
-
 
76
	}
-
 
77
 
-
 
78
	@Scheduled(cron = "0 30 23 * * *")
-
 
79
	public void sendMailToPartner() throws MessagingException, ProfitMandiBusinessException, IOException,
-
 
80
			EncryptedDocumentException, InvalidFormatException {
-
 
81
		log.info("sending mail To Partner");
-
 
82
 
-
 
83
		scheduledTasks.sendMailToPartnerAboutTargetAndSales();
59
		scheduledTasks.sendPartnerInvestmentDetails();
84
	}
60
	}
85
 
61
 
86
	@Scheduled(cron = "0 0/30 1-23 * * *")
62
	@Scheduled(cron = "0 0/30 1-23 * * *")
87
	public void escalateTicket() throws ProfitMandiBusinessException {
63
	public void escalateTicket() throws ProfitMandiBusinessException {
88
		log.info("escalate ticket");
64
		log.info("escalate ticket");