| Line 286... |
Line 286... |
| 286 |
{
|
286 |
{
|
| 287 |
if (catalogId == 0) {
|
287 |
if (catalogId == 0) {
|
| 288 |
catalogId = itemRepository.selectById(itemId).getCatalogItemId();
|
288 |
catalogId = itemRepository.selectById(itemId).getCatalogItemId();
|
| 289 |
}
|
289 |
}
|
| 290 |
List<Item> items = itemRepository.selectAllByCatalogItemId(catalogId);
|
290 |
List<Item> items = itemRepository.selectAllByCatalogItemId(catalogId);
|
| - |
|
291 |
LOGGER.info("Items {}", items);
|
| 291 |
Map<Integer, String> itemsColorMap = items.stream().filter(x->x.getColor().startsWith("f_")).collect(Collectors.toMap(Item::getId, Item::getColor));
|
292 |
Map<Integer, String> itemsColorMap = items.stream().filter(x->x.getColorNatural().startsWith("f_")).collect(Collectors.toMap(Item::getId, Item::getColor));
|
| 292 |
Map<Integer, TagListing> tagsMap = tagListingRepository
|
293 |
Map<Integer, TagListing> tagsMap = tagListingRepository
|
| 293 |
.selectByItemIdsAndTagIds(items.stream().map(x -> x.getId()).collect(Collectors.toSet()), defaultTags)
|
294 |
.selectByItemIdsAndTagIds(items.stream().map(x -> x.getId()).collect(Collectors.toSet()), defaultTags)
|
| 294 |
.stream().collect(Collectors.toMap(TagListing::getItemId, x->x));
|
295 |
.stream().collect(Collectors.toMap(TagListing::getItemId, x->x));
|
| - |
|
296 |
LOGGER.info("Items color map {}", itemsColorMap);
|
| 295 |
JSONArray response = new JSONArray();
|
297 |
JSONArray response = new JSONArray();
|
| 296 |
itemsColorMap.keySet().stream().forEach(x -> {
|
298 |
itemsColorMap.keySet().stream().forEach(x -> {
|
| 297 |
response.put(
|
299 |
response.put(
|
| 298 |
new JSONObject()
|
300 |
new JSONObject()
|
| 299 |
.put("color", itemsColorMap.get(x))
|
301 |
.put("color", itemsColorMap.get(x))
|