...
|
...
|
@@ -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());
|
...
|
...
|
|