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/ShareControllerV2.java |   38 ++++++++++++++++++++++++--------------
 1 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
index 4811164..0457f70 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -12,6 +12,7 @@
 
 import com.yeshi.fanli.entity.SystemEnum;
 import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException;
+import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
 import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager;
 import com.yeshi.fanli.util.*;
 import com.yeshi.fanli.util.StringUtil;
@@ -23,7 +24,7 @@
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
-import com.yeshi.fanli.dto.ConfigParamsDTO;
+import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO;
 import com.yeshi.fanli.dto.jd.JDCouponInfo;
 import com.yeshi.fanli.dto.jd.JDPingouInfo;
 import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
@@ -145,6 +146,9 @@
     @Resource
     private UserTaoLiJinRecordService userTaoLiJinRecordService;
 
+    @Resource
+    private PDDAuthService pddAuthService;
+
     private List<ShareGoodsCommentChoiceInfo> getCommentChoiceList(String token, String link, String inviteCode,
                                                                    BigDecimal fanliMoney) {
         List<ShareGoodsCommentChoiceInfo> list = new ArrayList<>();
@@ -247,7 +251,7 @@
             commentText = commentText.replace("棰嗗埜鎶㈣喘", "鎶㈣喘");
             commentText = commentText.replace("銆愬埜鍚庝环銆慬鍒稿悗浠穄鍏�", "");
         } else {
-            commentText = commentText.replace("[鍒稿悗浠穄", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
+            commentText = commentText.replace("[鍒稿悗浠穄", TaoBaoUtil.getCouponPrice(goods) + "");
         }
 
         commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
@@ -414,7 +418,7 @@
                         .replace("{鍟嗗搧鍘熶环}", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "")
                         .replace("{浼樻儬鍒搁潰棰潁", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())
                         .replace("{娣樼ぜ閲戦潰棰潁", MoneyBigDecimalUtil.getWithNoZera(spreadMoney).toString())
-                        .replace("{浼樻儬鍒镐环}", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
+                        .replace("{浼樻儬鍒镐环}", TaoBaoUtil.getCouponPrice(goods) + "");
             }
 
             shareText = shareText.replace("{搴楅摵绫诲瀷}", shopType)
@@ -500,7 +504,7 @@
             TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(uid, goodsId, relationId, null);
 
             if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
-                ConfigParamsDTO dto = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, acceptData.getSystem());
+                GoodsMoneyConfigParamsDTO dto = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, acceptData.getSystem());
                 GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
                 shareInfo.setGoodsInfo(goodsInfo);
             }
@@ -645,7 +649,7 @@
                     commentText = commentText.replace("銆愬埜鍚庝环銆慬鍒稿悗浠穄鍏�", "");
                 } else {
                     commentText = commentText.replace("[鍒稿悗浠穄",
-                            TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
+                            TaoBaoUtil.getCouponPrice(taoBaoLink.getGoods()) + "");
                 }
 
                 if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
@@ -825,7 +829,7 @@
                 recommendText = recommendText.replace("[鍒搁潰棰漖",
                         BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString());
                 commentText = commentText.replace("[鍒稿悗浠穄",
-                        BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString());
+                        BigDecimalUtil.getWithNoZera(JDUtil.getCouponPrice(jdGoods)).toString());
             }
             commentText = commentText.replace("[閾炬帴]", jumpLink);
         } else {
@@ -892,8 +896,14 @@
         //鏌ヨ褰撳墠鐢ㄦ埛鏄惁鎺堟潈
 
         if (VersionUtil.greaterThan_2_1_5(acceptData.getPlatform(), acceptData.getVersion())) {
-            if (!PinDuoDuoApiUtil.isAuth(PinDuoDuoApiUtil.PID_SHARE, PinDuoDuoUtil.getCustomParams(uid))) {
-                JsonUtil.loadFalseResult(20001, "灏氭湭澶囨,璇峰厛澶囨");
+            if (!PinDuoDuoApiUtil.isAuth(PinDuoDuoApiUtil.PID_SHARE, pddAuthService.getFanliCustomParams(uid))) {
+                out.print(JsonUtil.loadFalseResult(20001, "灏氭湭澶囨,璇峰厛澶囨"));
+                return;
+            }
+        } else {
+            if (System.currentTimeMillis() > TimeUtil.convertToTimeTemp("2021-05-01", "yyyy-MM-dd") && !PinDuoDuoApiUtil.isAuth(PinDuoDuoApiUtil.PID_SHARE, pddAuthService.getFanliCustomParams(uid))) {
+                out.print(JsonUtil.loadFalseResult(20001, "璇峰崌绾у埌鏈�鏂扮増"));
+                return;
             }
         }
 
@@ -923,7 +933,7 @@
         if (needGoods) {
             shareInfo
                     .setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods,
-                            new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
+                            new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
                                     hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE,
                                     hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem()))));
         }
@@ -1007,7 +1017,7 @@
                 recommendText = recommendText.replace("浼樻儬鍒�:[鍒搁潰棰漖鍏�", "");
             } else {
                 commentText = commentText.replace("[鍒稿悗浠穄",
-                        BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getQuanPrice(goods)).toString());
+                        BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getCouponPrice(goods)).toString());
 
                 BigDecimal hundred = new BigDecimal(100);
                 BigDecimal amount = MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponDiscount()), hundred);
@@ -1091,7 +1101,7 @@
         if (needGoods) {
             shareInfo
                     .setGoodsInfo(GoodsDetailVOFactory.convertVIPGoods(goods,
-                            new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
+                            new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
                                     hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE,
                                     hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem()))));
         }
@@ -1226,7 +1236,7 @@
         if (needGoods) {
             shareInfo
                     .setGoodsInfo(GoodsDetailVOFactory.convertSuningGoods(goods,
-                            new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
+                            new GoodsMoneyConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()),
                                     hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE,
                                     hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, acceptData.getSystem()))));
         }
@@ -1852,7 +1862,7 @@
             }
         }
 
-        ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+        GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                 acceptData.getVersion(), acceptData.getSystem());
 
         Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
@@ -1924,7 +1934,7 @@
         }
 
         GoodsDetailVO goodsDetail = null;
-        ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+        GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                 acceptData.getVersion(), acceptData.getSystem());
         paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem()));
 

--
Gitblit v1.8.0