From ebce479a2d0634c90e5f80045e204248336b410d Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期四, 30 五月 2019 09:42:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java |   38 +++++++++++++++++---------------------
 1 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java
index adf8e9d..e04ec08 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java
@@ -31,27 +31,22 @@
 
 	@Override
 	public void startSyncGoods() {
-		
+		LogHelper.test("澶ф窐瀹㈠悓姝ュ紑濮�");
 		// 鍒ゆ柇鏄惁鏈夋鍦ㄨ繘琛岀殑鏇存柊
-		String key1 = "dataoke-updating";
-		// if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key1)))
-		// return;
-
-		// 寮�濮嬫洿鏂�
-		redisManager.cacheCommonString(key1, "1", 60 * 20);
 		long firstTime = System.currentTimeMillis() - 1000 * 60 * 5L;
 		int totalCount = 0;
 		for (int p = 1; p <= 2000; p++) {// 10W鏁版嵁
-			DaTaoKeApiResult result = DaTaoKeApiUtil.goodsList(p);
-			if (result.getDetailList().size() < 50)// 鏇存柊瀹屾垚
-			{
-				redisManager.removeCommonString(key1);
-				break;
+			try {
+				DaTaoKeApiResult result = DaTaoKeApiUtil.goodsList(p);
+				if (result.getDetailList().size() < 50)// 鏇存柊瀹屾垚
+				{
+					break;
+				}
+				addGoodsList(result.getDetailList());
+				totalCount += result.getDetailList().size();
+			} catch (Exception e) {
 			}
-			addGoodsList(result.getDetailList());
-			totalCount += result.getDetailList().size();
 		}
-
 		LogHelper.test("澶ф窐瀹㈡�诲叡鏇存柊鏁版嵁鏁伴噺:" + totalCount);
 		// 娓呴櫎杩囨湡鏁版嵁
 		if (totalCount > 50000)// 淇濊瘉鏈�5w鏁版嵁鍐嶆竻闄よ繃鏈�
@@ -108,8 +103,10 @@
 		List<DaTaoKeDetail> daTaoKeList = daTaoKeDetailMapper.listByGoodsIds(goodsIdList);
 		if (daTaoKeList == null || daTaoKeList.size() == 0)
 			return goods;
+
 		// 閲嶆柊璁剧疆鏍囬涓庡埜浠锋牸
 		goods = DaTaoKeUtil.filterTaoBaoGoods(goods, daTaoKeList.get(0));
+
 		return goods;
 	}
 
@@ -117,9 +114,10 @@
 	public List<DaTaoKeDetail> listByIds(List<Long> idList) {
 		return daTaoKeDetailMapper.listByIds(idList);
 	}
-
+
 	@Override
 	public List<DaTaoKeDetail> listByDtitle(String dtitle) {
+
 		return daTaoKeDetailMapper.listByDtitle(dtitle.trim());
 	}
 
@@ -134,11 +132,9 @@
 		return daTaoKeDetailMapper.countSearchByTitleWithCid(title, (cid == null || cid == 0 ? null : cid));
 	}
 
-
-	
 	@Override
-	public List<DaTaoKeDetail> getGoodsNotInList(Long cid, List<Long> listId,int count) {
-		return daTaoKeDetailMapper.getGoodsNotInList(cid, listId,count);
+	public List<DaTaoKeDetail> getGoodsNotInList(Long cid, List<Long> listId, int count) {
+		return daTaoKeDetailMapper.getGoodsNotInList(cid, listId, count);
 	}
-
+
 }

--
Gitblit v1.8.0