Subversion Repositories SmartDukaan

Rev

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

Rev 33999 Rev 34137
Line 236... Line 236...
236
        String imageUrl = IMAGE_STATIC_SERVER_URL + "/" + "image" + LocalDate.now() + "/" + fileName;
236
        String imageUrl = IMAGE_STATIC_SERVER_URL + "/" + "image" + LocalDate.now() + "/" + fileName;
237
        sendNotificationModel.setImageUrl(imageUrl);
237
        sendNotificationModel.setImageUrl(imageUrl);
238
        sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
238
        sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
239
        sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(1));
239
        sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(1));
240
        sendNotificationModel.setMessageType(MessageType.scheme);
240
        sendNotificationModel.setMessageType(MessageType.scheme);
241
        Map<Integer, List<Offer>> offersMap = offerRepository.selectAllPublishedMapByPartner(YearMonth.now());
241
        //Map<Integer, List<Offer>> offersMap = offerRepository.selectAllPublishedMapByPartner(YearMonth.now());
242
 
242
 
243
        Map<String, InputStream> fileStreamsMap = new HashMap<>();
243
        Map<String, InputStream> fileStreamsMap = new HashMap<>();
244
        Map<String, Object> model = new HashMap<>();
244
        Map<String, Object> model = new HashMap<>();
245
        model.put("offer", createOfferRequest);
245
        model.put("offer", createOfferRequest);
246
        String htmlContent = this.getContentFromTemplate("offer_margin_detail_notify", model);
246
        String htmlContent = this.getContentFromTemplate("offer_margin_detail_notify", model);
Line 252... Line 252...
252
        if (isProd) {
252
        if (isProd) {
253
            this.uploadFile(fileStreamsMap);
253
            this.uploadFile(fileStreamsMap);
254
        }
254
        }
255
 
255
 
256
        List<Integer> fofoIdSet = new ArrayList<>(offerRepository.getEligibleFofoIds(offer));
256
        List<Integer> fofoIdSet = new ArrayList<>(offerRepository.getEligibleFofoIds(offer));
257
        LOGGER.info(fofoIdSet);
257
        //LOGGER.info(fofoIdSet);
258
        List<Integer> userIds = userAccountRepository.selectUserIdsByRetailerIds(new ArrayList<>(fofoIdSet));
258
        List<Integer> userIds = userAccountRepository.selectUserIdsByRetailerIds(new ArrayList<>(fofoIdSet));
259
        sendNotificationModel.setUserIds(userIds);
259
        sendNotificationModel.setUserIds(userIds);
260
        notificationService.sendNotification(sendNotificationModel);
260
        notificationService.sendNotification(sendNotificationModel);
261
        sendWhatsapp(offer, fofoIds, imageUrl);
261
        sendWhatsapp(offer, fofoIds, imageUrl);
262
 
262