...
|
...
|
@@ -219,6 +219,13 @@ public class ProductServiceImpl implements ProductService { |
|
|
BigDecimal secondHandLeastPrice = secondHandLeastPriceList.stream().min((p1, p2) -> (p1.compareTo(p2))).get();
|
|
|
productInfo.setSecondHandLeastPrice(secondHandLeastPrice);
|
|
|
}
|
|
|
|
|
|
List<BigDecimal> hkLeastPriceList = goodsSizes.stream().map(GoodsSize::getHkLeastPrice).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
if(!CollectionUtils.isEmpty(hkLeastPriceList)) {
|
|
|
BigDecimal hkLeastPrice = hkLeastPriceList.stream().min((p1, p2) -> (p1.compareTo(p2))).get();
|
|
|
productInfo.setHkLeastPrice(hkLeastPrice);
|
|
|
}
|
|
|
|
|
|
goodsSizes.sort(Comparator.comparing(GoodsSize::getOrderBy));
|
|
|
List<JSONObject> otherAddSizeList = getOtherSizeList(product.getMaxSortId(), product.getMidSortId(), goodsSizes);
|
|
|
if(!CollectionUtils.isEmpty(otherAddSizeList)) {
|
...
|
...
|
@@ -920,7 +927,7 @@ public class ProductServiceImpl implements ProductService { |
|
|
private Map<String, StoragePrice> getStorageLeastPriceInfo(Integer productId) {
|
|
|
List<StoragePrice> storagePrices = storagePriceMapper.selectLeastPricesByProductId(productId);
|
|
|
return storagePrices.stream()
|
|
|
.collect(Collectors.toMap(s -> s.getStorageId() + "_" + s.getPreSaleFlag(), Function.identity()));
|
|
|
.collect(Collectors.toMap(s -> s.getStorageId() + "_" + s.getPreSaleFlag() + "_" + s.getRegion(), Function.identity()));
|
|
|
}
|
|
|
|
|
|
private List<GoodsBO> getGoodsList(Integer productId, BigDecimal sellMinPrice, BigDecimal maxPrice) {
|
...
|
...
|
@@ -946,11 +953,17 @@ public class ProductServiceImpl implements ProductService { |
|
|
Map<String, StoragePrice> storagePriceMap = getStorageLeastPriceInfo(productId);
|
|
|
|
|
|
for (Storage storage : storageList) {
|
|
|
StoragePrice storagePrice = storagePriceMap.get(storage.getId() + "_0");
|
|
|
StoragePrice storagePricePre = storagePriceMap.get(storage.getId() + "_1");
|
|
|
StoragePrice storagePriceDl = storagePriceMap.get(storage.getId() + "_0_0");//大陆现货
|
|
|
StoragePrice storagePriceHk = storagePriceMap.get(storage.getId() + "_0_1");//香港现货
|
|
|
StoragePrice storagePrice = storagePriceDl == null ? storagePriceHk : storagePriceDl;
|
|
|
if(storagePriceDl != null && storagePriceHk != null && storagePriceHk.getPrice().compareTo(storagePriceDl.getPrice()) < 0) {
|
|
|
storagePrice = storagePriceHk;
|
|
|
}
|
|
|
|
|
|
StoragePrice storagePricePre = storagePriceMap.get(storage.getId() + "_1_0");//大陆预售
|
|
|
|
|
|
StoragePrice storagePriceSecondNew = storagePriceMap.get(storage.getId() + "_5");
|
|
|
StoragePrice storagePriceSecondOld = storagePriceMap.get(storage.getId() + "_6");
|
|
|
StoragePrice storagePriceSecondNew = storagePriceMap.get(storage.getId() + "_5_0");//大陆全新瑕疵
|
|
|
StoragePrice storagePriceSecondOld = storagePriceMap.get(storage.getId() + "_6_0");//大陆二手
|
|
|
StoragePrice storagePriceSecond = storagePriceSecondNew == null ? storagePriceSecondOld : storagePriceSecondNew;
|
|
|
if (storagePriceSecondOld != null && storagePriceSecondNew != null && storagePriceSecondOld.getPrice().compareTo(storagePriceSecondNew.getPrice()) < 0) {
|
|
|
storagePriceSecond = storagePriceSecondOld;
|
...
|
...
|
@@ -990,6 +1003,11 @@ public class ProductServiceImpl implements ProductService { |
|
|
goodsSize.setSecondHandStatus(storagePriceSecond == null ? null : storagePriceSecond.getStatus());
|
|
|
goodsSize.setSecondHandSkup(storagePriceSecond == null ? 0 : storagePriceSecond.getSkup());
|
|
|
goodsSize.setSecondHandStorageNum(goodsSize.getSecondHandSkup() == null || goodsSize.getSecondHandSkup() == 0 ? 0 : 1);
|
|
|
|
|
|
goodsSize.setHkLeastPrice(storagePriceHk == null ? null : storagePriceHk.getPrice());
|
|
|
goodsSize.setHkStatus(storagePriceHk == null ? null : storagePriceHk.getStatus());
|
|
|
goodsSize.setHkSkup(storagePriceHk == null ? null : storagePriceHk.getSkup());
|
|
|
goodsSize.setHkStorageNum(goodsSize.getHkSkup() == null || goodsSize.getHkSkup() == 0 ? 0: 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|