| | |
| | |
|
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | | private ShareHotGoodsService shareHotGoodsService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateDao taoBaoGoodsUpdateDao;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TLJFreeBuyGoodsUpdateService tljFreeBuyGoodsUpdateService;
|
| | | |
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | |
|
| | | @Override
|
| | | public void startUpdate() {
|
| | |
| | |
|
| | | // 分享爆款数据删除
|
| | | shareHotGoodsService.deleteByGoodsId(auctionId);
|
| | | |
| | | goodsEvaluateService.offlineTaoBaoGoods(auctionId+"");
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) throws TaobaoGoodsUpdateException {
|
| | | if (goods == null)
|
| | |
| | |
|
| | | // 更新自购立减库商品
|
| | | tljBuyGoodsUpdateService.updateGoods(goods);
|
| | | |
| | |
|
| | | // 更新新人免单库商品
|
| | | tljFreeBuyGoodsUpdateService.updateGoods(goods);
|
| | |
|
| | | goodsEvaluateService.updateTaoBaoGoods(goods);
|
| | | |
| | | // 总要商品更新
|
| | | updateImplTBGoods(goods);
|
| | | }
|
| | |
| | | * @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());
|
| | | }
|