使用hutool做String非空判断

This commit is contained in:
lifenlong 2021-07-21 12:00:03 +08:00
parent e9663434a2
commit 6f1aa6e3d5

View File

@ -194,7 +194,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
String quantity = stringRedisTemplate.opsForValue().get(GoodsSkuService.getStockCacheKey(id));
//如果sku缓存的库存与库存缓存不符则按照库存缓存进行
if (quantity == null) {
if (StrUtil.isNotEmpty(quantity)) {
goodsSku.setQuantity(Convert.toInt(quantity));
cache.put(GoodsSkuService.getCacheKeys(goodsSku.getId()), goodsSku);
}