| Line 197... |
Line 197... |
| 197 |
}
|
197 |
}
|
| 198 |
|
198 |
|
| 199 |
@Autowired
|
199 |
@Autowired
|
| 200 |
private com.spice.profitmandi.dao.repository.dtr.UserRepository dtrUserRepository;
|
200 |
private com.spice.profitmandi.dao.repository.dtr.UserRepository dtrUserRepository;
|
| 201 |
|
201 |
|
| - |
|
202 |
@RequestMapping(value = "/offer/active/fofo/{fofoId}", method = RequestMethod.GET)
|
| - |
|
203 |
public String sendOfferNotification(HttpServletRequest request, @PathVariable int fofoId, Model model, @RequestParam(defaultValue = "true") boolean active)
|
| - |
|
204 |
throws ProfitMandiBusinessException, Exception {
|
| - |
|
205 |
List<Offer> offers = offerRepository.selectAllPublishedMapByPartner(YearMonth.now()).get(fofoId);
|
| - |
|
206 |
for(Offer offer : offers) {
|
| - |
|
207 |
this.sendNotification(offer);
|
| - |
|
208 |
}
|
| - |
|
209 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
| - |
|
210 |
return "response";
|
| - |
|
211 |
}
|
| - |
|
212 |
|
| 202 |
private void sendNotification(Offer offer) throws Exception {
|
213 |
private void sendNotification(Offer offer) throws Exception {
|
| 203 |
String fileName = "offer-" + offer.getId() + ".png";
|
214 |
String fileName = "offer-" + offer.getId() + ".png";
|
| 204 |
CreateOfferRequest createOfferRequest = offerService.getCreateOfferRequest(offer);
|
215 |
CreateOfferRequest createOfferRequest = offerService.getCreateOfferRequest(offer);
|
| 205 |
SendNotificationModel sendNotificationModel = new SendNotificationModel();
|
216 |
SendNotificationModel sendNotificationModel = new SendNotificationModel();
|
| 206 |
sendNotificationModel.setCampaignName("SchemeOffer");
|
217 |
sendNotificationModel.setCampaignName("SchemeOffer");
|