!236 fix: 优化库存扣减后清除商品缓存信息

Merge pull request !236 from OceansDeep/feature/pg
This commit is contained in:
OceansDeep 2022-09-20 02:17:47 +00:00 committed by Gitee
commit cd1f465a81
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -431,6 +431,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
lambdaUpdateWrapper.set(Goods::getQuantity, quantity); lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
lambdaUpdateWrapper.eq(Goods::getId, goodsId); lambdaUpdateWrapper.eq(Goods::getId, goodsId);
cache.remove(CachePrefix.GOODS.getPrefix() + goodsId);
this.update(lambdaUpdateWrapper); this.update(lambdaUpdateWrapper);
} }