| Line 158... |
Line 158... |
| 158 |
}
|
158 |
}
|
| 159 |
|
159 |
|
| 160 |
@RequestMapping(value = "/item", method = RequestMethod.GET)
|
160 |
@RequestMapping(value = "/item", method = RequestMethod.GET)
|
| 161 |
public String getItemPricing(HttpServletRequest request, Model model, @RequestParam String query) throws Throwable {
|
161 |
public String getItemPricing(HttpServletRequest request, Model model, @RequestParam String query) throws Throwable {
|
| 162 |
String query1 = query.toLowerCase();
|
162 |
String query1 = query.toLowerCase();
|
| 163 |
List<ItemDescriptionModel> partnersItemDescription = this.getAllPartnerItemStringDescription().parallelStream()
|
163 |
List<ItemDescriptionModel> partnersItemDescription = inventoryService.getAllPartnerItemStringDescription().parallelStream()
|
| 164 |
.filter(x -> x.getItemDescription().toLowerCase().matches(".*?" + query1 + ".*?"))
|
164 |
.filter(x -> x.getItemDescription().toLowerCase().matches(".*?" + query1 + ".*?"))
|
| 165 |
.collect(Collectors.toList());
|
165 |
.collect(Collectors.toList());
|
| 166 |
|
166 |
|
| 167 |
model.addAttribute("response", mvcResponseSender.createResponseString(partnersItemDescription));
|
167 |
model.addAttribute("response", mvcResponseSender.createResponseString(partnersItemDescription));
|
| 168 |
return "response";
|
168 |
return "response";
|
| 169 |
}
|
169 |
}
|
| 170 |
|
170 |
|
| 171 |
@Cacheable(value = "fofoItems", cacheManager = "thirtyMinsTimeOutCacheManager")
|
- |
|
| 172 |
private List<ItemDescriptionModel> getAllPartnerItemStringDescription() {
|
- |
|
| 173 |
return itemRepository.selectPartnerItems(0).stream().map(x -> {
|
- |
|
| 174 |
String itemDescription = x.getItemDescription() + "(" + x.getId() + ")";
|
- |
|
| 175 |
ItemDescriptionModel itemDescriptionModel = new ItemDescriptionModel();
|
- |
|
| 176 |
itemDescriptionModel.setItemDescription(itemDescription);
|
- |
|
| 177 |
itemDescriptionModel.setItemId(x.getId());
|
- |
|
| 178 |
itemDescriptionModel.setCatalogId(x.getCatalogItemId());
|
- |
|
| 179 |
return itemDescriptionModel;
|
- |
|
| 180 |
}).collect(Collectors.toList());
|
- |
|
| 181 |
}
|
- |
|
| 182 |
@RequestMapping(value = "/price-drop/imes/download")
|
171 |
@RequestMapping(value = "/price-drop/imes/download")
|
| 183 |
public ResponseEntity<ByteArrayResource> downloadPriceDropImeis(HttpServletRequest request,
|
172 |
public ResponseEntity<ByteArrayResource> downloadPriceDropImeis(HttpServletRequest request,
|
| 184 |
@RequestParam LocalDateTime affectedDate, @RequestParam int itemId) throws Exception {
|
173 |
@RequestParam LocalDateTime affectedDate, @RequestParam int itemId) throws Exception {
|
| 185 |
Item item = itemRepository.selectById(itemId);
|
174 |
Item item = itemRepository.selectById(itemId);
|
| 186 |
ByteArrayOutputStream baos = getByteArrayOutputStream(affectedDate, item.getCatalogItemId());
|
175 |
ByteArrayOutputStream baos = getByteArrayOutputStream(affectedDate, item.getCatalogItemId());
|