| Line 768... |
Line 768... |
| 768 |
// Calculate the number of days since the last purchase (billing)
|
768 |
// Calculate the number of days since the last purchase (billing)
|
| 769 |
lastPurchaseDays = (int) Duration.between(order.getCreateTimestamp().plusDays(1), LocalDateTime.now()).toDays();
|
769 |
lastPurchaseDays = (int) Duration.between(order.getCreateTimestamp().plusDays(1), LocalDateTime.now()).toDays();
|
| 770 |
|
770 |
|
| 771 |
if (lastPurchaseDays >= 11) {
|
771 |
if (lastPurchaseDays >= 11) {
|
| 772 |
alertLevel = "Alert for Management";
|
772 |
alertLevel = "Alert for Management";
|
| 773 |
} else if (lastPurchaseDays >= 8) {
|
773 |
} else if (lastPurchaseDays >= 10) {
|
| 774 |
alertLevel = " Alert for RSM/SH";
|
774 |
alertLevel = " Alert for RSM/SH";
|
| 775 |
} else if (lastPurchaseDays >= 6) {
|
775 |
} else if (lastPurchaseDays >= 7) {
|
| 776 |
alertLevel = "Must be Billed";
|
776 |
alertLevel = "Must be Billed";
|
| 777 |
} else if (lastPurchaseDays >= 3) {
|
777 |
} else if (lastPurchaseDays >= 3) {
|
| 778 |
alertLevel = "OK";
|
778 |
alertLevel = "OK";
|
| 779 |
} else {
|
779 |
} else {
|
| 780 |
alertLevel = "No Action Needed";
|
780 |
alertLevel = "OK";
|
| 781 |
}
|
781 |
}
|
| 782 |
}
|
782 |
}
|
| 783 |
|
783 |
|
| 784 |
//investment modal set all related value
|
784 |
//investment modal set all related value
|
| 785 |
FofoInvestmentModel fofoInvestmentModel = new FofoInvestmentModel();
|
785 |
FofoInvestmentModel fofoInvestmentModel = new FofoInvestmentModel();
|
| Line 1007... |
Line 1007... |
| 1007 |
|
1007 |
|
| 1008 |
// Send to email
|
1008 |
// Send to email
|
| 1009 |
// ByteArrayOutputStream csvStream = FileUtil.getCSVByteStreamWithMultiHeaders(headerGroup, rows);
|
1009 |
// ByteArrayOutputStream csvStream = FileUtil.getCSVByteStreamWithMultiHeaders(headerGroup, rows);
|
| 1010 |
ByteArrayOutputStream csvStream = getExcelStreamWithMultiHeaders(headerGroup, rows);
|
1010 |
ByteArrayOutputStream csvStream = getExcelStreamWithMultiHeaders(headerGroup, rows);
|
| 1011 |
String fileName = "BI-Retailer-Monthly-Report-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".xlsx";
|
1011 |
String fileName = "BI-Retailer-Monthly-Report-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".xlsx";
|
| 1012 |
String[] sendToArray = new String[]{"ranu.rajput@smartdukaan.com","ashutosh.verma@smartdukaan.com"};
|
1012 |
String[] sendToArray = new String[]{"ranu.rajput@smartdukaan.com","ashutosh.verma@smartdukaan.com","sm@smartdukaan.com","raj.singh@smartdukaan.com"};
|
| 1013 |
|
1013 |
|
| 1014 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, new String[]{}, "BI Retailer Monthly Report", "Please find attached the BI retailer secondary/tertiary monthly report.", fileName, new ByteArrayResource(csvStream.toByteArray()));
|
1014 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, new String[]{}, "BI Retailer Monthly Report", "Please find attached the BI retailer secondary/tertiary monthly report.", fileName, new ByteArrayResource(csvStream.toByteArray()));
|
| 1015 |
|
1015 |
|
| 1016 |
|
1016 |
|
| 1017 |
}
|
1017 |
}
|