From 457f4881a89c03984c7b46ed10e8919d3294976c Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 08 六月 2020 16:45:29 +0800
Subject: [PATCH] 淘宝好物圈修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java |   77 +++++++++++++++++++++++++-------------
 1 files changed, 50 insertions(+), 27 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 5d08841..d0b1831 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
@@ -450,7 +450,7 @@
 		if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
 			goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
 			goodsDetail.getMoneyInfo().setShareMoney("楼" + TaoBaoUtil.getGoodsHongBaoMoney(goods,
-					hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
+					hongBaoManageService.getShareRate(UserLevelEnum.superVIP), true));
 			goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
 			goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
 		}
@@ -552,7 +552,8 @@
 			shareValid = false;
 			helpLink = configService.get(ConfigKeyEnum.zigoulijianNofanliHelp.getKey());
 
-			BigDecimal tljHongBao = TaoBaoUtil.getGoodsHongBaoMoney(goods, TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
+			BigDecimal tljHongBao = TaoBaoUtil.getGoodsHongBaoMoney(goods, TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE,
+					false);
 
 			ReduceHongBao reduceHongBao = new ReduceHongBao();
 			reduceHongBao.setLeft(buyGoods.getLeftHongBaoCount());
@@ -854,11 +855,11 @@
 		// 鍟嗗搧閾炬帴
 		String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
 				Constant.systemCommonConfig.getShareGoodsPagePathJD(), "", id + "");
-		try {
-			extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
-		} catch (Exception e) {
-			extraVO.setH5Url(h5Url);
-		}
+		// try {
+		// extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
+		// } catch (Exception e) {
+		extraVO.setH5Url(h5Url);
+		// }
 
 		String helpLink = null;
 		extraVO.setFanliValid(true);
@@ -1033,11 +1034,11 @@
 		// 鍒嗕韩璺緞
 		String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
 				Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
-		try {
-			extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
-		} catch (Exception e) {
-			extraVO.setH5Url(h5Url);
-		}
+		// try {
+		// extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
+		// } catch (Exception e) {
+		extraVO.setH5Url(h5Url);
+		// }
 
 		String helpLink = null;
 		extraVO.setFanliValid(true);
@@ -1173,11 +1174,11 @@
 		// 鍒嗕韩璺緞
 		String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
 				Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
-		try {
-			extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
-		} catch (Exception e) {
-			extraVO.setH5Url(h5Url);
-		}
+		// try {
+		// extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
+		// } catch (Exception e) {
+		extraVO.setH5Url(h5Url);
+		// }
 
 		String helpLink = null;
 		extraVO.setFanliValid(true);
@@ -1304,11 +1305,11 @@
 		// 鍒嗕韩璺緞
 		String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
 				Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
-		try {
-			extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
-		} catch (Exception e) {
-			extraVO.setH5Url(h5Url);
-		}
+		// try {
+		// extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
+		// } catch (Exception e) {
+		extraVO.setH5Url(h5Url);
+		// }
 
 		String helpLink = null;
 		extraVO.setFanliValid(true);
@@ -1431,10 +1432,10 @@
 				out.print(JsonUtil.loadTrueResult(data));
 				return;
 			}
-			
+
 			if (goodsType == Constant.SOURCE_TYPE_SUNING) {
-				//鐚滀綘鍠滄
-				
+				// 鐚滀綘鍠滄
+
 			}
 
 			List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(Long.parseLong(id), 10);
@@ -1563,6 +1564,9 @@
 		} else {
 			jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "",
 					uid + "");
+			if (StringUtil.isNullOrEmpty(jumpLink)) {
+				jumpLink = couponUrl;
+			}
 		}
 
 		JSONObject data = new JSONObject();
@@ -1589,6 +1593,9 @@
 		String materialId = "https://item.jd.com/" + id + ".html";
 
 		jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", null);
+		if (StringUtil.isNullOrEmpty(jumpLink)) {
+			jumpLink = couponUrl;
+		}
 
 		JSONObject data = new JSONObject();
 		data.put("native", true);
@@ -1718,8 +1725,8 @@
 		String quanUrl = null;
 		if (!StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl()))
 			quanUrl = goods.getCouponInfo().getCouponUrl();
-		String link = SuningApiUtil.convertLink(SuningUtil.getProductUrl(supplierCode, goodsCode),
-				quanUrl, SuningApiUtil.PID_BUY, uid + "");
+		String link = SuningApiUtil.convertLink(SuningUtil.getProductUrl(supplierCode, goodsCode), quanUrl,
+				SuningApiUtil.PID_BUY, uid + "");
 		JSONObject data = new JSONObject();
 		data.put("native", false);
 		data.put("jumpLink", link);
@@ -1782,6 +1789,22 @@
 			} else {
 				data.put("extend", true);
 			}
+		} else if (goodsType == Constant.SOURCE_TYPE_VIP) {
+			VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(goodsId);
+			if (goods == null) {
+				data.put("extend", false);
+				data.put("url","");
+			} else {
+				data.put("extend", true);
+			}
+		} else if (goodsType == Constant.SOURCE_TYPE_SUNING) {
+			SuningGoodsInfo goods = SuningApiUtil.getGoodsDetail(goodsId.split("-")[1], goodsId.split("-")[0]);
+			if (goods == null) {
+				data.put("extend", false);
+				data.put("url", String.format("https://m.suning.com/product/%s/%s.html", goodsId.split("-")[0],goodsId.split("-")[1]));
+			} else {
+				data.put("extend", true);
+			}
 		}
 		out.print(JsonUtil.loadTrueResult(data));
 	}

--
Gitblit v1.8.0