使用hutool做String非空判断
This commit is contained in:
parent
e9663434a2
commit
6f1aa6e3d5
@ -194,7 +194,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
String quantity = stringRedisTemplate.opsForValue().get(GoodsSkuService.getStockCacheKey(id));
|
String quantity = stringRedisTemplate.opsForValue().get(GoodsSkuService.getStockCacheKey(id));
|
||||||
|
|
||||||
//如果sku缓存的库存与库存缓存不符则按照库存缓存进行
|
//如果sku缓存的库存与库存缓存不符则按照库存缓存进行
|
||||||
if (quantity == null) {
|
if (StrUtil.isNotEmpty(quantity)) {
|
||||||
goodsSku.setQuantity(Convert.toInt(quantity));
|
goodsSku.setQuantity(Convert.toInt(quantity));
|
||||||
cache.put(GoodsSkuService.getCacheKeys(goodsSku.getId()), goodsSku);
|
cache.put(GoodsSkuService.getCacheKeys(goodsSku.getId()), goodsSku);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user