| Line 226... |
Line 226... |
| 226 |
private UserRepository userUserRepository;
|
226 |
private UserRepository userUserRepository;
|
| 227 |
|
227 |
|
| 228 |
@Autowired
|
228 |
@Autowired
|
| 229 |
private AddressRepository addressRepository;
|
229 |
private AddressRepository addressRepository;
|
| 230 |
|
230 |
|
| - |
|
231 |
@Autowired
|
| - |
|
232 |
private CustomerOfferRepository customerOfferRepository;
|
| - |
|
233 |
|
| - |
|
234 |
@Autowired
|
| - |
|
235 |
private CustomerOfferItemRepository customerOfferItemRepository;
|
| - |
|
236 |
|
| 231 |
@RequestMapping(value = "/getCurrentInventorySnapshot")
|
237 |
@RequestMapping(value = "/getCurrentInventorySnapshot")
|
| 232 |
public String getCurrentAvailability(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, @RequestParam(name = "searchTerm", required = false, defaultValue = "") String searchTerm, Model model) throws ProfitMandiBusinessException {
|
238 |
public String getCurrentAvailability(HttpServletRequest request, @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit, @RequestParam(name = "searchTerm", required = false, defaultValue = "") String searchTerm, Model model) throws ProfitMandiBusinessException {
|
| 233 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
239 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 234 |
Map<String, Object> map = inventoryService.getCurrentInventorySnapshot(loginDetails.getFofoId(), offset, limit, searchTerm);
|
240 |
Map<String, Object> map = inventoryService.getCurrentInventorySnapshot(loginDetails.getFofoId(), offset, limit, searchTerm);
|
| 235 |
model.addAllAttributes(map);
|
241 |
model.addAllAttributes(map);
|
| Line 281... |
Line 287... |
| 281 |
|
287 |
|
| 282 |
throws ProfitMandiBusinessException {
|
288 |
throws ProfitMandiBusinessException {
|
| 283 |
|
289 |
|
| 284 |
List<WebOffer> webOffers = webOfferRepository.selectAllActiveOffers().get(catalogItemId);
|
290 |
List<WebOffer> webOffers = webOfferRepository.selectAllActiveOffers().get(catalogItemId);
|
| 285 |
|
291 |
|
| - |
|
292 |
LocalDateTime todayDateTime = LocalDateTime.now();
|
| - |
|
293 |
LocalDate todayDate = LocalDate.now();
|
| - |
|
294 |
|
| - |
|
295 |
List<CustomerOffer> customerOffers = customerOfferRepository.selectOffersByDate(todayDateTime);
|
| - |
|
296 |
List<Integer> customerOfferIds = customerOffers.stream().map(x -> x.getId()).collect(Collectors.toList());
|
| - |
|
297 |
List<CustomerOfferItem> customerOfferItems = customerOfferItemRepository.selectByOfferIds(customerOfferIds, catalogItemId, todayDate);
|
| - |
|
298 |
|
| 286 |
model.addAttribute("webOffers", webOffers);
|
299 |
model.addAttribute("webOffers", webOffers);
|
| - |
|
300 |
model.addAttribute("customerOfferItems", customerOfferItems);
|
| 287 |
|
301 |
|
| 288 |
return "web-offer-model";
|
302 |
return "web-offer-model";
|
| 289 |
}
|
303 |
}
|
| 290 |
|
304 |
|
| 291 |
// This method is currently hardcoded to faciliate watches sold as gift.
|
305 |
// This method is currently hardcoded to faciliate watches sold as gift.
|