From 573c491b4a1ba60e12a5678a01c1546c0077c1ee Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 30 七月 2019 09:07:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 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 c90925e..4a5f1a1 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
@@ -21,6 +21,8 @@
 import com.yeshi.fanli.service.inter.activity.ActivityService;
 import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
 import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
+import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
+import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
 import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
 import com.yeshi.fanli.util.BeanUtil;
 import com.yeshi.fanli.util.StringUtil;
@@ -41,6 +43,12 @@
 
 	@Resource
 	private CommonGoodsService commonGoodsService;
+
+	@Resource
+	private ShareHotGoodsService shareHotGoodsService;
+
+	@Resource
+	private TLJBuyGoodsService tljBuyGoodsService;
 
 	@Override
 	public void startUpdate() {
@@ -90,6 +98,10 @@
 
 		// 鏇存柊绠�鐗堝晢鍝佺姸鎬佷负涓嬫灦
 		commonGoodsService.offlineCommonGoods(auctionId, CommonGoods.GOODS_TYPE_TB);
+
+		// 鍒嗕韩鐖嗘鏁版嵁鍒犻櫎
+		shareHotGoodsService.deleteByGoodsId(auctionId);
+
 	}
 
 	@Transactional
@@ -101,6 +113,8 @@
 		if (goods.getAuctionId() == null || goods.getAuctionId() == 0)
 			throw new TaobaoGoodsUpdateException(2, "鍟嗗搧ID涓虹┖");
 
+		// 璁剧疆鍟嗗搧姝e父涓婄嚎
+		goods.setState(0);
 		// 鏇存柊鏀惰棌淇℃伅
 		try {
 			commonGoodsService.updateCommonGoods(CommonGoodsFactory.create(goods));
@@ -118,11 +132,16 @@
 
 		// 鏇存柊鍔ㄦ�佸晢鍝�
 		activityService.updateRecommendActivityGoods(goods);
+
+		// 鏇存柊鍒嗕韩搴撶殑鍟嗗搧
+		shareHotGoodsService.updateShareGoods(goods);
+
+		// 鏇存柊鑷喘绔嬪噺搴撳晢鍝�
+		tljBuyGoodsService.updateGoods(goods);
 	}
 
 	@Override
 	public void deleteOutOfDate() {
-		TaoBaoGoodsBriefMapper taoBaoGoodsBriefMapper = BeanUtil.getBean(TaoBaoGoodsBriefMapper.class);
 		List<Long> list = taoBaoGoodsBriefMapper
 				.queryCanDeleteGoods(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2), 0, 2000);
 		for (Long auctionId : list) {
@@ -197,7 +216,7 @@
 			if (goods.getId() == null || goods.getId() == 0L) {
 				throw new TaobaoGoodsUpdateException(1, "鍟嗗搧涓婚敭ID涓虹┖");
 			}
-			
+
 			// 闇�瑕佹洿鏂扮殑淇℃伅
 			TaoBaoGoodsBrief updateGoods = getUpdateTaoBaoGoodsBrief(goods);
 			updateGoods.setCreatetime(goods.getCreatetime());
@@ -206,8 +225,7 @@
 
 		taoBaoGoodsBriefMapper.updateBatchSelective(updateList);
 	}
-	
-	
+
 	@Override
 	public List<Long> listNeedUpdateGoodsId(long start, int count, int hour) {
 		return taoBaoGoodsBriefMapper.listNeedUpdateGoodsId(start, count, hour);
@@ -220,27 +238,27 @@
 			if (oldGoods == null) {
 				return;
 			}
-			
+
 			TaoBaoGoodsBrief newGoods = TaoKeApiUtil.searchGoodsDetail(id);
 			if (newGoods == null) {
 				return;
 			}
-			
+
 			// 鏇存柊绮鹃�夊晢鍝�
 			newGoods.setId(id);
 			TaoBaoGoodsBrief updateGoods = getUpdateTaoBaoGoodsBrief(newGoods);
 			taoBaoGoodsBriefMapper.updateByPrimaryKeySelective(updateGoods);
-			
+
 			// 鏇存柊鍔ㄦ�佸晢鍝�
 			activityService.updateRecommendActivityGoods(newGoods);
-						
+
 			// 鏇存柊鏀惰棌淇℃伅
 			try {
 				commonGoodsService.updateCommonGoods(CommonGoodsFactory.create(newGoods));
 			} catch (CommonGoodsException e) {
 				e.printStackTrace();
 			}
-					
+
 		} catch (TaobaoGoodsDownException e) {
 			offlineTaoBaoGoods(id);
 		} catch (Exception e) {

--
Gitblit v1.8.0