| Line 1962... |
Line 1962... |
| 1962 |
for (Map.Entry<Integer, String> authUserEmail : authUserEmailMap.entrySet()) {
|
1962 |
for (Map.Entry<Integer, String> authUserEmail : authUserEmailMap.entrySet()) {
|
| 1963 |
int authId = authUserEmail.getKey();
|
1963 |
int authId = authUserEmail.getKey();
|
| 1964 |
String email = authUserEmail.getValue();
|
1964 |
String email = authUserEmail.getValue();
|
| 1965 |
authUserKeyMap.put(authId, dtrEmailMap.get(email));
|
1965 |
authUserKeyMap.put(authId, dtrEmailMap.get(email));
|
| 1966 |
}
|
1966 |
}
|
| - |
|
1967 |
System.out.println(authUserKeyMap);
|
| - |
|
1968 |
System.out.println(leadsToNotify);
|
| - |
|
1969 |
|
| 1967 |
String templateMessage = "Lead followup for %s %s, %s is due by %s";
|
1970 |
String templateMessage = "Lead followup for %s %s, %s is due by %s";
|
| 1968 |
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("h:m a");
|
1971 |
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("h:m a");
|
| 1969 |
for (Lead lead : leadsToNotify) {
|
1972 |
for (Lead lead : leadsToNotify) {
|
| 1970 |
if (authUserKeyMap.get(lead.getAuthId()) == null) {
|
1973 |
if (authUserKeyMap.get(lead.getAuthId()) == null) {
|
| 1971 |
continue;
|
1974 |
continue;
|
| Line 1980... |
Line 1983... |
| 1980 |
sendNotificationModel.setType("url");
|
1983 |
sendNotificationModel.setType("url");
|
| 1981 |
sendNotificationModel.setUrl("http://app.profitmandi.com/pages/home/notifications");
|
1984 |
sendNotificationModel.setUrl("http://app.profitmandi.com/pages/home/notifications");
|
| 1982 |
sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(2));
|
1985 |
sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(2));
|
| 1983 |
sendNotificationModel.setMessageType(MessageType.reminder);
|
1986 |
sendNotificationModel.setMessageType(MessageType.reminder);
|
| 1984 |
sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(lead.getAuthId())));
|
1987 |
sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(lead.getAuthId())));
|
| - |
|
1988 |
System.out.println(sendNotificationModel);
|
| 1985 |
notificationService.sendNotification(sendNotificationModel);
|
1989 |
notificationService.sendNotification(sendNotificationModel);
|
| 1986 |
}
|
1990 |
}
|
| 1987 |
}
|
1991 |
}
|
| 1988 |
public void notifyVisits() throws Exception {
|
1992 |
public void notifyVisits() throws Exception {
|
| 1989 |
List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository.selectVisitsScheduledBetweenDate(LocalDateTime.now().minusDays(15),
|
1993 |
List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository.selectVisitsScheduledBetweenDate(LocalDateTime.now().minusDays(15),
|