| Line 151... |
Line 151... |
| 151 |
public String createOffer(HttpServletRequest request, @RequestBody CreateOfferRequest createOfferRequest,
|
151 |
public String createOffer(HttpServletRequest request, @RequestBody CreateOfferRequest createOfferRequest,
|
| 152 |
Model model) throws Exception {
|
152 |
Model model) throws Exception {
|
| 153 |
LOGGER.info("createOfferRequest [{}]", createOfferRequest);
|
153 |
LOGGER.info("createOfferRequest [{}]", createOfferRequest);
|
| 154 |
offerService.addOfferService(createOfferRequest);
|
154 |
offerService.addOfferService(createOfferRequest);
|
| 155 |
thirtyMinsTimeOutCacheManager.getCache("allOffers").evict(YearMonth.now());
|
155 |
thirtyMinsTimeOutCacheManager.getCache("allOffers").evict(YearMonth.now());
|
| 156 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
156 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 157 |
return "response";
|
157 |
return "response";
|
| 158 |
|
158 |
|
| 159 |
}
|
159 |
}
|
| 160 |
|
160 |
|
| 161 |
@RequestMapping(value = "/offers/published", method = RequestMethod.GET)
|
161 |
@RequestMapping(value = "/offers/published", method = RequestMethod.GET)
|
| Line 188... |
Line 188... |
| 188 |
for (Offer offer : offers) {
|
188 |
for (Offer offer : offers) {
|
| 189 |
if (active && !offer.isAlreadyActive()) {
|
189 |
if (active && !offer.isAlreadyActive()) {
|
| 190 |
this.sendNotification(offer);
|
190 |
this.sendNotification(offer);
|
| 191 |
}
|
191 |
}
|
| 192 |
}
|
192 |
}
|
| 193 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
193 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 194 |
return "response";
|
194 |
return "response";
|
| 195 |
// CreateOfferRequest createOfferRequest =
|
195 |
// CreateOfferRequest createOfferRequest =
|
| 196 |
// offerService.getCreateOfferRequest(offer);
|
196 |
// offerService.getCreateOfferRequest(offer);
|
| 197 |
// model.addAttribute("offer", createOfferRequest);
|
197 |
// model.addAttribute("offer", createOfferRequest);
|
| 198 |
// return "offer_margin_detail_partner2";
|
198 |
// return "offer_margin_detail_partner2";
|
| Line 200... |
Line 200... |
| 200 |
|
200 |
|
| 201 |
@RequestMapping(value = "/offer/testimage/{offerId}", method = RequestMethod.GET)
|
201 |
@RequestMapping(value = "/offer/testimage/{offerId}", method = RequestMethod.GET)
|
| 202 |
public String testOffer(HttpServletRequest request, @PathVariable int offerId, Model model,
|
202 |
public String testOffer(HttpServletRequest request, @PathVariable int offerId, Model model,
|
| 203 |
@RequestParam(defaultValue = "true") boolean active) throws ProfitMandiBusinessException, Exception {
|
203 |
@RequestParam(defaultValue = "true") boolean active) throws ProfitMandiBusinessException, Exception {
|
| 204 |
Offer offer = offerRepository.selectById(offerId);
|
204 |
Offer offer = offerRepository.selectById(offerId);
|
| 205 |
// model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
205 |
// model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 206 |
// return "response";
|
206 |
// return "response";
|
| 207 |
CreateOfferRequest createOfferRequest = offerService.getCreateOfferRequest(offer);
|
207 |
CreateOfferRequest createOfferRequest = offerService.getCreateOfferRequest(offer);
|
| 208 |
model.addAttribute("offer", createOfferRequest);
|
208 |
model.addAttribute("offer", createOfferRequest);
|
| 209 |
return "offer_margin_detail_partner2";
|
209 |
return "offer_margin_detail_partner2";
|
| 210 |
}
|
210 |
}
|
| Line 217... |
Line 217... |
| 217 |
@RequestParam(defaultValue = "true") boolean active) throws ProfitMandiBusinessException, Exception {
|
217 |
@RequestParam(defaultValue = "true") boolean active) throws ProfitMandiBusinessException, Exception {
|
| 218 |
List<Offer> offers = offerRepository.selectAllPublishedMapByPartner(YearMonth.now()).get(fofoId);
|
218 |
List<Offer> offers = offerRepository.selectAllPublishedMapByPartner(YearMonth.now()).get(fofoId);
|
| 219 |
for (Offer offer : offers) {
|
219 |
for (Offer offer : offers) {
|
| 220 |
this.sendNotification(offer);
|
220 |
this.sendNotification(offer);
|
| 221 |
}
|
221 |
}
|
| 222 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
222 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 223 |
return "response";
|
223 |
return "response";
|
| 224 |
}
|
224 |
}
|
| 225 |
|
225 |
|
| 226 |
@Autowired
|
226 |
@Autowired
|
| 227 |
UserAccountRepository userAccountRepository;
|
227 |
UserAccountRepository userAccountRepository;
|
| Line 488... |
Line 488... |
| 488 |
|
488 |
|
| 489 |
@PostMapping(value = "/offers/upload")
|
489 |
@PostMapping(value = "/offers/upload")
|
| 490 |
public String uploadOffers(HttpServletRequest request, @RequestPart("file") MultipartFile targetFile, Model model)
|
490 |
public String uploadOffers(HttpServletRequest request, @RequestPart("file") MultipartFile targetFile, Model model)
|
| 491 |
throws Exception {
|
491 |
throws Exception {
|
| 492 |
offerService.createOffers(targetFile.getInputStream());
|
492 |
offerService.createOffers(targetFile.getInputStream());
|
| 493 |
model.addAttribute("response", true);
|
493 |
model.addAttribute("response1", true);
|
| 494 |
return "response";
|
494 |
return "response";
|
| 495 |
}
|
495 |
}
|
| 496 |
|
496 |
|
| 497 |
@Autowired
|
497 |
@Autowired
|
| 498 |
RoleManager roleManager;
|
498 |
RoleManager roleManager;
|