| Line 187... |
Line 187... |
| 187 |
@Value("${oxigen.recharge.enquiry.url}")
|
187 |
@Value("${oxigen.recharge.enquiry.url}")
|
| 188 |
private String oxigenRechargeEnquiryUrl;
|
188 |
private String oxigenRechargeEnquiryUrl;
|
| 189 |
|
189 |
|
| 190 |
@Autowired
|
190 |
@Autowired
|
| 191 |
private RegionRepository regionRepository;
|
191 |
private RegionRepository regionRepository;
|
| - |
|
192 |
|
| - |
|
193 |
private static final DateTimeFormatter leadTimeFormatter = DateTimeFormatter.ofPattern("d LLL, hh:mm a");
|
| 192 |
|
194 |
|
| 193 |
@Autowired
|
195 |
@Autowired
|
| 194 |
private PartnerRegionRepository partnerRegionRepository;
|
196 |
private PartnerRegionRepository partnerRegionRepository;
|
| 195 |
|
197 |
|
| 196 |
@Autowired
|
198 |
@Autowired
|
| Line 2197... |
Line 2199... |
| 2197 |
}
|
2199 |
}
|
| 2198 |
LOGGER.info("authUserKeyMap", authUserKeyMap);
|
2200 |
LOGGER.info("authUserKeyMap", authUserKeyMap);
|
| 2199 |
LOGGER.info("leadsToNotify {}", leadsToNotify);
|
2201 |
LOGGER.info("leadsToNotify {}", leadsToNotify);
|
| 2200 |
|
2202 |
|
| 2201 |
String templateMessage = "Lead followup for %s %s, %s is due by %s";
|
2203 |
String templateMessage = "Lead followup for %s %s, %s is due by %s";
|
| 2202 |
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("h:m a");
|
- |
|
| 2203 |
for (Lead lead : leadsToNotify) {
|
2204 |
for (Lead lead : leadsToNotify) {
|
| 2204 |
if (authUserKeyMap.get(lead.getAssignTo()) == null) {
|
2205 |
if (authUserKeyMap.get(lead.getAssignTo()) == null) {
|
| 2205 |
LOGGER.info("Assignee no longer part of system {}", lead.getAssignTo());
|
2206 |
LOGGER.info("Assignee no longer part of system {}", lead.getAssignTo());
|
| 2206 |
continue;
|
2207 |
continue;
|
| 2207 |
}
|
2208 |
}
|
| 2208 |
String notificationMessage = String.format(templateMessage, lead.getFirstName(), lead.getLastName(),
|
2209 |
String notificationMessage = String.format(templateMessage, lead.getFirstName(), lead.getLastName(),
|
| 2209 |
lead.getAddress(), timeFormatter.format(lead.getScheduledTimestamp()));
|
2210 |
lead.getAddress(), leadTimeFormatter.format(lead.getScheduledTimestamp()));
|
| 2210 |
SendNotificationModel sendNotificationModel = new SendNotificationModel();
|
2211 |
SendNotificationModel sendNotificationModel = new SendNotificationModel();
|
| 2211 |
sendNotificationModel.setCampaignName("Lead Reminder");
|
2212 |
sendNotificationModel.setCampaignName("Lead Reminder");
|
| 2212 |
sendNotificationModel.setTitle("Leads followup Reminder");
|
2213 |
sendNotificationModel.setTitle("Leads followup Reminder");
|
| 2213 |
sendNotificationModel.setMessage(notificationMessage);
|
2214 |
sendNotificationModel.setMessage(notificationMessage);
|
| 2214 |
sendNotificationModel.setType("url");
|
2215 |
sendNotificationModel.setType("url");
|