店铺商品数量变更问题处理。

This commit is contained in:
Chopper 2021-09-01 10:42:47 +08:00
parent b78f1e512e
commit 3c9c3c2c17

View File

@ -178,8 +178,14 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
*/
private void updateGoodsNum(MessageExt messageExt) {
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
Goods goods = null;
try {
goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
} catch (Exception e) {
log.error("商品传输信息错误-{}", messageExt.toString());
}
//更新店铺商品数量
assert goods != null;
storeService.updateStoreGoodsNum(goods.getStoreId());
}