From e74819e845de27735605c8116ee73768560e0fd9 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期三, 03 六月 2020 15:17:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- 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 8e3e28d..bbc8660 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 @@ -864,11 +864,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); @@ -1047,11 +1047,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); @@ -1191,11 +1191,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); @@ -1621,6 +1621,9 @@ } else { jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + ""); + if (StringUtil.isNullOrEmpty(jumpLink)) { + jumpLink = couponUrl; + } } JSONObject data = new JSONObject(); @@ -1647,6 +1650,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); @@ -1840,6 +1846,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