yujian
2020-06-09 554de444b87aab5f93cb1593a8095612cf9479a7
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;
@@ -23,6 +24,7 @@
import com.yeshi.fanli.exception.taobao.TaobaoGoodsUpdateException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.activity.ActivityGoodsUpdateService;
import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
@@ -50,6 +52,7 @@
   @Resource
   private CommonGoodsService commonGoodsService;
   @Lazy
   @Resource
   private ShareHotGoodsService shareHotGoodsService;
@@ -61,9 +64,12 @@
   @Resource
   private TaoBaoGoodsUpdateDao taoBaoGoodsUpdateDao;
   @Resource
   private TLJFreeBuyGoodsUpdateService tljFreeBuyGoodsUpdateService;
   @Resource
   private GoodsEvaluateService goodsEvaluateService;
   @Override
   public void startUpdate() {
@@ -116,9 +122,11 @@
      // 分享爆款数据删除
      shareHotGoodsService.deleteByGoodsId(auctionId);
      goodsEvaluateService.offlineTaoBaoGoods(auctionId+"");
   }
   @Transactional
   @Transactional(rollbackFor = Exception.class)
   @Override
   public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) throws TaobaoGoodsUpdateException {
      if (goods == null)
@@ -152,10 +160,12 @@
      // 更新自购立减库商品
      tljBuyGoodsUpdateService.updateGoods(goods);
      // 更新新人免单库商品
      tljFreeBuyGoodsUpdateService.updateGoods(goods);
      goodsEvaluateService.updateTaoBaoGoods(goods);
      // 总要商品更新
      updateImplTBGoods(goods);
   }
@@ -292,12 +302,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());
   }