From ee5c8055b1c0dd7c67a9025a76b10bd287c93d9a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 15 四月 2020 09:52:27 +0800
Subject: [PATCH] 资金明细增加团队分红

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 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 1bc9cab..21e4d6d 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;
@@ -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() {
@@ -118,7 +124,7 @@
 		shareHotGoodsService.deleteByGoodsId(auctionId);
 	}
 
-	@Transactional(rollbackFor=Exception.class)
+	@Transactional(rollbackFor = Exception.class)
 	@Override
 	public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) throws TaobaoGoodsUpdateException {
 		if (goods == null)
@@ -152,10 +158,12 @@
 
 		// 鏇存柊鑷喘绔嬪噺搴撳晢鍝�
 		tljBuyGoodsUpdateService.updateGoods(goods);
-		
+
 		// 鏇存柊鏂颁汉鍏嶅崟搴撳晢鍝�
 		tljFreeBuyGoodsUpdateService.updateGoods(goods);
 
+		goodsEvaluateService.updateTaoBaoGoods(goods);
+		
 		// 鎬昏鍟嗗搧鏇存柊
 		updateImplTBGoods(goods);
 	}
@@ -292,12 +300,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