| 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;
|
| 24841 |
govind |
29 |
|
| 24784 |
amit.gupta |
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 |
|
| 24841 |
govind |
39 |
@Autowired
|
|
|
40 |
private TicketRelatedScheduledTask ticketRelatedScheduledTask;
|
|
|
41 |
|
| 24679 |
amit.gupta |
42 |
@Scheduled(cron = "0 0 2 * * *")
|
| 24420 |
amit.gupta |
43 |
public void processDailySchemes() throws Exception {
|
| 24568 |
amit.gupta |
44 |
scheduledTasks.processScheme(LocalDateTime.now().minusDays(21), LocalDateTime.now());
|
| 24420 |
amit.gupta |
45 |
}
|
| 24841 |
govind |
46 |
|
| 23761 |
amit.gupta |
47 |
@Scheduled(cron = "0 15 0 * * *")
|
| 23756 |
amit.gupta |
48 |
public void reconcileRecharge() throws Exception {
|
|
|
49 |
scheduledTasks.reconcileRecharge();
|
|
|
50 |
}
|
|
|
51 |
|
| 23759 |
amit.gupta |
52 |
@Scheduled(cron = "0 05 0 1,16 * ?")
|
| 23756 |
amit.gupta |
53 |
public void processRechargeCashback() throws Throwable {
|
|
|
54 |
scheduledTasks.processRechargeCashback();
|
|
|
55 |
}
|
| 23794 |
govind |
56 |
|
| 24679 |
amit.gupta |
57 |
@Scheduled(cron = "0 0 1 * * *")
|
| 24681 |
amit.gupta |
58 |
public void sendPartnerInvestmentDetails() throws Throwable {
|
| 23929 |
amit.gupta |
59 |
scheduledTasks.sendPartnerInvestmentDetails();
|
| 24679 |
amit.gupta |
60 |
}
|
| 24841 |
govind |
61 |
|
| 24681 |
amit.gupta |
62 |
@Scheduled(cron = "0 0 8 * * *")
|
|
|
63 |
public void sendStockAgeingReport() throws Throwable {
|
|
|
64 |
scheduledTasks.sendAgeingReport();
|
|
|
65 |
}
|
| 24131 |
govind |
66 |
|
| 24420 |
amit.gupta |
67 |
@Scheduled(cron = " 0 0 23 * * *")
|
| 24131 |
govind |
68 |
public void sendMail() throws MessagingException, ProfitMandiBusinessException, IOException {
|
| 24121 |
govind |
69 |
log.info("sending mail");
|
| 24188 |
govind |
70 |
|
|
|
71 |
List<SaleHeadDetails> saleHeadDetails = fofoStoreRepository.selectAllSalesHeadDetails();
|
|
|
72 |
for (SaleHeadDetails saleHeadDetail : saleHeadDetails) {
|
| 24174 |
govind |
73 |
scheduledTasks.sendMailToSalesHeadAboutTargetAndSales(saleHeadDetail);
|
| 24135 |
govind |
74 |
}
|
| 24188 |
govind |
75 |
|
| 24121 |
govind |
76 |
}
|
| 24188 |
govind |
77 |
|
| 24420 |
amit.gupta |
78 |
@Scheduled(cron = "0 30 23 * * *")
|
| 24188 |
govind |
79 |
public void sendMailToPartner() throws MessagingException, ProfitMandiBusinessException, IOException,
|
|
|
80 |
EncryptedDocumentException, InvalidFormatException {
|
|
|
81 |
log.info("sending mail To Partner");
|
|
|
82 |
|
|
|
83 |
scheduledTasks.sendMailToPartnerAboutTargetAndSales();
|
|
|
84 |
}
|
| 24841 |
govind |
85 |
|
|
|
86 |
@Scheduled(cron = "0 0/30 * * * *")
|
|
|
87 |
public void escalateTicket() throws ProfitMandiBusinessException {
|
| 24653 |
govind |
88 |
log.info("escalate ticket");
|
| 24841 |
govind |
89 |
ticketRelatedScheduledTask.escalateTicket();
|
| 24533 |
govind |
90 |
}
|
| 24841 |
govind |
91 |
|
|
|
92 |
@Scheduled(cron = "0 0 11 * * *")
|
|
|
93 |
public void alertTicketToUser() throws Exception {
|
| 24653 |
govind |
94 |
log.info("alert for ticket");
|
| 24841 |
govind |
95 |
ticketRelatedScheduledTask.alertforTicket();
|
| 24653 |
govind |
96 |
}
|
| 24841 |
govind |
97 |
|
|
|
98 |
@Scheduled(cron = "0 0 15,17,19,23 ? * *")
|
|
|
99 |
public void dailySaleNotification() throws Exception {
|
| 24653 |
govind |
100 |
log.info("daily send Notification");
|
|
|
101 |
scheduledTasks.sendDailySalesReportNotificationToPartner();
|
|
|
102 |
}
|
| 24841 |
govind |
103 |
|
|
|
104 |
@Scheduled(cron = "0 0 6 * * *")
|
|
|
105 |
public void dailyReconciliation() throws Exception {
|
| 24784 |
amit.gupta |
106 |
reconciliation.dailyReconciliation();
|
|
|
107 |
}
|
| 24841 |
govind |
108 |
|
| 23756 |
amit.gupta |
109 |
}
|