From eda5d0e998204c7a49ab84d8528569b765bec2f9 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期五, 20 十二月 2019 10:05:10 +0800
Subject: [PATCH] 品牌日志

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java |   56 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
index b117402..b92e409 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -240,7 +240,7 @@
 
 		LogHelper.test("鑾峰彇PID鑰楁椂锛�" + (java.lang.System.currentTimeMillis() - startTime));
 
-		final List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
+		// final List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
 		// 鏄惁鍦ㄦ湇鍔$杩涜杞摼
 		boolean convertInServer = configService.isConvertTaoBaoLinkInServer();
 
@@ -309,7 +309,6 @@
 		}
 
 		if (goods != null) {
-			goodsList.add(goods);
 			final TaoBaoGoodsBrief newGoods = goods;
 			ThreadUtil.run(new Runnable() {
 				public void run() {
@@ -324,10 +323,7 @@
 			});
 		}
 
-		TaoBaoGoodsBrief tb = null;
-		if (goodsList.size() > 0) {
-			tb = goodsList.get(0);
-		}
+		TaoBaoGoodsBrief tb = goods;
 
 		if (tb == null) {
 			out.print(JsonUtil.loadFalseResult(2, "鍟嗗搧涓嶅瓨鍦�"));
@@ -338,14 +334,31 @@
 			tb.setImgList(new ArrayList<>());
 		}
 
-		tb.getImgList().add(0, tb.getPictUrl());
+		// tb.getImgList().add(0, tb.getPictUrl());
 
 		List<String> finalImgList = new ArrayList<>();
 		for (String img : tb.getImgList()) {
 			finalImgList.add(TbImgUtil.getTBSizeImg(img, 600));
 		}
+		
+		if (finalImgList.size() == 0) {
+			finalImgList.add(tb.getPictUrl());
+		}
+		
 		if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite()))
 			finalImgList.add(0, tb.getPictUrlWhite());
+
+		// 绉婚櫎鐩稿悓鍥剧墖
+		if (finalImgList.size() > 0)
+			for (int i = 0; i < finalImgList.size(); i++) {
+				if (i < finalImgList.size() - 1)
+					if (TbImgUtil.getTBSizeImg(finalImgList.get(i), 600)
+							.equalsIgnoreCase(TbImgUtil.getTBSizeImg(finalImgList.get(i + 1), 600))) {
+						finalImgList.remove(i--);
+					}
+			}
+
+		tb.setImgList(finalImgList);
 
 		// 澶ф窐瀹㈠晢鍝佽繃婊�
 		try {
@@ -361,7 +374,8 @@
 		GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
 		if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
 			goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
-			goodsDetail.getMoneyInfo().setShareMoney("楼"+ TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
+			goodsDetail.getMoneyInfo().setShareMoney(
+					"楼" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
 		}
 
 		if (TaoBaoUtil.isYUShou(goods)) {
@@ -507,20 +521,22 @@
 			OtherInfo otherInfo = new OtherInfo();
 			otherInfo.setReduceHongBao(newUserHongBao);
 			goodsDetail.setOtherInfo(otherInfo);
-			
+
 			// 涓撳睘鏍囩
 			List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
 			labels.add(new ClientTextStyleVO("鏂颁汉涓撳睘", "#FE0014"));
 			labels.add(new ClientTextStyleVO("瀹炰粯0鍏�", "#FF9600"));
 			goodsDetail.setLabels(labels);
-			
+
 		} else {// 鏅�氳喘涔�
 			OtherInfo otherInfo = new OtherInfo();
 			RewardCouponVO rewardCoupon = new RewardCouponVO();
 			rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
 			JSONObject params1 = new JSONObject();
-			params1.put("url", configService.get("special_guide_reward_coupon_link"));
-
+			if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
+				params1.put("url", configService.get("special_guide_reward_coupon_link"));
+			else
+				params1.put("url", configService.get("vip_link"));
 			rewardCoupon
 					.setMaxMoney("楼" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPFanLiRate()));
 			if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -615,7 +631,8 @@
 		GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
 		if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
 			goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
-			goodsDetail.getMoneyInfo().setShareMoney("楼"+ JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
+			goodsDetail.getMoneyInfo()
+					.setShareMoney("楼" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
 		}
 
 		// 闄勫姞淇℃伅
@@ -654,7 +671,10 @@
 		rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
 		rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
 		JSONObject params1 = new JSONObject();
-		params1.put("url", configService.get("special_guide_reward_coupon_link"));
+		if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
+			params1.put("url", configService.get("special_guide_reward_coupon_link"));
+		else
+			params1.put("url", configService.get("vip_link"));
 
 		rewardCoupon.setMaxMoney("楼" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPFanLiRate()));
 		if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -807,7 +827,8 @@
 		GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
 		if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
 			goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
-			goodsDetail.getMoneyInfo().setShareMoney("楼"+ PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
+			goodsDetail.getMoneyInfo().setShareMoney(
+					"楼" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
 		}
 
 		// 闄勫姞淇℃伅
@@ -815,7 +836,10 @@
 		RewardCouponVO rewardCoupon = new RewardCouponVO();
 		rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
 		JSONObject params1 = new JSONObject();
-		params1.put("url", configService.get("special_guide_reward_coupon_link"));
+		if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
+			params1.put("url", configService.get("special_guide_reward_coupon_link"));
+		else
+			params1.put("url", configService.get("vip_link"));
 
 		rewardCoupon
 				.setMaxMoney("楼" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPFanLiRate()));

--
Gitblit v1.8.0