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