| Line 3848... |
Line 3848... |
| 3848 |
|
3848 |
|
| 3849 |
private void sendUnholdEmail(List<Order> orders) throws Exception {
|
3849 |
private void sendUnholdEmail(List<Order> orders) throws Exception {
|
| 3850 |
|
3850 |
|
| 3851 |
|
3851 |
|
| 3852 |
orders.forEach(x -> x.setShipmentHold(false));
|
3852 |
orders.forEach(x -> x.setShipmentHold(false));
|
| - |
|
3853 |
orders = orders.stream().filter(x->x.getRefundTimestamp()!= null).collect(Collectors.toList());
|
| - |
|
3854 |
|
| 3853 |
double totalAmount = orders.stream().collect(Collectors.summingDouble(x -> x.getTotalAmount()));
|
3855 |
double totalAmount = orders.stream().collect(Collectors.summingDouble(x -> x.getTotalAmount()));
|
| 3854 |
|
3856 |
|
| 3855 |
List<String> authUserEmail = csService.getAuthUserIdByPartnerId(orders.get(0).getRetailerId()).stream().map(x -> x.getEmailId()).collect(Collectors.toList());
|
3857 |
List<String> authUserEmail = csService.getAuthUserIdByPartnerId(orders.get(0).getRetailerId()).stream().map(x -> x.getEmailId()).collect(Collectors.toList());
|
| 3856 |
authUserEmail.add("vinay.p@smartdukaan.com");
|
3858 |
authUserEmail.add("vinay.p@smartdukaan.com");
|
| 3857 |
authUserEmail.add("shivam.gupta@smartdukaan.com");
|
3859 |
authUserEmail.add("shivam.gupta@smartdukaan.com");
|
| 3858 |
|
3860 |
|
| 3859 |
String[] emailTo = authUserEmail.toArray(new String[authUserEmail.size()]);
|
3861 |
String[] emailTo = authUserEmail.toArray(new String[authUserEmail.size()]);
|
| 3860 |
|
3862 |
|
| 3861 |
String[] ccTo = {"tarun.verma@smartdukaan.com", "kamini.sharma@smartdukaan.com"};
|
3863 |
String[] ccTo = {"tarun.verma@smartdukaan.com", "kamini.sharma@smartdukaan.com"};
|
| 3862 |
|
3864 |
|
| 3863 |
String subject = "Dispatched " + (orders.get(0).getRetailerName());
|
3865 |
String subject = "Dispatch held orders of - " + (orders.get(0).getRetailerName());
|
| 3864 |
String message = String.format("Dear Team, \n" + "kindly note the material for the " + orders.get(0).getRetailerName() + "of Rs." + totalAmount + "is dispatched.");
|
3866 |
String message = String.format("Dear Team, \n" + "kindly note the material for the " + orders.get(0).getRetailerName() + "of Rs." + totalAmount + "is unhold now and needs to be dispatched.");
|
| 3865 |
Utils.sendMailWithAttachments(mailSender, emailTo, ccTo, subject, message);
|
3867 |
Utils.sendMailWithAttachments(mailSender, emailTo, ccTo, subject, message);
|
| 3866 |
|
3868 |
|
| 3867 |
|
3869 |
|
| 3868 |
}
|
3870 |
}
|
| 3869 |
|
3871 |
|