From d8359ddb48dab5cc797a9d552e11fde571f4920c Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 27 八月 2019 12:32:46 +0800
Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java
index a6dd340..dea9c34 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java
@@ -22,6 +22,7 @@
 import com.yeshi.fanli.service.inter.goods.recommend.HomeRecommendGoodsService;
 import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
 import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
+import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
 import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
@@ -44,6 +45,9 @@
 
 	@Resource
 	private TLJBuyGoodsService tljBuyGoodsService;
+
+	@Resource
+	private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
 
 	@Override
 	public List<TaoBaoGoodsBrief> listGoodsByPage(Long uid, String device, String imei, String idfa, int page) {
@@ -192,6 +196,8 @@
 		if (goodsList != null && goodsList.size() > 0)
 			saveObjList(goodsList, name, key);
 
+		// 鍟嗗搧淇℃伅杩囨护
+		goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
 		return goodsList;
 	}
 
@@ -209,7 +215,7 @@
 			return list;
 
 		// 鐖嗘鍟嗗搧搴�
-		TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(16432, page, Constant.PAGE_SIZE);
+		TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(14624, page, Constant.PAGE_SIZE);
 		if (result != null) {
 			list = daTaoKeGoodsDetailService.filterTaoBaoGoods(result.getTaoBaoGoodsBriefs());
 			saveObjList(list, name, key);
@@ -253,16 +259,23 @@
 		Map<Long, TLJBuyGoods> map = new ConcurrentHashMap<>();
 		if (list != null)
 			for (TLJBuyGoods goods : list) {
-				map.put(goods.getGoods().getAuctionId(), goods);
-				finalList.add(goods.getGoods());
+				try {
+					if (goods.getGoods().getAuctionId() == null) {
+						goods.getGoods().setAuctionId(goods.getGoods().getId());
+					}
+					map.put(goods.getGoods().getAuctionId(), goods);
+					finalList.add(goods.getGoods());
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
 			}
 
 		finalList = recommendGoodsDeleteHistoryService.filterGoods(device, finalList);
 
 		if (finalList != null && finalList.size() > 0) {
 			Collections.shuffle(finalList);
-			if (finalList.size() >= 3)
-				finalList = finalList.subList(0, 3);
+			if (finalList.size() >= 10)
+				finalList = finalList.subList(0, 10);
 			list = new ArrayList<>();
 			for (TaoBaoGoodsBrief goods : finalList) {
 				list.add(map.get(goods.getAuctionId()));

--
Gitblit v1.8.0