Subversion Repositories SmartDukaan

Rev

Rev 30989 | Rev 30999 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30989 Rev 30991
Line 108... Line 108...
108
import javax.mail.MessagingException;
108
import javax.mail.MessagingException;
109
import javax.mail.internet.InternetAddress;
109
import javax.mail.internet.InternetAddress;
110
import javax.mail.internet.MimeMessage;
110
import javax.mail.internet.MimeMessage;
111
import java.io.*;
111
import java.io.*;
112
import java.math.BigDecimal;
112
import java.math.BigDecimal;
-
 
113
import java.math.RoundingMode;
113
import java.nio.file.Files;
114
import java.nio.file.Files;
114
import java.nio.file.Paths;
115
import java.nio.file.Paths;
115
import java.sql.Timestamp;
116
import java.sql.Timestamp;
116
import java.text.DecimalFormat;
117
import java.text.DecimalFormat;
117
import java.time.*;
118
import java.time.*;
Line 2654... Line 2655...
2654
			sendNotificationModel.setMessageType(MessageType.reminder);
2655
			sendNotificationModel.setMessageType(MessageType.reminder);
2655
			sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(lead.getAssignTo())));
2656
			sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(lead.getAssignTo())));
2656
			System.out.println(sendNotificationModel);
2657
			System.out.println(sendNotificationModel);
2657
			notificationService.sendNotification(sendNotificationModel);
2658
			notificationService.sendNotification(sendNotificationModel);
2658
			AuthUser authUser = authRepository.selectById(lead.getAssignTo());
2659
			AuthUser authUser = authRepository.selectById(lead.getAssignTo());
2659
		//	notificationService.sendWhatsappMessage(notificationMessage, title, authUser.getMobileNumber());
2660
			// notificationService.sendWhatsappMessage(notificationMessage, title,
-
 
2661
			// authUser.getMobileNumber());
2660
		}
2662
		}
2661
	}
2663
	}
2662
 
2664
 
2663
	public void notifyVisits() throws Exception {
2665
	public void notifyVisits() throws Exception {
2664
		List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository
2666
		List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository
Line 2697... Line 2699...
2697
			sendNotificationModel.setType("url");
2699
			sendNotificationModel.setType("url");
2698
			sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
2700
			sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
2699
			sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(2));
2701
			sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(2));
2700
			sendNotificationModel.setMessageType(MessageType.reminder);
2702
			sendNotificationModel.setMessageType(MessageType.reminder);
2701
			sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(visit.getAuthId())));
2703
			sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(visit.getAuthId())));
2702
			//notificationService.sendNotification(sendNotificationModel);
2704
			// notificationService.sendNotification(sendNotificationModel);
2703
		}
2705
		}
2704
	}
2706
	}
2705
 
2707
 
2706
	public void ticketClosed() throws Exception {
2708
	public void ticketClosed() throws Exception {
2707
 
2709
 
Line 3764... Line 3766...
3764
 
3766
 
3765
			String title = "Loan Amount Overdue!";
3767
			String title = "Loan Amount Overdue!";
3766
			String url = "http://app.smartdukaan.com/pages/home/credit";
3768
			String url = "http://app.smartdukaan.com/pages/home/credit";
3767
			String message = "Your loan due date "
3769
			String message = "Your loan due date "
3768
					+ defaultLoan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))
3770
					+ defaultLoan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))
3769
					+ " has been exceeded. Additional penal interest of " + defaultLoan.getInterestRate()
3771
					+ " has been exceeded. Additional penal interest of "
-
 
3772
					+ defaultLoan.getInterestRate().setScale(2, RoundingMode.HALF_UP)
3770
					+ "%  and Rs.100 shall be levied on daily basis." + " Your total pending Loan amount is Rs."
3773
					+ "%  and Rs.100 shall be levied on daily basis." + " Your total pending Loan amount is Rs."
3771
					+ FormattingUtils.formatDecimal(Math.abs(amount)) +". !!Pay Now!!";
3774
					+ FormattingUtils.formatDecimal(Math.abs(amount)) + ". !!Pay Now!!";
3772
			notificationService.sendNotification(defaultLoan.getFofoId(), title, MessageType.notification, title,
3775
			notificationService.sendNotification(defaultLoan.getFofoId(), title, MessageType.notification, title,
3773
					message, url);
3776
					message, url);
3774
 
3777
 
3775
			notificationService.sendWhatsappMessage(message, title, address.getPhoneNumber());
3778
			notificationService.sendWhatsappMessage(message, title, address.getPhoneNumber());
3776
 
3779
 
Line 3843... Line 3846...
3843
					String url = "http://app.smartdukaan.com/pages/home/credit";
3846
					String url = "http://app.smartdukaan.com/pages/home/credit";
3844
 
3847
 
3845
					String title = "Alert!";
3848
					String title = "Alert!";
3846
					String message = "Your loan due date "
3849
					String message = "Your loan due date "
3847
							+ loan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))
3850
							+ loan.getDueDate().toLocalDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))
3848
							+ " has been exceeded. Additional penal interest of " + loan.getInterestRate()
3851
							+ " has been exceeded. Additional penal interest of "
-
 
3852
							+ loan.getInterestRate().setScale(2, RoundingMode.HALF_UP)
3849
							+ "% shall be levied on daily basis. Your total pending loan amount is Rs."
3853
							+ "% shall be levied on daily basis. Your total pending loan amount is Rs."
3850
							+ FormattingUtils.formatDecimal(Math.abs(amount)) + ". !!Pay Now!!";
3854
							+ FormattingUtils.formatDecimal(Math.abs(amount)) + ". !!Pay Now!!";
3851
 
3855
 
3852
					notificationService.sendNotification(loan.getFofoId(), title, MessageType.notification, title,
3856
					notificationService.sendNotification(loan.getFofoId(), title, MessageType.notification, title,
3853
							message, url);
3857
							message, url);