From a9b86cb38188d689875c8973256f10ce6566405e Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 14 五月 2019 18:31:39 +0800
Subject: [PATCH] 大淘客商品推荐

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 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 ac246eb..dc5003c 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
@@ -33,7 +33,7 @@
 
 	@Override
 	public void startSyncGoods() {
-		
+
 		// 鍒ゆ柇鏄惁鏈夋鍦ㄨ繘琛岀殑鏇存柊
 		String key1 = "dataoke-updating";
 		// if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key1)))
@@ -44,14 +44,17 @@
 		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)// 鏇存柊瀹屾垚
+				{
+					redisManager.removeCommonString(key1);
+					break;
+				}
+				addGoodsList(result.getDetailList());
+				totalCount += result.getDetailList().size();
+			} catch (Exception e) {
 			}
-			addGoodsList(result.getDetailList());
-			totalCount += result.getDetailList().size();
 		}
 
 		LogHelper.test("澶ф窐瀹㈡�诲叡鏇存柊鏁版嵁鏁伴噺:" + totalCount);
@@ -121,8 +124,7 @@
 	public List<DaTaoKeDetail> listByIds(List<Long> idList) {
 		return daTaoKeDetailMapper.listByIds(idList);
 	}
-
-	
+
 	@Override
 	public List<DaTaoKeDetail> listByDtitle(String dtitle) {
 
@@ -140,10 +142,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