From ddf5db7d31af51fcf697eac0cee7dd46ff73bcc1 Mon Sep 17 00:00:00 2001 From: admin <2780501319@qq.com> Date: 星期二, 18 二月 2020 12:50:49 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java index cf4f8f2..bda64b5 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java @@ -9,6 +9,7 @@ import javax.annotation.Resource; +import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,6 +28,7 @@ import com.yeshi.fanli.service.inter.lable.QualityFactoryGoodsUpdateService; import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService; import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsUpdateService; +import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsUpdateService; import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService; import com.yeshi.fanli.util.CMQManager; import com.yeshi.fanli.util.StringUtil; @@ -49,6 +51,7 @@ @Resource private CommonGoodsService commonGoodsService; + @Lazy @Resource private ShareHotGoodsService shareHotGoodsService; @@ -60,6 +63,9 @@ @Resource private TaoBaoGoodsUpdateDao taoBaoGoodsUpdateDao; + + @Resource + private TLJFreeBuyGoodsUpdateService tljFreeBuyGoodsUpdateService; @Override public void startUpdate() { @@ -114,7 +120,7 @@ shareHotGoodsService.deleteByGoodsId(auctionId); } - @Transactional + @Transactional(rollbackFor = Exception.class) @Override public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) throws TaobaoGoodsUpdateException { if (goods == null) @@ -148,6 +154,9 @@ // 鏇存柊鑷喘绔嬪噺搴撳晢鍝� tljBuyGoodsUpdateService.updateGoods(goods); + + // 鏇存柊鏂颁汉鍏嶅崟搴撳晢鍝� + tljFreeBuyGoodsUpdateService.updateGoods(goods); // 鎬昏鍟嗗搧鏇存柊 updateImplTBGoods(goods); @@ -285,12 +294,14 @@ * @param goods */ public void updateImplTBGoods(TaoBaoGoodsBrief goods) { - if (goods == null) + if (goods == null || goods.getAuctionId() == null) return; if (!taoBaoGoodsCacheUtil.needUpdate(goods.getAuctionId())) { return; } goods.setUpdatetime(new Date()); + if (goods.getId() == null) + goods.setId(goods.getAuctionId()); taoBaoGoodsUpdateDao.save(goods); taoBaoGoodsCacheUtil.addUpdateHistory(goods.getAuctionId()); } -- Gitblit v1.8.0