| Line 130... |
Line 130... |
| 130 |
|
130 |
|
| 131 |
@Component
|
131 |
@Component
|
| 132 |
@Transactional(rollbackFor = Throwable.class)
|
132 |
@Transactional(rollbackFor = Throwable.class)
|
| 133 |
public class ScheduledTasks {
|
133 |
public class ScheduledTasks {
|
| 134 |
|
134 |
|
| 135 |
private static final String Escalate_TICKET = "Dear {0},Your Ticket created by {1} is escalated and assigned to {2}. Regards \nSmartdukaan";
|
- |
|
| 136 |
|
- |
|
| 137 |
@Value("${oxigen.recharge.transaction.url}")
|
135 |
@Value("${oxigen.recharge.transaction.url}")
|
| 138 |
private String oxigenRechargeTransactionUrl;
|
136 |
private String oxigenRechargeTransactionUrl;
|
| 139 |
|
137 |
|
| 140 |
@Value("${oxigen.recharge.enquiry.url}")
|
138 |
@Value("${oxigen.recharge.enquiry.url}")
|
| 141 |
private String oxigenRechargeEnquiryUrl;
|
139 |
private String oxigenRechargeEnquiryUrl;
|
| Line 275... |
Line 273... |
| 275 |
|
273 |
|
| 276 |
@Autowired
|
274 |
@Autowired
|
| 277 |
private InventoryService inventoryService;
|
275 |
private InventoryService inventoryService;
|
| 278 |
|
276 |
|
| 279 |
@Autowired
|
277 |
@Autowired
|
| 280 |
private TicketRepository ticketRepository;
|
- |
|
| 281 |
|
- |
|
| 282 |
@Autowired
|
- |
|
| 283 |
private TicketAssignedRepository ticketAssignedRepository;
|
- |
|
| 284 |
|
- |
|
| 285 |
@Autowired
|
- |
|
| 286 |
private AuthRepository authRepository;
|
- |
|
| 287 |
|
- |
|
| 288 |
@Autowired
|
- |
|
| 289 |
private AddressRepository addressRepository;
|
278 |
private AddressRepository addressRepository;
|
| 290 |
|
279 |
|
| 291 |
@Autowired
|
280 |
@Autowired
|
| 292 |
private RetailerRegisteredAddressRepository retailerRegisteredAddressRepository;
|
281 |
private RetailerRegisteredAddressRepository retailerRegisteredAddressRepository;
|
| 293 |
|
282 |
|
| 294 |
@Autowired
|
283 |
@Autowired
|
| 295 |
private TicketSubCategoryRepository ticketSubCategoryRepository;
|
- |
|
| 296 |
|
- |
|
| 297 |
@Autowired
|
- |
|
| 298 |
private Mongo mongoClient;
|
284 |
private Mongo mongoClient;
|
| 299 |
|
285 |
|
| 300 |
@Autowired
|
286 |
@Autowired
|
| 301 |
private UserAccountRepository userAccountRepository;
|
287 |
private UserAccountRepository userAccountRepository;
|
| 302 |
|
288 |
|
| Line 579... |
Line 565... |
| 579 |
PartnerDailyInvestment partnerDailyInvestment = partnerInvestmentService.getInvestment(fofoStore.getId(),
|
565 |
PartnerDailyInvestment partnerDailyInvestment = partnerInvestmentService.getInvestment(fofoStore.getId(),
|
| 580 |
1);
|
566 |
1);
|
| 581 |
partnerDailyInvestment.setDate(yesterDay);
|
567 |
partnerDailyInvestment.setDate(yesterDay);
|
| 582 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
568 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
| 583 |
|
569 |
|
| 584 |
List<? extends Serializable> row = Arrays.asList(fofoStore.getCode(), retailer.getBusinessName(), retailer.getEmail(),
|
570 |
List<? extends Serializable> row = Arrays.asList(fofoStore.getCode(), retailer.getBusinessName(),
|
| 585 |
retailer.getMobileNumber(), partnerDailyInvestment.getWalletAmount(),
|
571 |
retailer.getEmail(), retailer.getMobileNumber(), partnerDailyInvestment.getWalletAmount(),
|
| 586 |
partnerDailyInvestment.getSalesAmount(), partnerDailyInvestment.getInStockAmount(), 0,
|
572 |
partnerDailyInvestment.getSalesAmount(), partnerDailyInvestment.getInStockAmount(), 0,
|
| 587 |
partnerDailyInvestment.getUnbilledAmount(), partnerDailyInvestment.getGrnPendingAmount(),
|
573 |
partnerDailyInvestment.getUnbilledAmount(), partnerDailyInvestment.getGrnPendingAmount(),
|
| 588 |
partnerDailyInvestment.getMinInvestment(), partnerDailyInvestment.getTotalInvestment(),
|
574 |
partnerDailyInvestment.getMinInvestment(), partnerDailyInvestment.getTotalInvestment(),
|
| 589 |
partnerDailyInvestment.getShortInvestment());
|
575 |
partnerDailyInvestment.getShortInvestment());
|
| 590 |
rows.add(row);
|
576 |
rows.add(row);
|
| Line 707... |
Line 693... |
| 707 |
"ItemwiseOverallPendingIndent.xml");
|
693 |
"ItemwiseOverallPendingIndent.xml");
|
| 708 |
Attachment attachment = new Attachment(
|
694 |
Attachment attachment = new Attachment(
|
| 709 |
"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr);
|
695 |
"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr);
|
| 710 |
Attachment attachment1 = new Attachment(
|
696 |
Attachment attachment1 = new Attachment(
|
| 711 |
"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr1);
|
697 |
"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr1);
|
| 712 |
Utils.sendMailWithAttachments(googleMailSender, sendTo, null, "Stock Aeging Report", "PFA", attachment, attachment1);
|
698 |
Utils.sendMailWithAttachments(googleMailSender, sendTo, null, "Stock Aeging Report", "PFA", attachment,
|
| - |
|
699 |
attachment1);
|
| 713 |
}
|
700 |
}
|
| 714 |
|
701 |
|
| 715 |
public void sendAgeingReport() throws Exception {
|
702 |
public void sendAgeingReport() throws Exception {
|
| 716 |
sendAgeingReport("amod.sen@smartdukaan.com", "adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com",
|
703 |
sendAgeingReport("amod.sen@smartdukaan.com", "adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com",
|
| 717 |
"tarun.verma@smartdukaan.com", "chaitnaya.vats@smartdukaan.com", "mohinder.mutreja@smartdukaan.com");
|
704 |
"tarun.verma@smartdukaan.com", "chaitnaya.vats@smartdukaan.com", "mohinder.mutreja@smartdukaan.com");
|
| Line 733... |
Line 720... |
| 733 |
for (PartnerDailyInvestment investment : Lists
|
720 |
for (PartnerDailyInvestment investment : Lists
|
| 734 |
.reverse(partnerDailyInvestmentRepository.selectAll(fofoId, null, null))) {
|
721 |
.reverse(partnerDailyInvestmentRepository.selectAll(fofoId, null, null))) {
|
| 735 |
float statementAmount = walletService.getOpeningTill(fofoId,
|
722 |
float statementAmount = walletService.getOpeningTill(fofoId,
|
| 736 |
investment.getDate().plusDays(1).atTime(LocalTime.of(4, 0)));
|
723 |
investment.getDate().plusDays(1).atTime(LocalTime.of(4, 0)));
|
| 737 |
CustomRetailer retailer = retailerService.getFofoRetailer(fofoId);
|
724 |
CustomRetailer retailer = retailerService.getFofoRetailer(fofoId);
|
| 738 |
LOGGER.info("{}\t{}\t{}\t{}\t{}", fofoId, retailer.getBusinessName(), retailer.getMobileNumber(), investment.getDate().toString(),
|
725 |
LOGGER.info("{}\t{}\t{}\t{}\t{}", fofoId, retailer.getBusinessName(), retailer.getMobileNumber(),
|
| 739 |
investment.getWalletAmount(), statementAmount);
|
726 |
investment.getDate().toString(), investment.getWalletAmount(), statementAmount);
|
| 740 |
|
727 |
|
| 741 |
}
|
728 |
}
|
| 742 |
}
|
729 |
}
|
| 743 |
|
730 |
|
| 744 |
}
|
731 |
}
|
| 745 |
|
732 |
|
| 746 |
public void escalateTicket() throws ProfitMandiBusinessException {
|
- |
|
| 747 |
List<Ticket> tickets = ticketRepository.selectAllNotClosedTickets().stream()
|
- |
|
| 748 |
.filter(x -> x.getLastActivity() != ActivityType.RESOLVED).collect(Collectors.toList());
|
- |
|
| 749 |
LocalDateTime now = LocalDateTime.now();
|
- |
|
| 750 |
for (Ticket ticket : tickets) {
|
- |
|
| 751 |
if (ticket.getL2EscalationTimestamp().isBefore(now) && ticket.getL3EscalationTimestamp().isAfter(now)) {
|
- |
|
| 752 |
TicketAssigned ticketAssigned = ticketAssignedRepository
|
- |
|
| 753 |
.selectByAssigneeIdAndTicketId(ticket.getL2AuthUser(), ticket.getId());
|
- |
|
| 754 |
if (ticketAssigned == null) {
|
- |
|
| 755 |
ticketAssigned = new TicketAssigned();
|
- |
|
| 756 |
ticketAssigned.setAssineeId(ticket.getL2AuthUser());
|
- |
|
| 757 |
ticketAssigned.setTicketId(ticket.getId());
|
- |
|
| 758 |
ticketAssignedRepository.persist(ticketAssigned);
|
- |
|
| 759 |
String subject = "Escalated Ticket";
|
- |
|
| 760 |
LOGGER.info(subject);
|
- |
|
| 761 |
|
- |
|
| 762 |
String message = MessageFormat.format(Escalate_TICKET,
|
- |
|
| 763 |
authRepository.selectById(ticket.getL1AuthUser()).getFirstName(),
|
- |
|
| 764 |
retailerService.getFofoRetailer(ticket.getFofoId()).getBusinessName(),
|
- |
|
| 765 |
authRepository.selectById(ticket.getL2AuthUser()).getFirstName());
|
- |
|
| 766 |
LOGGER.info(message);
|
- |
|
| 767 |
|
- |
|
| 768 |
String[] cc = { authRepository.selectById(ticket.getL2AuthUser()).getEmailId() };
|
- |
|
| 769 |
LOGGER.info(cc[0]);
|
- |
|
| 770 |
|
- |
|
| 771 |
String to = authRepository.selectById(ticket.getL1AuthUser()).getEmailId();
|
- |
|
| 772 |
LOGGER.info(to);
|
- |
|
| 773 |
|
- |
|
| 774 |
this.sendEscaltedTicketMail(to, subject, message, cc);
|
- |
|
| 775 |
LOGGER.info(subject + " " + message + " " + to + " " + cc[0]);
|
- |
|
| 776 |
}
|
- |
|
| 777 |
} else if (ticket.getL3EscalationTimestamp().isBefore(now)
|
- |
|
| 778 |
&& ticket.getLastEscalationTimestamp().isAfter(now)) {
|
- |
|
| 779 |
TicketAssigned ticketAssigned = ticketAssignedRepository
|
- |
|
| 780 |
.selectByAssigneeIdAndTicketId(ticket.getL3AuthUser(), ticket.getId());
|
- |
|
| 781 |
if (ticketAssigned == null) {
|
- |
|
| 782 |
ticketAssigned = new TicketAssigned();
|
- |
|
| 783 |
ticketAssigned.setAssineeId(ticket.getL3AuthUser());
|
- |
|
| 784 |
ticketAssigned.setTicketId(ticket.getId());
|
- |
|
| 785 |
ticketAssignedRepository.persist(ticketAssigned);
|
- |
|
| 786 |
String subject = "Escalated Ticket";
|
- |
|
| 787 |
String message = MessageFormat.format(Escalate_TICKET,
|
- |
|
| 788 |
authRepository.selectById(ticket.getL2AuthUser()).getFirstName(),
|
- |
|
| 789 |
retailerService.getFofoRetailer(ticket.getFofoId()).getBusinessName(),
|
- |
|
| 790 |
authRepository.selectById(ticket.getL3AuthUser()).getFirstName());
|
- |
|
| 791 |
LOGGER.info(subject);
|
- |
|
| 792 |
LOGGER.info(message);
|
- |
|
| 793 |
String[] cc = { authRepository.selectById(ticket.getL3AuthUser()).getEmailId() };
|
- |
|
| 794 |
LOGGER.info(cc[0]);
|
- |
|
| 795 |
|
- |
|
| 796 |
String to = authRepository.selectById(ticket.getL2AuthUser()).getEmailId();
|
- |
|
| 797 |
LOGGER.info(to);
|
- |
|
| 798 |
this.sendEscaltedTicketMail(to, subject, message, cc);
|
- |
|
| 799 |
LOGGER.info(subject);
|
- |
|
| 800 |
}
|
- |
|
| 801 |
}
|
- |
|
| 802 |
}
|
- |
|
| 803 |
}
|
- |
|
| 804 |
|
- |
|
| 805 |
private void sendEscaltedTicketMail(String to, String subject, String message, String[] cc)
|
- |
|
| 806 |
throws ProfitMandiBusinessException {
|
- |
|
| 807 |
try {
|
- |
|
| 808 |
Utils.sendMailWithAttachments(mailSender, to, cc, subject, message, null);
|
- |
|
| 809 |
LOGGER.info("mail send successfully");
|
- |
|
| 810 |
} catch (Exception e) {
|
- |
|
| 811 |
throw new ProfitMandiBusinessException("Escalated Ticket", to, "Could not send Escalated ticket mail");
|
- |
|
| 812 |
}
|
- |
|
| 813 |
}
|
- |
|
| 814 |
|
- |
|
| 815 |
public void gst() throws Exception {
|
733 |
public void gst() throws Exception {
|
| 816 |
List<FofoOrder> fofoOrders = fofoOrderRepository.selectBetweenSaleDate(LocalDate.of(2019, 1, 26).atStartOfDay(),
|
734 |
List<FofoOrder> fofoOrders = fofoOrderRepository.selectBetweenSaleDate(LocalDate.of(2019, 1, 26).atStartOfDay(),
|
| 817 |
LocalDate.of(2019, 1, 27).atTime(LocalTime.MAX));
|
735 |
LocalDate.of(2019, 1, 27).atTime(LocalTime.MAX));
|
| 818 |
for (FofoOrder fofoOrder : fofoOrders) {
|
736 |
for (FofoOrder fofoOrder : fofoOrders) {
|
| 819 |
int retailerAddressId = retailerRegisteredAddressRepository
|
737 |
int retailerAddressId = retailerRegisteredAddressRepository
|
| Line 1024... |
Line 942... |
| 1024 |
new String[] { "amit.gupta@shop2020.in", "neeraj.gupta@smartdukaan.com" }, null,
|
942 |
new String[] { "amit.gupta@shop2020.in", "neeraj.gupta@smartdukaan.com" }, null,
|
| 1025 |
"Partner Excess Amount Scheme In", "PFA",
|
943 |
"Partner Excess Amount Scheme In", "PFA",
|
| 1026 |
new Attachment[] { new Attachment("WalletSummary.csv", new ByteArrayResource(baos.toByteArray())),
|
944 |
new Attachment[] { new Attachment("WalletSummary.csv", new ByteArrayResource(baos.toByteArray())),
|
| 1027 |
new Attachment("SchemeInRolledback.csv", new ByteArrayResource(baosOuts.toByteArray())) });
|
945 |
new Attachment("SchemeInRolledback.csv", new ByteArrayResource(baosOuts.toByteArray())) });
|
| 1028 |
|
946 |
|
| 1029 |
//throw new Exception();
|
947 |
// throw new Exception();
|
| 1030 |
|
948 |
|
| 1031 |
}
|
949 |
}
|
| 1032 |
|
950 |
|
| 1033 |
public void dryRunOutSchemeReco() throws Exception {
|
951 |
public void dryRunOutSchemeReco() throws Exception {
|
| 1034 |
List<UserWalletHistory> userWalletHistory = new ArrayList<>();
|
952 |
List<UserWalletHistory> userWalletHistory = new ArrayList<>();
|
| Line 1136... |
Line 1054... |
| 1136 |
new String[] { "amit.gupta@shop2020.in", "neeraj.gupta@smartdukaan.com" }, null,
|
1054 |
new String[] { "amit.gupta@shop2020.in", "neeraj.gupta@smartdukaan.com" }, null,
|
| 1137 |
"Partner Excess Amount Scheme Out", "PFA",
|
1055 |
"Partner Excess Amount Scheme Out", "PFA",
|
| 1138 |
new Attachment[] { new Attachment("WalletSummary.csv", new ByteArrayResource(baos.toByteArray())),
|
1056 |
new Attachment[] { new Attachment("WalletSummary.csv", new ByteArrayResource(baos.toByteArray())),
|
| 1139 |
new Attachment("SchemeOutRolledback.csv", new ByteArrayResource(baosOuts.toByteArray())) });
|
1057 |
new Attachment("SchemeOutRolledback.csv", new ByteArrayResource(baosOuts.toByteArray())) });
|
| 1140 |
|
1058 |
|
| 1141 |
//throw new Exception();
|
1059 |
// throw new Exception();
|
| 1142 |
}
|
1060 |
}
|
| 1143 |
|
1061 |
|
| 1144 |
public void dryRunSchemeOutReco1() throws Exception {
|
1062 |
public void dryRunSchemeOutReco1() throws Exception {
|
| 1145 |
List<Integer> references = Arrays.asList(6744, 7347, 8320, 8891, 9124, 9217, 9263, 9379);
|
1063 |
List<Integer> references = Arrays.asList(6744, 7347, 8320, 8891, 9124, 9217, 9263, 9379);
|
| 1146 |
List<UserWalletHistory> userWalletHistory = new ArrayList<>();
|
1064 |
List<UserWalletHistory> userWalletHistory = new ArrayList<>();
|
| Line 1213... |
Line 1131... |
| 1213 |
|
1131 |
|
| 1214 |
throw new Exception();
|
1132 |
throw new Exception();
|
| 1215 |
|
1133 |
|
| 1216 |
}
|
1134 |
}
|
| 1217 |
|
1135 |
|
| 1218 |
public void alertforTicket() throws Exception {
|
- |
|
| 1219 |
List<Ticket> tickets = ticketRepository.selectAllNotClosedTickets();
|
- |
|
| 1220 |
Map<Integer, List<Ticket>> l1AuthUserAndTicketMap = new HashMap<>();
|
- |
|
| 1221 |
Map<Integer, List<Ticket>> l2AuthUserAndTicketMap = new HashMap<>();
|
- |
|
| 1222 |
Set<Integer> l1AuthUsers = tickets.stream().map(x -> x.getL1AuthUser()).collect(Collectors.toSet());
|
- |
|
| 1223 |
Set<Integer> l2AuthUsers = tickets.stream()
|
- |
|
| 1224 |
.filter(x -> x.getL2EscalationTimestamp().isBefore(LocalDateTime.now())).map(x -> x.getL2AuthUser())
|
- |
|
| 1225 |
.collect(Collectors.toSet());
|
- |
|
| 1226 |
for (Integer l1AuthUser : l1AuthUsers) {
|
- |
|
| 1227 |
List<Ticket> ticketsForl1AuthUser = tickets.stream().filter(ticket -> l1AuthUser == ticket.getL1AuthUser())
|
- |
|
| 1228 |
.collect(Collectors.toList());
|
- |
|
| 1229 |
l1AuthUserAndTicketMap.put(l1AuthUser, ticketsForl1AuthUser);
|
- |
|
| 1230 |
}
|
- |
|
| 1231 |
for (Integer l2AuthUser : l2AuthUsers) {
|
- |
|
| 1232 |
List<Ticket> ticketsForl2AuthUser = tickets.stream().filter(ticket -> l2AuthUser == ticket.getL2AuthUser())
|
- |
|
| 1233 |
.collect(Collectors.toList());
|
- |
|
| 1234 |
l2AuthUserAndTicketMap.put(l2AuthUser, ticketsForl2AuthUser);
|
- |
|
| 1235 |
}
|
- |
|
| 1236 |
for (Entry<Integer, List<Ticket>> entry : l1AuthUserAndTicketMap.entrySet()) {
|
- |
|
| 1237 |
List<Ticket> ticketsForAuthUser = entry.getValue();
|
- |
|
| 1238 |
AuthUser authUser = authRepository.selectById(entry.getKey());
|
- |
|
| 1239 |
String message = this.getMessageForAlertTicket(ticketsForAuthUser, EscalationType.L1);
|
- |
|
| 1240 |
this.sendMailOfHtmlFomat(authUser.getEmailId(), message, null, "Daily Pending Ticket");
|
- |
|
| 1241 |
}
|
- |
|
| 1242 |
for (Entry<Integer, List<Ticket>> entry : l2AuthUserAndTicketMap.entrySet()) {
|
- |
|
| 1243 |
List<Ticket> ticketsForAuthUser = entry.getValue();
|
- |
|
| 1244 |
AuthUser authUser = authRepository.selectById(entry.getKey());
|
- |
|
| 1245 |
String message = this.getMessageForAlertTicket(ticketsForAuthUser, EscalationType.L2);
|
- |
|
| 1246 |
this.sendMailOfHtmlFomat(authUser.getEmailId(), message, null, "Daily Pending Ticket");
|
- |
|
| 1247 |
}
|
- |
|
| 1248 |
}
|
- |
|
| 1249 |
|
- |
|
| 1250 |
public String getMessageForAlertTicket(List<Ticket> tickets, EscalationType escalationType)
|
- |
|
| 1251 |
throws ProfitMandiBusinessException {
|
- |
|
| 1252 |
StringBuilder sb = new StringBuilder();
|
- |
|
| 1253 |
sb.append("<html><body><p>Your Pending Tickets</p><br/><table style='border:1px solid black ;padding: 5px';>");
|
- |
|
| 1254 |
sb.append("<tbody>\n" + " <tr>\n"
|
- |
|
| 1255 |
+ " <th style='border:1px solid black;padding: 5px'>Ticket Id</th>\n"
|
- |
|
| 1256 |
+ " <th style='border:1px solid black;padding: 5px'>Partner</th>\n"
|
- |
|
| 1257 |
+ " <th style='border:1px solid black;padding: 5px'>SubCategory</th>\n"
|
- |
|
| 1258 |
+ " <th style='border:1px solid black;padding: 5px'>Remaining Time To Escalate</th>\n"
|
- |
|
| 1259 |
+ " <th style='border:1px solid black;padding: 5px'>Escalated</th>\n"
|
- |
|
| 1260 |
+ " </tr>");
|
- |
|
| 1261 |
for (Ticket ticket : tickets) {
|
- |
|
| 1262 |
sb.append("<tr>");
|
- |
|
| 1263 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + ticket.getId() + "</td>");
|
- |
|
| 1264 |
sb.append("<td style='border:1px solid black;padding: 5px'>"
|
- |
|
| 1265 |
+ retailerService.getFofoRetailer(ticket.getFofoId()).getBusinessName() + "</td>");
|
- |
|
| 1266 |
sb.append("<td style='border:1px solid black;padding: 5px'>"
|
- |
|
| 1267 |
+ ticketSubCategoryRepository.selectById(ticket.getSubCategoryId()).getDescription() + "</td>");
|
- |
|
| 1268 |
if (escalationType == EscalationType.L1) {
|
- |
|
| 1269 |
if (ticket.getL2EscalationTimestamp().isBefore(LocalDateTime.now())) {
|
- |
|
| 1270 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + 0 + "</td>");
|
- |
|
| 1271 |
sb.append("<td style='border:1px solid black;padding: 5px'>YES</td>");
|
- |
|
| 1272 |
} else {
|
- |
|
| 1273 |
Duration duration = Duration.between(LocalDateTime.now(), ticket.getL2EscalationTimestamp());
|
- |
|
| 1274 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + duration.toHours() + "hrs</td>");
|
- |
|
| 1275 |
sb.append("<td style='border:1px solid black;padding: 5px'>NO</td>");
|
- |
|
| 1276 |
}
|
- |
|
| 1277 |
} else if (escalationType == EscalationType.L2) {
|
- |
|
| 1278 |
if (ticket.getL3EscalationTimestamp().isBefore(LocalDateTime.now())) {
|
- |
|
| 1279 |
Duration duration = Duration.between(ticket.getL3EscalationTimestamp(), LocalDateTime.now());
|
- |
|
| 1280 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + duration.toHours() + " hrs</td>");
|
- |
|
| 1281 |
sb.append("<td style='border:1px solid black;padding: 5px'>YES</td>");
|
- |
|
| 1282 |
} else {
|
- |
|
| 1283 |
sb.append("<td style='border:1px solid black;padding: 5px'>NO</td>");
|
- |
|
| 1284 |
}
|
- |
|
| 1285 |
}
|
- |
|
| 1286 |
sb.append("</tr>");
|
- |
|
| 1287 |
}
|
- |
|
| 1288 |
sb.append("</tbody></table></body></html>");
|
- |
|
| 1289 |
return sb.toString();
|
- |
|
| 1290 |
}
|
- |
|
| 1291 |
|
- |
|
| 1292 |
private void sendMailOfHtmlFomat(String email, String body, String cc[], String subject)
|
- |
|
| 1293 |
throws MessagingException, ProfitMandiBusinessException, IOException {
|
- |
|
| 1294 |
MimeMessage message = mailSender.createMimeMessage();
|
- |
|
| 1295 |
MimeMessageHelper helper = new MimeMessageHelper(message);
|
- |
|
| 1296 |
helper.setSubject(subject);
|
- |
|
| 1297 |
helper.setText(body, true);
|
- |
|
| 1298 |
helper.setTo(email);
|
- |
|
| 1299 |
if (cc != null) {
|
- |
|
| 1300 |
helper.setCc(cc);
|
- |
|
| 1301 |
}
|
- |
|
| 1302 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smart Dukaan");
|
- |
|
| 1303 |
helper.setFrom(senderAddress);
|
- |
|
| 1304 |
mailSender.send(message);
|
- |
|
| 1305 |
}
|
- |
|
| 1306 |
|
- |
|
| 1307 |
public void sendDailySalesReportNotificationToPartner()
|
1136 |
public void sendDailySalesReportNotificationToPartner()
|
| 1308 |
throws ProfitMandiBusinessException, MessagingException, IOException {
|
1137 |
throws ProfitMandiBusinessException, MessagingException, IOException {
|
| 1309 |
LocalDateTime now = LocalDateTime.now();
|
1138 |
LocalDateTime now = LocalDateTime.now();
|
| 1310 |
LocalDateTime from = LocalDateTime.of(now.getYear(), now.getMonth(), now.getDayOfMonth(), 00, 00);
|
1139 |
LocalDateTime from = LocalDateTime.of(now.getYear(), now.getMonth(), now.getDayOfMonth(), 00, 00);
|
| 1311 |
Map<Integer, Double> salesByFofoIdMap = new HashMap<>();
|
1140 |
Map<Integer, Double> salesByFofoIdMap = new HashMap<>();
|
| Line 1399... |
Line 1228... |
| 1399 |
}
|
1228 |
}
|
| 1400 |
|
1229 |
|
| 1401 |
sb.append("</tbody></table></body></html>");
|
1230 |
sb.append("</tbody></table></body></html>");
|
| 1402 |
return sb.toString();
|
1231 |
return sb.toString();
|
| 1403 |
}
|
1232 |
}
|
| - |
|
1233 |
|
| - |
|
1234 |
private void sendMailOfHtmlFomat(String email, String body, String cc[], String subject)
|
| - |
|
1235 |
throws MessagingException, ProfitMandiBusinessException, IOException {
|
| - |
|
1236 |
MimeMessage message = mailSender.createMimeMessage();
|
| - |
|
1237 |
MimeMessageHelper helper = new MimeMessageHelper(message);
|
| - |
|
1238 |
helper.setSubject(subject);
|
| - |
|
1239 |
helper.setText(body, true);
|
| - |
|
1240 |
helper.setTo(email);
|
| - |
|
1241 |
if (cc != null) {
|
| - |
|
1242 |
helper.setCc(cc);
|
| - |
|
1243 |
}
|
| - |
|
1244 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smart Dukaan");
|
| - |
|
1245 |
helper.setFrom(senderAddress);
|
| - |
|
1246 |
mailSender.send(message);
|
| - |
|
1247 |
}
|
| 1404 |
}
|
1248 |
}
|