From 24a8d17e007545f7426c48352109aa1a9c6587ee Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 06 五月 2020 12:02:09 +0800
Subject: [PATCH] IOS上线隐藏我的界面的banner与超级会员升级信息

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

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailV2ServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailV2ServiceImpl.java
index edc36eb..0a8accf 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailV2ServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailV2ServiceImpl.java
@@ -21,6 +21,7 @@
 import com.yeshi.fanli.dao.goods.taobao.dataoke.DaTaoKeGoodsDetailV2Dao;
 import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
 import com.yeshi.fanli.dto.dataoke.DingDongQiangDTO;
+import com.yeshi.fanli.dto.taobao.DaTaoKeFilterResult;
 import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
 import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
 import com.yeshi.fanli.log.LogHelper;
@@ -159,11 +160,17 @@
 		for (TaoBaoGoodsBrief goods : goodsList)
 			goodsIdList.add(goods.getAuctionId());
 
-		List<DaTaoKeDetailV2> dtList = listByGoodsIds(goodsIdList);
+		List<DaTaoKeDetailV2> dtList = null;
 
+		try {
+			dtList = listByGoodsIds(goodsIdList);
+		} catch (Exception e) {
+
+		}
 		Map<Long, DaTaoKeDetailV2> map = new HashMap<>();
-		for (DaTaoKeDetailV2 goods : dtList)
-			map.put(goods.getGoodsId(), goods);
+		if (dtList != null)
+			for (DaTaoKeDetailV2 goods : dtList)
+				map.put(goods.getGoodsId(), goods);
 		for (TaoBaoGoodsBrief goods : goodsList) {
 			DaTaoKeDetailV2 detail = map.get(goods.getAuctionId());
 			goods = DaTaoKeUtil.filterTaoBaoGoods(goods, detail);
@@ -171,20 +178,6 @@
 		return goodsList;
 	}
 
-	@Override
-	public TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods) {
-		List<Long> goodsIdList = new ArrayList<>();
-		goodsIdList.add(goods.getAuctionId());
-
-		List<DaTaoKeDetailV2> daTaoKeList = listByGoodsIds(goodsIdList);
-		if (daTaoKeList == null || daTaoKeList.size() == 0)
-			return goods;
-
-		// 閲嶆柊璁剧疆鏍囬涓庡埜浠锋牸
-		goods = DaTaoKeUtil.filterTaoBaoGoods(goods, daTaoKeList.get(0));
-
-		return goods;
-	}
 
 	@Override
 	public List<DaTaoKeDetailV2> listByIds(List<Long> idsList) {
@@ -210,6 +203,8 @@
 
 	@Override
 	public List<DaTaoKeDetailV2> getGoodsNotInList(Long cid, List<Long> listId, int count) {
+		if (cid != null && cid == 0L)
+			cid = null;
 		return daTaoKeGoodsDetailV2Dao.getGoodsNotInList(cid, listId, count);
 	}
 
@@ -252,11 +247,23 @@
 	public List<DaTaoKeDetailV2> listPreTLJBuyGoods(int page) {
 		if (page == 1) {
 			List<DaTaoKeDetailV2> listPreGoodsList = new ArrayList<>();
+			// 鐑攢姒�
 			DaTaoKeGoodsResult result = DaTaoKeApiUtil.getRankingList(DaTaoKeApiUtil.RANK_TYPE_HOT, null);
 			if (result != null && result.getGoodsList() != null)
 				listPreGoodsList.addAll(result.getGoodsList());
-
+			// 澶嶈喘姒�
 			result = DaTaoKeApiUtil.getRankingList(DaTaoKeApiUtil.RANK_TYPE_REBUY, null);
+			if (result != null && result.getGoodsList() != null)
+				listPreGoodsList.addAll(result.getGoodsList());
+			// 缁煎悎鎼滅储
+			try {
+				result = DaTaoKeApiUtil.search("", null, null, null, 1, 200, DaTaoKeApiUtil.SORT_DEFAULT);
+				if (result == null)
+					throw new Exception();
+			} catch (Exception e) {// 寮傚父閲嶅涓�娆�
+				result = DaTaoKeApiUtil.search("", null, null, null, 1, 200, DaTaoKeApiUtil.SORT_DEFAULT);
+			}
+
 			if (result != null && result.getGoodsList() != null)
 				listPreGoodsList.addAll(result.getGoodsList());
 
@@ -328,7 +335,8 @@
 
 	@Async
 	private void updateGoods(Long id) {
-		DaTaoKeDetailV2 v2 = DaTaoKeApiUtil.getGoodsDetail(id);
+		// TODO鏆傛椂鍏抽棴鏈嶅姟
+		DaTaoKeDetailV2 v2 = null;// DaTaoKeApiUtil.getGoodsDetail(id);
 		if (v2 != null)
 			daTaoKeGoodsDetailV2Dao.save(v2);
 	}
@@ -370,8 +378,10 @@
 				idList.add(td.getId());
 			List<DaTaoKeDetailV2> finalList = listByIds(idList);
 			if (finalList.size() != idList.size()) {
-				for (Long id : idList)
-					updateGoods(id);
+				for (Long id : idList) {
+					// updateGoods(id);
+					// TODO 涓嶈兘寮傛璋冪敤
+				}
 				finalList = listByIds(idList);
 			}
 
@@ -407,4 +417,44 @@
 		return dateList;
 	}
 
+	@Override
+	public List<DaTaoKeDetailV2> listByMaxPrice(Integer cid, BigDecimal maxPrice, String sortName, int page,
+			int count) {
+
+		return daTaoKeGoodsDetailV2Dao.listByMaxPrice(cid, maxPrice, sortName, (page - 1) * count, count);
+	}
+
+	@Override
+	public int countByMaxPrice(Integer cid, BigDecimal maxPrice) {
+		return (int) daTaoKeGoodsDetailV2Dao.countByMaxPrice(cid, maxPrice);
+	}
+
+	@Override
+	public List<DaTaoKeDetailV2> listBySellerId(long start, int count, Long sellerId) {
+		return daTaoKeGoodsDetailV2Dao.listBySellerId((int) start, count, sellerId);
+	}
+
+	@Override
+	public DaTaoKeDetailV2 selectByAuctionId(Long auctionId) {
+		return daTaoKeGoodsDetailV2Dao.selectByAuctionId(auctionId);
+	}
+
+	@Cacheable(value = "daTaoKeGoodsCache", key = "'selectByAuctionId-'+#auctionId")
+	@Override
+	public DaTaoKeDetailV2 selectByAuctionIdCache(Long auctionId) {
+		return selectByAuctionId(auctionId);
+	}
+
+	@Override
+	public DaTaoKeFilterResult filterTaoBaoGoods(TaoBaoGoodsBrief goods) {
+		List<Long> goodsIdList = new ArrayList<>();
+		goodsIdList.add(goods.getAuctionId());
+
+		List<DaTaoKeDetailV2> daTaoKeList = listByGoodsIds(goodsIdList);
+		if (daTaoKeList == null || daTaoKeList.size() == 0)
+			return new DaTaoKeFilterResult(goods, DaTaoKeFilterResult.FILTER_TYPE_NONE);
+		// 閲嶆柊璁剧疆鏍囬涓庡埜浠锋牸
+		return DaTaoKeUtil.filterTaoBaoGoods(goods, daTaoKeList.get(0), true);
+	}
+
 }

--
Gitblit v1.8.0