| 23756 |
amit.gupta |
1 |
package com.smartdukaan.cron.scheduled;
|
|
|
2 |
|
| 24121 |
govind |
3 |
import java.io.IOException;
|
|
|
4 |
import java.text.MessageFormat;
|
|
|
5 |
import java.time.LocalDate;
|
| 24135 |
govind |
6 |
import java.util.List;
|
| 24121 |
govind |
7 |
|
|
|
8 |
import javax.mail.MessagingException;
|
|
|
9 |
|
| 23756 |
amit.gupta |
10 |
import org.apache.logging.log4j.LogManager;
|
|
|
11 |
import org.apache.logging.log4j.Logger;
|
| 24188 |
govind |
12 |
import org.apache.poi.EncryptedDocumentException;
|
|
|
13 |
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
| 23756 |
amit.gupta |
14 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
15 |
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
16 |
import org.springframework.stereotype.Component;
|
|
|
17 |
|
|
|
18 |
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
|
| 24121 |
govind |
19 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 24135 |
govind |
20 |
import com.spice.profitmandi.dao.entity.fofo.SaleHeadDetails;
|
|
|
21 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 23756 |
amit.gupta |
22 |
|
|
|
23 |
@Component
|
|
|
24 |
public class ScheduledSkeleton {
|
| 23794 |
govind |
25 |
|
| 23756 |
amit.gupta |
26 |
private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
|
|
|
27 |
|
|
|
28 |
@Autowired
|
|
|
29 |
ScheduledTasks scheduledTasks;
|
|
|
30 |
|
|
|
31 |
@Autowired
|
|
|
32 |
NagiosMonitorTasks nagiosMonitorTasks;
|
| 24188 |
govind |
33 |
|
| 24135 |
govind |
34 |
@Autowired
|
|
|
35 |
private FofoStoreRepository fofoStoreRepository;
|
| 23756 |
amit.gupta |
36 |
|
| 23761 |
amit.gupta |
37 |
@Scheduled(cron = "0 15 0 * * *")
|
| 23756 |
amit.gupta |
38 |
public void reconcileRecharge() throws Exception {
|
|
|
39 |
scheduledTasks.reconcileRecharge();
|
|
|
40 |
}
|
|
|
41 |
|
| 23759 |
amit.gupta |
42 |
@Scheduled(cron = "0 05 0 1,16 * ?")
|
| 23756 |
amit.gupta |
43 |
public void processRechargeCashback() throws Throwable {
|
|
|
44 |
scheduledTasks.processRechargeCashback();
|
|
|
45 |
}
|
| 23794 |
govind |
46 |
|
|
|
47 |
/*
|
|
|
48 |
* Value so big so that it got to run only once.
|
| 23756 |
amit.gupta |
49 |
*
|
|
|
50 |
*/
|
| 23929 |
amit.gupta |
51 |
|
| 24305 |
amit.gupta |
52 |
@Scheduled(cron = "0 0 1 ? * *")
|
| 23794 |
govind |
53 |
public void migrateLineItems() throws Throwable {
|
| 23756 |
amit.gupta |
54 |
log.info("Started run Once");
|
| 23929 |
amit.gupta |
55 |
scheduledTasks.sendPartnerInvestmentDetails();
|
| 23756 |
amit.gupta |
56 |
}
|
| 24131 |
govind |
57 |
|
| 24136 |
govind |
58 |
@Scheduled(cron = " 0 0 23 ? * *")
|
| 24131 |
govind |
59 |
public void sendMail() throws MessagingException, ProfitMandiBusinessException, IOException {
|
| 24121 |
govind |
60 |
log.info("sending mail");
|
| 24188 |
govind |
61 |
|
|
|
62 |
List<SaleHeadDetails> saleHeadDetails = fofoStoreRepository.selectAllSalesHeadDetails();
|
|
|
63 |
for (SaleHeadDetails saleHeadDetail : saleHeadDetails) {
|
| 24174 |
govind |
64 |
scheduledTasks.sendMailToSalesHeadAboutTargetAndSales(saleHeadDetail);
|
| 24135 |
govind |
65 |
}
|
| 24188 |
govind |
66 |
|
| 24121 |
govind |
67 |
}
|
| 24188 |
govind |
68 |
|
|
|
69 |
@Scheduled(cron = "0 30 23 ? * *")
|
|
|
70 |
public void sendMailToPartner() throws MessagingException, ProfitMandiBusinessException, IOException,
|
|
|
71 |
EncryptedDocumentException, InvalidFormatException {
|
|
|
72 |
log.info("sending mail To Partner");
|
|
|
73 |
|
|
|
74 |
scheduledTasks.sendMailToPartnerAboutTargetAndSales();
|
|
|
75 |
|
|
|
76 |
}
|
| 23756 |
amit.gupta |
77 |
}
|