From a1be6075c6b1365a7abc66bf559d6058039248ab Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 19 五月 2021 18:13:29 +0800
Subject: [PATCH] 淘礼金兼容

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
index fa8f530..ede84e7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -16,6 +16,7 @@
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
 import com.yeshi.fanli.entity.SystemEnum;
 import com.yeshi.fanli.entity.SystemFunction;
 import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException;
@@ -870,7 +871,7 @@
             }
             String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
             if (SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.threeSale)) {
-                 inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
+                inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
                 if (StringUtil.isNullOrEmpty(inviteCode)) {
                     out.print(JsonUtil.loadFalseResult(1, "閭�璇风爜鏈縺娲�"));
                     return;
@@ -977,7 +978,7 @@
             }
 
             if (list.size() == 0) {
-                out.print(JsonUtil.loadFalseResult("璇ヤ俊鎭凡涓嬫灦"));
+                out.print(JsonUtil.loadFalseResult("鎿嶄綔澶辫触"));
                 return;
             }
 
@@ -1017,10 +1018,15 @@
                 couponUrl = couponInfo.getLink();
             }
             String materialId = "https://item.jd.com/" + goodsVO.getGoodsId() + ".html";
-            jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
+            jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, JDApiUtil.POSITION_SHARE + "",
                     user.getId() + "");
         } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
-            jumpLink = PinDuoDuoApiUtil.getPromotionUrl(Long.parseLong(goodsVO.getGoodsId()),
+            PDDGoodsDetail pddGoodsDetail = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(goodsVO.getGoodsId()));
+            if (pddGoodsDetail == null) {
+                return null;
+            }
+
+            jumpLink = PinDuoDuoApiUtil.getPromotionUrl(pddGoodsDetail.getGoodsSign(),
                     PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + "");
         }
 
@@ -1091,7 +1097,7 @@
         String newText = text; // 闈為�氱敤鍒搁渶瑕侀獙璇�
         if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) {
             try {
-                newText = convertLinkManager.convertLinkFromText(text, uid, true);
+                newText = convertLinkManager.convertLinkFromText(text, uid, true, true);
             } catch (ConvertLinkExceptionException e) {
                 if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
                     out.print(JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
@@ -1175,7 +1181,7 @@
         String newText = text;
         if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
             try {
-                newText = convertLinkManager.convertLinkFromText(text, uid, true);
+                newText = convertLinkManager.convertLinkFromText(text, uid, true, true);
             } catch (ConvertLinkExceptionException e) {
                 if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
                     out.print(JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
@@ -1370,7 +1376,7 @@
         String newText = text;
         if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
             try {
-                newText = convertLinkManager.convertLinkFromText(text, uid, true);
+                newText = convertLinkManager.convertLinkFromText(text, uid, true, true);
             } catch (ConvertLinkExceptionException e) {
                 if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
                     JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
@@ -1502,7 +1508,7 @@
         if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
             try {
                 String erCodeContent = "";
-                newText = convertLinkManager.convertLinkFromText(text, uid, true);
+                newText = convertLinkManager.convertLinkFromText(text, uid, true, true);
                 // 鑾峰彇鍙d护
                 List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(newText);
                 if (tokenList != null && tokenList.size() > 0) {
@@ -1599,7 +1605,7 @@
         String newText = text; // 闈為�氱敤鍒搁渶瑕侀獙璇�
         if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) {
             try {
-                newText = convertLinkManager.convertLinkFromText(text, uid, true);
+                newText = convertLinkManager.convertLinkFromText(text, uid, true, true);
             } catch (ConvertLinkExceptionException e) {
                 if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
                     JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));

--
Gitblit v1.8.0