...
|
...
|
@@ -110,6 +110,11 @@ public class ProductServiceImpl implements ProductService { |
|
|
BigDecimal leastPrice = leastPriceList.stream().min((p1, p2) -> (p1.compareTo(p2))).get();
|
|
|
productInfo.setLeastPrice(leastPrice);
|
|
|
}
|
|
|
List<BigDecimal> preSaleLeastPriceList = goodsSizes.stream().map(GoodsSize::getPreSaleLeastPrice).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(preSaleLeastPriceList)) {
|
|
|
BigDecimal preSaleLeastPrice = preSaleLeastPriceList.stream().min((p1, p2) -> (p1.compareTo(p2))).get();
|
|
|
productInfo.setPreSaleLeastPrice(preSaleLeastPrice);
|
|
|
}
|
|
|
goodsSizes.sort(Comparator.comparing(GoodsSize::getOrderBy));
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -130,6 +135,14 @@ public class ProductServiceImpl implements ProductService { |
|
|
resp.setStorageId(storageId);
|
|
|
resp.setLeastPrice(storagePrice.getPrice());
|
|
|
resp.setSkup(storagePrice.getSkup());
|
|
|
|
|
|
StoragePrice preSaleStoragePrice = storagePriceMapper.selectPreSaleLeastPrice(storageId);
|
|
|
if (null != preSaleStoragePrice) {
|
|
|
resp.setPreSaleLeastPrice(preSaleStoragePrice.getPrice());
|
|
|
resp.setPreSaleSkup(preSaleStoragePrice.getSkup());
|
|
|
}
|
|
|
|
|
|
|
|
|
return resp;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -151,6 +164,12 @@ public class ProductServiceImpl implements ProductService { |
|
|
resp.setLeastPrice(storagePrice.getPrice());
|
|
|
resp.setSkup(storagePrice.getSkup());
|
|
|
}
|
|
|
|
|
|
StoragePrice preSaleStoragePrice = storagePriceMapper.selectPreSaleLeastPrice(storageId);
|
|
|
if (null != preSaleStoragePrice) {
|
|
|
resp.setPreSaleLeastPrice(preSaleStoragePrice.getPrice());
|
|
|
resp.setPreSaleSkup(preSaleStoragePrice.getSkup());
|
|
|
}
|
|
|
|
|
|
return resp;
|
|
|
}
|
...
|
...
|
@@ -187,6 +206,13 @@ public class ProductServiceImpl implements ProductService { |
|
|
resp.setSuggestLowPrice(storage.getSuggestLowPrice());
|
|
|
resp.setSuggestHighPrice(storage.getSuggestHighPrice());
|
|
|
resp.setLeastPrice(null == storagePrice ? null : storagePrice.getPrice());
|
|
|
|
|
|
StoragePrice preSaleStoragePrice = storagePriceMapper.selectPreSaleLeastPrice(storageId);
|
|
|
if (null != preSaleStoragePrice) {
|
|
|
resp.setPreSaleLeastPrice(preSaleStoragePrice.getPrice());
|
|
|
}
|
|
|
|
|
|
|
|
|
return resp;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -202,8 +228,12 @@ public class ProductServiceImpl implements ProductService { |
|
|
}
|
|
|
|
|
|
List<StoragePrice> storagePrices = storagePriceMapper.selectBatchLeastPrice(skuList);
|
|
|
|
|
|
List<StoragePrice> preSaleStoragePrices = storagePriceMapper.selectPreSaleBatchLeastPrice(skuList);
|
|
|
|
|
|
|
|
|
Map<Integer, BigDecimal> priceMap = storagePrices.stream().collect(Collectors.toMap(StoragePrice::getStorageId, StoragePrice::getPrice));
|
|
|
Map<Integer, BigDecimal> preSalePriceMap = preSaleStoragePrices.stream().collect(Collectors.toMap(StoragePrice::getStorageId, StoragePrice::getPrice));
|
|
|
List<StorageInfoResp> resp = Lists.newArrayList();
|
|
|
storageList.stream().forEach(item -> {
|
|
|
StorageInfoResp storageInfoResp = new StorageInfoResp();
|
...
|
...
|
@@ -212,6 +242,7 @@ public class ProductServiceImpl implements ProductService { |
|
|
storageInfoResp.setSuggestLowPrice(item.getSuggestLowPrice());
|
|
|
storageInfoResp.setStorageId(item.getId());
|
|
|
storageInfoResp.setLeastPrice(priceMap.get(item.getId()));
|
|
|
storageInfoResp.setPreSaleLeastPrice(preSalePriceMap.get(item.getId()));
|
|
|
resp.add(storageInfoResp);
|
|
|
});
|
|
|
|
...
|
...
|
|