Authored by qinchao

Merge branch 'test6.8.2' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.2

... ... @@ -16,4 +16,9 @@ public class StorageLeastPriceResp {
private Integer skup;
@JSONField(name="suggest_low_price")
private BigDecimal suggestLowPrice;
@JSONField(name="suggest_high_price")
private BigDecimal suggestHighPrice;
}
... ...
... ... @@ -124,11 +124,18 @@ public class ProductServiceImpl implements ProductService{
@Override
public StorageLeastPriceResp queryStorageLeastPrice(Integer storageId) {
StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);
if (storagePrice == null) {
Storage storage = storageMapper.selectByPrimaryKey(storageId);
if (null == storage) {
LOGGER.warn("storageMapper.selectByPrimaryKey is null, storageId is {}", storageId);
return null;
}
StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);
StorageLeastPriceResp resp = new StorageLeastPriceResp();
if (storagePrice == null) {
resp.setSuggestHighPrice(storage.getSuggestHighPrice());
resp.setSuggestLowPrice(storage.getSuggestLowPrice());
return resp;
}
resp.setStorageId(storageId);
resp.setLeastPrice(storagePrice.getPrice());
resp.setSkup(storagePrice.getSkup());
... ...