修改商品未审核通过,修改并提交审核的逻辑

This commit is contained in:
xuwenbo
2020-09-09 20:20:26 +08:00
parent 539c3cb077
commit ad19370111

View File

@ -102,6 +102,7 @@ public class YxWechatLiveGoodsServiceImpl extends BaseServiceImpl<YxWechatLiveGo
YxWechatLiveGoods wechatLiveGoods = this.getById(resources.getGoodsId());
try {
WxMaService wxMaService = WxMaConfiguration.getWxMaService();
WxMaLiveInfo.Goods goods = generator.convert(resources, WxMaLiveInfo.Goods.class);
if(ObjectUtil.isNotEmpty(wechatLiveGoods)){
/** 审核状态 0未审核1审核中2:审核通过3审核失败 */
if(LiveGoodsEnum.IS_Audit_2.getValue().equals(wechatLiveGoods.getAuditStatus())){
@ -109,9 +110,14 @@ public class YxWechatLiveGoodsServiceImpl extends BaseServiceImpl<YxWechatLiveGo
resources.setCoverImgUrl(uploadPhotoToWx(wxMaService,resources.getCoverImgeUrl()).getMediaId());
}else if(LiveGoodsEnum.IS_Audit_1.getValue().equals(wechatLiveGoods.getAuditStatus())){
throw new BadRequestException("商品审核中不允许修改");
}else if(LiveGoodsEnum.IS_Audit_3.getValue().equals(wechatLiveGoods.getAuditStatus())){
resources.setCoverImgUrl(uploadPhotoToWx(wxMaService,resources.getCoverImgeUrl()).getMediaId());
wxMaService.getLiveGoodsService().updateGoods(goods);
wxMaService.getLiveGoodsService().auditGoods(goods.getGoodsId());
return;
}
}
WxMaLiveInfo.Goods goods = generator.convert(resources, WxMaLiveInfo.Goods.class);
boolean wxMaLiveResult = wxMaService.getLiveGoodsService().updateGoods(goods);
this.saveOrUpdate(resources);
} catch (WxErrorException e) {