Subversion Repositories SmartDukaan

Rev

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

Rev 34060 Rev 35210
Line 329... Line 329...
329
 
329
 
330
 
330
 
331
                        Set<String> invoiceNumber = new HashSet<>();
331
                        Set<String> invoiceNumber = new HashSet<>();
332
                        invoiceNumber.addAll(dn.getValue().getInvoiceNumber());
332
                        invoiceNumber.addAll(dn.getValue().getInvoiceNumber());
333
 
333
 
334
                        String message = String.format("Dear partner, your items with Invoice Number " + String.join(",", invoiceNumber) + " worth Rs." + dn.getValue().getTotalAmount() + " and qty " + dn.getValue().getTotalQty() + " has been shipped through " + pr.getName() + " via your track id " + dn.getKey() + " and expected to be delivered by " + dn.getValue().getDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + ".");
334
                        String message = String.format("Dear Partner, your items with the invoice number " + String.join(",", invoiceNumber) + " worth Rs." + dn.getValue().getTotalAmount() + " and qty " + dn.getValue().getTotalQty() + " has been shipped through " + pr.getName() + " via your track id " + dn.getKey() + " and is expected to be delivered by " + dn.getValue().getDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + ".");
335
 
335
 
336
                        SendNotificationModel sendNotificationModel = new SendNotificationModel();
336
                        SendNotificationModel sendNotificationModel = new SendNotificationModel();
337
                        sendNotificationModel.setCampaignName("Order Shipped");
337
                        sendNotificationModel.setCampaignName("Order Shipped");
338
                        sendNotificationModel.setTitle(title);
338
                        sendNotificationModel.setTitle(title);
339
                        sendNotificationModel.setMessage(message);
339
                        sendNotificationModel.setMessage(message);
Line 664... Line 664...
664
                            order.getShippingTimestamp().toLocalDate(), pt, ddm.getDelayDay());
664
                            order.getShippingTimestamp().toLocalDate(), pt, ddm.getDelayDay());
665
 
665
 
666
                    orders.forEach(x -> x.setExpectedDeliveryTime(deliveryDate.atStartOfDay()));
666
                    orders.forEach(x -> x.setExpectedDeliveryTime(deliveryDate.atStartOfDay()));
667
 
667
 
668
                    String title = "Order Update";
668
                    String title = "Order Update";
669
                    String message = String.format("Dear partner, your items with Invoice Number " + String.join(",", invoiceNumbers) + " worth Rs." + totalAmount + " and qty " + totalQty + " has been shipped through " + providerRepository.selectById(order.getLogisticsProviderId()).getName() + " via your track id " + ddm.getAirwayBIllNumber() + " has been delayed due to " + ddm.getReason() + " and will be delivered by " + deliveryDate.format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))) + ".";
669
                    String message = String.format("Dear Partner, your items with invoice number " + String.join(",", invoiceNumbers) + " worth Rs." + totalAmount + " and qty " + totalQty + " has been shipped through " + providerRepository.selectById(order.getLogisticsProviderId()).getName() + " via your track id " + ddm.getAirwayBIllNumber() + " has been delayed due to " + ddm.getReason() + " and will be delivered by " + deliveryDate.format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))) + ".";
670
 
670
 
671
                    com.spice.profitmandi.dao.entity.user.User user = userUserRepository.selectById(order.getRetailerId());
671
                    com.spice.profitmandi.dao.entity.user.User user = userUserRepository.selectById(order.getRetailerId());
672
 
672
 
673
                    Address address = addressRepository.selectById(user.getAddressId());
673
                    Address address = addressRepository.selectById(user.getAddressId());
674
 
674
 
Line 770... Line 770...
770
                        String title = "Order Delivered";
770
                        String title = "Order Delivered";
771
 
771
 
772
                        SendNotificationModel sendNotificationModel = new SendNotificationModel();
772
                        SendNotificationModel sendNotificationModel = new SendNotificationModel();
773
                        sendNotificationModel.setCampaignName("Order Delivered");
773
                        sendNotificationModel.setCampaignName("Order Delivered");
774
                        sendNotificationModel.setTitle(title);
774
                        sendNotificationModel.setTitle(title);
775
                        sendNotificationModel.setMessage(String.format("Dear partner, your SmartDukaan Shipment " + dl.getAirwayBillNumber() + " has been delivered on" + dl.getDeliveredOn().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + " to you in a safe, sealed bag by " + dl.getDeliveredBy() + "."));
775
                        sendNotificationModel.setMessage(String.format("Dear Partner, your SmartDukaan shipment " + dl.getAirwayBillNumber() + " has been delivered on" + dl.getDeliveredOn().format(DateTimeFormatter.ofPattern("dd-MM-yyyy")) + " to you in a safe, sealed bag by " + dl.getDeliveredBy() + "."));
776
                        sendNotificationModel.setType("url");
776
                        sendNotificationModel.setType("url");
777
                        sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
777
                        sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
778
                        sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(1));
778
                        sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(1));
779
                        sendNotificationModel.setMessageType(MessageType.notification);
779
                        sendNotificationModel.setMessageType(MessageType.notification);
780
                        int userId = userAccountRepository.selectUserIdByRetailerId(orders.get(0).getRetailerId());
780
                        int userId = userAccountRepository.selectUserIdByRetailerId(orders.get(0).getRetailerId());
Line 866... Line 866...
866
 
866
 
867
                SendNotificationModel sendNotificationModel = new SendNotificationModel();
867
                SendNotificationModel sendNotificationModel = new SendNotificationModel();
868
                sendNotificationModel.setCampaignName("Order Hold");
868
                sendNotificationModel.setCampaignName("Order Hold");
869
                sendNotificationModel.setTitle("Order Hold");
869
                sendNotificationModel.setTitle("Order Hold");
870
                sendNotificationModel.setMessage(
870
                sendNotificationModel.setMessage(
871
                        String.format("Dear partner, your SmartDukaan order " + delayBilling.getInvoiceNumber() + " has been delayed due to" + delayBilling.getReason() + "."));
871
                        String.format("Dear Partner, your SmartDukaan order number " + delayBilling.getInvoiceNumber() + " has been delayed due to" + delayBilling.getReason() + "."));
872
                sendNotificationModel.setType("url");
872
                sendNotificationModel.setType("url");
873
                sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
873
                sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
874
                sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(1));
874
                sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(1));
875
                sendNotificationModel.setMessageType(MessageType.notification);
875
                sendNotificationModel.setMessageType(MessageType.notification);
876
                int userId = userAccountRepository.selectUserIdByRetailerId(orders.get(0).getRetailerId());
876
                int userId = userAccountRepository.selectUserIdByRetailerId(orders.get(0).getRetailerId());