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 { @@ -16,4 +16,9 @@ public class StorageLeastPriceResp {
16 16
17 private Integer skup; 17 private Integer skup;
18 18
  19 + @JSONField(name="suggest_low_price")
  20 + private BigDecimal suggestLowPrice;
  21 +
  22 + @JSONField(name="suggest_high_price")
  23 + private BigDecimal suggestHighPrice;
19 } 24 }
@@ -124,11 +124,18 @@ public class ProductServiceImpl implements ProductService{ @@ -124,11 +124,18 @@ public class ProductServiceImpl implements ProductService{
124 124
125 @Override 125 @Override
126 public StorageLeastPriceResp queryStorageLeastPrice(Integer storageId) { 126 public StorageLeastPriceResp queryStorageLeastPrice(Integer storageId) {
127 - StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);  
128 - if (storagePrice == null) { 127 + Storage storage = storageMapper.selectByPrimaryKey(storageId);
  128 + if (null == storage) {
  129 + LOGGER.warn("storageMapper.selectByPrimaryKey is null, storageId is {}", storageId);
129 return null; 130 return null;
130 } 131 }
  132 + StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);
131 StorageLeastPriceResp resp = new StorageLeastPriceResp(); 133 StorageLeastPriceResp resp = new StorageLeastPriceResp();
  134 + if (storagePrice == null) {
  135 + resp.setSuggestHighPrice(storage.getSuggestHighPrice());
  136 + resp.setSuggestLowPrice(storage.getSuggestLowPrice());
  137 + return resp;
  138 + }
132 resp.setStorageId(storageId); 139 resp.setStorageId(storageId);
133 resp.setLeastPrice(storagePrice.getPrice()); 140 resp.setLeastPrice(storagePrice.getPrice());
134 resp.setSkup(storagePrice.getSkup()); 141 resp.setSkup(storagePrice.getSkup());