From 9129d51874b36943419994937af56c2f73aed1a0 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 03 六月 2020 15:14:10 +0800
Subject: [PATCH] 唯品会,苏宁相关bug修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java |   52 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 37 insertions(+), 15 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 d023e8b..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
@@ -855,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);
@@ -1034,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);
@@ -1174,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);
@@ -1564,6 +1564,9 @@
 		} else {
 			jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "",
 					uid + "");
+			if (StringUtil.isNullOrEmpty(jumpLink)) {
+				jumpLink = couponUrl;
+			}
 		}
 
 		JSONObject data = new JSONObject();
@@ -1590,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);
@@ -1783,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