| Line 618... |
Line 618... |
| 618 |
InventoryItem inventoryItem = inventoryItemRepository.selectBySerialNumber(searchImei);
|
618 |
InventoryItem inventoryItem = inventoryItemRepository.selectBySerialNumber(searchImei);
|
| 619 |
int fofoId = inventoryItem.getFofoId();
|
619 |
int fofoId = inventoryItem.getFofoId();
|
| 620 |
List<ItemPurchaseSummaryModel> itemPurchaseSummaryModels = inventoryItemRepository.selectPurchaseSummary(new ArrayList<>(Arrays.asList(inventoryItem.getId())));
|
620 |
List<ItemPurchaseSummaryModel> itemPurchaseSummaryModels = inventoryItemRepository.selectPurchaseSummary(new ArrayList<>(Arrays.asList(inventoryItem.getId())));
|
| 621 |
|
621 |
|
| 622 |
List<FofoOrder> fofoOrders=fofoOrderRepository.selectByFofoIdAndSerialNumber(fofoId, searchImei ,null, null, 0, 0);
|
622 |
List<FofoOrder> fofoOrders=fofoOrderRepository.selectByFofoIdAndSerialNumber(fofoId, searchImei ,null, null, 0, 0);
|
| 623 |
LOGGER.info("fofoOrder {}", fofoOrders);
|
623 |
LOGGER.info("fofoOrder count: {}", fofoOrders.size());
|
| 624 |
List<FofoOrder> filterOrders = fofoOrders.stream().filter(x -> x.getCancelledTimestamp() == null).collect(Collectors.toList());
|
624 |
List<FofoOrder> filterOrders = fofoOrders.stream().filter(x -> x.getCancelledTimestamp() == null).collect(Collectors.toList());
|
| 625 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
625 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 626 |
Item item = itemRepository.selectById(inventoryItem.getItemId());
|
626 |
Item item = itemRepository.selectById(inventoryItem.getItemId());
|
| 627 |
Map<Integer, Scheme> schemeMap = new HashMap<>();
|
627 |
Map<Integer, Scheme> schemeMap = new HashMap<>();
|
| 628 |
double netEarnings = 0;
|
628 |
double netEarnings = 0;
|
| Line 656... |
Line 656... |
| 656 |
|
656 |
|
| 657 |
schemeMap = schemes.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
657 |
schemeMap = schemes.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 658 |
}
|
658 |
}
|
| 659 |
List<PriceDropIMEI> priceDropImeis = priceDropIMEIRepository.selectByFofoIdImei(fofoId, searchImei);
|
659 |
List<PriceDropIMEI> priceDropImeis = priceDropIMEIRepository.selectByFofoIdImei(fofoId, searchImei);
|
| 660 |
if (priceDropImeis.size() > 0) {
|
660 |
if (priceDropImeis.size() > 0) {
|
| 661 |
|
- |
|
| - |
|
661 |
List<Integer> priceDropIds = priceDropImeis.stream().map(PriceDropIMEI::getPriceDropId).distinct().collect(Collectors.toList());
|
| - |
|
662 |
List<PriceDrop> priceDrops = priceDropRepository.selectByIds(priceDropIds);
|
| - |
|
663 |
Map<Integer, PriceDrop> priceDropMap = priceDrops.stream().collect(Collectors.toMap(PriceDrop::getId, x -> x));
|
| 662 |
for (PriceDropIMEI priceDropIMEI : priceDropImeis) {
|
664 |
for (PriceDropIMEI priceDropIMEI : priceDropImeis) {
|
| 663 |
int priceDropId = priceDropIMEI.getPriceDropId();
|
665 |
priceDropIMEI.setPriceDrop(priceDropMap.get(priceDropIMEI.getPriceDropId()));
|
| 664 |
PriceDrop pd = priceDropRepository.selectById(priceDropId);
|
- |
|
| 665 |
priceDropIMEI.setPriceDrop(pd);
|
- |
|
| 666 |
}
|
666 |
}
|
| 667 |
model.addAttribute("priceDropImeis", priceDropImeis);
|
667 |
model.addAttribute("priceDropImeis", priceDropImeis);
|
| 668 |
}
|
668 |
}
|
| 669 |
netEarnings += offerPayouts.stream().collect(Collectors.summingDouble(x -> x.getAmount()));
|
669 |
netEarnings += offerPayouts.stream().collect(Collectors.summingDouble(x -> x.getAmount()));
|
| 670 |
model.addAttribute("offerPayouts", offerPayouts);
|
670 |
model.addAttribute("offerPayouts", offerPayouts);
|
| Line 761... |
Line 761... |
| 761 |
schemeMap = schemes.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
761 |
schemeMap = schemes.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 762 |
}
|
762 |
}
|
| 763 |
|
763 |
|
| 764 |
List<PriceDropIMEI> priceDropImeis = priceDropIMEIRepository.selectByFofoIdImei(itemFofoId, searchImei);
|
764 |
List<PriceDropIMEI> priceDropImeis = priceDropIMEIRepository.selectByFofoIdImei(itemFofoId, searchImei);
|
| 765 |
if (priceDropImeis.size() > 0) {
|
765 |
if (priceDropImeis.size() > 0) {
|
| - |
|
766 |
List<Integer> priceDropIds = priceDropImeis.stream().map(PriceDropIMEI::getPriceDropId).distinct().collect(Collectors.toList());
|
| - |
|
767 |
List<PriceDrop> priceDrops = priceDropRepository.selectByIds(priceDropIds);
|
| - |
|
768 |
Map<Integer, PriceDrop> priceDropMap = priceDrops.stream().collect(Collectors.toMap(PriceDrop::getId, x -> x));
|
| 766 |
for (PriceDropIMEI priceDropIMEI : priceDropImeis) {
|
769 |
for (PriceDropIMEI priceDropIMEI : priceDropImeis) {
|
| 767 |
int priceDropId = priceDropIMEI.getPriceDropId();
|
770 |
priceDropIMEI.setPriceDrop(priceDropMap.get(priceDropIMEI.getPriceDropId()));
|
| 768 |
PriceDrop pd = priceDropRepository.selectById(priceDropId);
|
- |
|
| 769 |
priceDropIMEI.setPriceDrop(pd);
|
- |
|
| 770 |
}
|
771 |
}
|
| 771 |
model.addAttribute("priceDropImeis", priceDropImeis);
|
772 |
model.addAttribute("priceDropImeis", priceDropImeis);
|
| 772 |
}
|
773 |
}
|
| 773 |
|
774 |
|
| 774 |
netEarnings += offerPayouts.stream().collect(Collectors.summingDouble(x -> x.getAmount()));
|
775 |
netEarnings += offerPayouts.stream().collect(Collectors.summingDouble(x -> x.getAmount()));
|
| Line 947... |
Line 948... |
| 947 |
netEarnings += offerPayouts.stream().collect(Collectors.summingDouble(x -> x.getAmount()));
|
948 |
netEarnings += offerPayouts.stream().collect(Collectors.summingDouble(x -> x.getAmount()));
|
| 948 |
|
949 |
|
| 949 |
List<PriceDropIMEI> priceDropImeis = priceDropIMEIRepository
|
950 |
List<PriceDropIMEI> priceDropImeis = priceDropIMEIRepository
|
| 950 |
.selectByFofoIdImei(loginDetails.getFofoId(), searchImei);
|
951 |
.selectByFofoIdImei(loginDetails.getFofoId(), searchImei);
|
| 951 |
if (priceDropImeis.size() > 0) {
|
952 |
if (priceDropImeis.size() > 0) {
|
| 952 |
|
- |
|
| - |
|
953 |
List<Integer> priceDropIds = priceDropImeis.stream().map(PriceDropIMEI::getPriceDropId).distinct().collect(Collectors.toList());
|
| - |
|
954 |
List<PriceDrop> priceDrops = priceDropRepository.selectByIds(priceDropIds);
|
| - |
|
955 |
Map<Integer, PriceDrop> priceDropMap = priceDrops.stream().collect(Collectors.toMap(PriceDrop::getId, x -> x));
|
| 953 |
for (PriceDropIMEI priceDropIMEI : priceDropImeis) {
|
956 |
for (PriceDropIMEI priceDropIMEI : priceDropImeis) {
|
| 954 |
int priceDropId = priceDropIMEI.getPriceDropId();
|
957 |
priceDropIMEI.setPriceDrop(priceDropMap.get(priceDropIMEI.getPriceDropId()));
|
| 955 |
PriceDrop pd = priceDropRepository.selectById(priceDropId);
|
- |
|
| 956 |
priceDropIMEI.setPriceDrop(pd);
|
- |
|
| 957 |
}
|
958 |
}
|
| 958 |
model.addAttribute("priceDropImeis", priceDropImeis);
|
959 |
model.addAttribute("priceDropImeis", priceDropImeis);
|
| 959 |
}
|
960 |
}
|
| 960 |
|
961 |
|
| 961 |
model.addAttribute("offerPayouts", offerPayouts);
|
962 |
model.addAttribute("offerPayouts", offerPayouts);
|