| Line 468... |
Line 468... |
| 468 |
if (!isAdmin && fofoId == 0) {
|
468 |
if (!isAdmin && fofoId == 0) {
|
| 469 |
fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
|
469 |
fofoId = cookiesProcessor.getCookiesObject(request).getFofoId();
|
| 470 |
Map<String, Object> equalsStockJoinMap = new HashMap<>();
|
470 |
Map<String, Object> equalsStockJoinMap = new HashMap<>();
|
| 471 |
equalsStockJoinMap.put("fofoId", fofoId);
|
471 |
equalsStockJoinMap.put("fofoId", fofoId);
|
| 472 |
currentStockMap = itemRepository
|
472 |
currentStockMap = itemRepository
|
| 473 |
.selectItems(CurrentInventorySnapshot.class, "itemId", equalsMap, notEqualsMap, equalsStockJoinMap,
|
473 |
.selectItems(CurrentInventorySnapshot.class, "id", "itemId", equalsMap, notEqualsMap,
|
| 474 |
notEqualsJoinMap, "availability")
|
474 |
equalsStockJoinMap, notEqualsJoinMap, "availability")
|
| 475 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
475 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
| 476 |
LOGGER.info("currentStock");
|
476 |
LOGGER.info("currentStock");
|
| 477 |
} else {
|
477 |
} else {
|
| 478 |
if (fofoId == 0) {
|
478 |
if (fofoId == 0) {
|
| 479 |
|
479 |
|
| 480 |
Map<String, Object> equalsStockJoinMap = new HashMap<>();
|
480 |
Map<String, Object> equalsStockJoinMap = new HashMap<>();
|
| 481 |
equalsStockJoinMap.put("fofoId", fofoId);
|
481 |
equalsStockJoinMap.put("fofoId", fofoId);
|
| 482 |
|
482 |
|
| 483 |
currentStockMap = itemRepository
|
483 |
currentStockMap = itemRepository
|
| 484 |
.selectItems(CurrentInventorySnapshot.class, "itemId", equalsMap, notEqualsMap,
|
484 |
.selectItems(CurrentInventorySnapshot.class, "id", "itemId", equalsMap, notEqualsMap,
|
| 485 |
equalsStockJoinMap, notEqualsJoinMap, "availability")
|
485 |
equalsStockJoinMap, notEqualsJoinMap, "availability")
|
| 486 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
486 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
| 487 |
|
487 |
|
| 488 |
} else {
|
488 |
} else {
|
| 489 |
|
489 |
|
| 490 |
Map<String, Object> equalsStockJoinMap = new HashMap<>();
|
490 |
Map<String, Object> equalsStockJoinMap = new HashMap<>();
|
| 491 |
equalsStockJoinMap.put("fofoId", fofoId);
|
491 |
equalsStockJoinMap.put("fofoId", fofoId);
|
| 492 |
|
492 |
|
| 493 |
currentStockMap = itemRepository
|
493 |
currentStockMap = itemRepository
|
| 494 |
.selectItems(CurrentInventorySnapshot.class, "itemId", equalsMap, notEqualsMap,
|
494 |
.selectItems(CurrentInventorySnapshot.class, "id", "itemId", equalsMap, notEqualsMap,
|
| 495 |
equalsStockJoinMap, notEqualsJoinMap, "availability")
|
495 |
equalsStockJoinMap, notEqualsJoinMap, "availability")
|
| 496 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
496 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
| 497 |
|
497 |
|
| 498 |
}
|
498 |
}
|
| 499 |
}
|
499 |
}
|
| Line 535... |
Line 535... |
| 535 |
LOGGER.info("fofoOrderIds" + fofoOrderIds);
|
535 |
LOGGER.info("fofoOrderIds" + fofoOrderIds);
|
| 536 |
Map<String, Object> equalsJoinMap = new HashMap<>();
|
536 |
Map<String, Object> equalsJoinMap = new HashMap<>();
|
| 537 |
equalsJoinMap.put("orderId", fofoOrderIds);
|
537 |
equalsJoinMap.put("orderId", fofoOrderIds);
|
| 538 |
|
538 |
|
| 539 |
Map<Integer, Integer> last15daysMap = itemRepository
|
539 |
Map<Integer, Integer> last15daysMap = itemRepository
|
| 540 |
.selectItems(FofoOrderItem.class, "itemId", equalsMap, notEqualsMap, equalsJoinMap, notEqualsJoinMap,
|
540 |
.selectItems(FofoOrderItem.class, "id", "itemId", equalsMap, notEqualsMap, equalsJoinMap,
|
| 541 |
"quantity")
|
541 |
notEqualsJoinMap, "quantity")
|
| 542 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
542 |
.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
|
| 543 |
LOGGER.info("last15daysMap");
|
543 |
LOGGER.info("last15daysMap");
|
| 544 |
LOGGER.info("last15daysMap" + last15daysMap);
|
544 |
LOGGER.info("last15daysMap" + last15daysMap);
|
| 545 |
|
545 |
|
| 546 |
Map<Integer, TagListing> taglistingMap = tagListings.stream()
|
546 |
Map<Integer, TagListing> taglistingMap = tagListings.stream()
|
| Line 550... |
Line 550... |
| 550 |
Collectors.groupingBy(x -> x.getCatalogItemId(), Collectors.mapping(y -> y, Collectors.toList())));
|
550 |
Collectors.groupingBy(x -> x.getCatalogItemId(), Collectors.mapping(y -> y, Collectors.toList())));
|
| 551 |
LOGGER.info("catalogIdItemMap");
|
551 |
LOGGER.info("catalogIdItemMap");
|
| 552 |
|
552 |
|
| 553 |
Map<String, Object> equalsItemJoinMap = new HashMap<>();
|
553 |
Map<String, Object> equalsItemJoinMap = new HashMap<>();
|
| 554 |
equalsItemJoinMap.put("active", 1);
|
554 |
equalsItemJoinMap.put("active", 1);
|
| 555 |
List<CatalogIdAggregateValue> tagListingCatalogIds = itemRepository.selectItems(TagListing.class, "itemId",
|
555 |
List<CatalogIdAggregateValue> tagListingCatalogIds = itemRepository.selectItems(TagListing.class, "id",
|
| 556 |
equalsMap, notEqualsMap, equalsItemJoinMap, notEqualsJoinMap, "tagId");
|
556 |
"itemId", equalsMap, notEqualsMap, equalsItemJoinMap, notEqualsJoinMap, "tagId");
|
| 557 |
LOGGER.info("tagListingCatalogIds");
|
557 |
LOGGER.info("tagListingCatalogIds");
|
| 558 |
for (CatalogIdAggregateValue catalogIdAggregateValue : tagListingCatalogIds) {
|
558 |
for (CatalogIdAggregateValue catalogIdAggregateValue : tagListingCatalogIds) {
|
| 559 |
int catalogId = catalogIdAggregateValue.getCatalogId();
|
559 |
int catalogId = catalogIdAggregateValue.getCatalogId();
|
| 560 |
Item item = catalogIdItemMap.get(catalogId).get(0);
|
560 |
Item item = catalogIdItemMap.get(catalogId).get(0);
|
| 561 |
TagListing tagListing = taglistingMap.get(item.getId());
|
561 |
TagListing tagListing = taglistingMap.get(item.getId());
|