From 367dfb4ba7f1f181314ea4bfe3cb7cf9ae036b02 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 09 十月 2021 18:47:21 +0800
Subject: [PATCH] 京东订单备份,长期处于付款状态的订单处理

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java |   69 ++++++++++++++++++----------------
 1 files changed, 36 insertions(+), 33 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 8d9f846..60c76da 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
@@ -13,8 +13,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import javax.annotation.Resource;
 
@@ -26,24 +24,19 @@
 import com.yeshi.fanli.exception.pdd.PDDAuthException;
 import com.yeshi.fanli.exception.pdd.PDDGoodsException;
 import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException;
-import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
 import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
-import com.yeshi.fanli.service.manger.ClipboardContentType;
+import com.yeshi.fanli.service.inter.user.UserFunctionsLimitService;
 import com.yeshi.fanli.service.manger.PIDManager;
 import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager;
 import com.yeshi.fanli.service.manger.goods.jd.JDConvertLinkManager;
 import com.yeshi.fanli.service.manger.goods.pdd.PDDConvertLinkManager;
-import com.yeshi.fanli.service.manger.goods.suning.SuningConvertLinkManager;
 import com.yeshi.fanli.service.manger.goods.tb.TBConvertLinkManager;
-import com.yeshi.fanli.service.manger.goods.vipshop.VipShopConvertLinkManager;
 import com.yeshi.fanli.util.*;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.exception.ExceptionConstant;
 import com.yeshi.fanli.util.goods.GoodsJumpUtil;
 import com.yeshi.fanli.util.goods.GoodsTextUtil;
-import com.yeshi.fanli.util.suning.SuningUtil;
 import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
-import com.yeshi.fanli.util.vipshop.VipShopUtil;
 import com.yeshi.fanli.vo.goods.ConvertLinkJumpVO;
 import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO;
 import org.apache.commons.beanutils.PropertyUtils;
@@ -81,7 +74,7 @@
 import com.yeshi.fanli.entity.jd.JDGoods;
 import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.taobao.TaoBaoLink;
-import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
+import com.yeshi.fanli.exception.goods.ConvertLinkException;
 import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
 import com.yeshi.fanli.service.inter.config.ConfigService;
@@ -89,14 +82,12 @@
 import com.yeshi.fanli.service.inter.dynamic.ArticleOfficialService;
 import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
 import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
-import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
 import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService;
 import com.yeshi.fanli.service.inter.homemodule.SpecialService;
 import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
 import com.yeshi.fanli.service.inter.user.QrCodeService;
 import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
 import com.yeshi.fanli.service.inter.user.UserInfoService;
-import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
 import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
 import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
 import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
@@ -175,12 +166,6 @@
     private PDDConvertLinkManager pddConvertLinkManager;
 
     @Resource
-    private SuningConvertLinkManager suningConvertLinkManager;
-
-    @Resource
-    private VipShopConvertLinkManager vipShopConvertLinkManager;
-
-    @Resource
     private DailyCountMomentsService dailyCountMomentsService;
 
     @Resource
@@ -188,6 +173,9 @@
 
     @Resource
     private PDDAuthService pddAuthService;
+
+    @Resource
+    private UserFunctionsLimitService userFunctionsLimitService;
 
 
     @Resource
@@ -682,6 +670,9 @@
                 }
 
                 for (GoodsEvaluate goodsEvaluate : list) {
+                    if (goodsEvaluate.getGoods() != null) {
+                        goodsEvaluate.getGoods().setCreatetime(null);
+                    }
                     GoodsEvaluate evaluateNew = new GoodsEvaluate();
                     try {
                         PropertyUtils.copyProperties(evaluateNew, goodsEvaluate);
@@ -717,7 +708,7 @@
 
                         for (ImgInfo imgInfo : goodsEvaluate.getImgList()) {
 
-                            if (acceptData.getSystem() == SystemEnum.yhqjx) {
+                            if (acceptData.getSystem() == SystemEnum.yhqjx || acceptData.getSystem() == SystemEnum.hsb) {
                                 imgInfo.setGoods(null);
                                 imgInfo.setGoodsVO(null);
                             }
@@ -885,7 +876,7 @@
             String url = urlList.get(0);
             if (JDUtil.isJDLink(url)) {
                 try {
-                    url = jdConvertLinkManager.convertShortUrl(url, uid, acceptData.getSystem(), SystemPIDInfo.PidType.fanli);
+                    url = jdConvertLinkManager.convertShortUrl(url, uid, acceptData.getSystem(), uid == null ? SystemPIDInfo.PidType.coupon : SystemPIDInfo.PidType.fanli);
                 } catch (ParamsException e) {
                     e.printStackTrace();
                 }
@@ -899,7 +890,7 @@
                 String customParams = pddAuthService.getFanliCustomParams(uid);
                 PDDConvertLinkResultVO convertLinkResult = null;
                 try {
-                    convertLinkResult = pddConvertLinkManager.convertGoods(Long.parseLong(pddGoodsId), acceptData.getSystem(), customParams, SystemPIDInfo.PidType.fanli);
+                    convertLinkResult = pddConvertLinkManager.convertGoods(Long.parseLong(pddGoodsId), acceptData.getSystem(), customParams, uid == null ? SystemPIDInfo.PidType.coupon : SystemPIDInfo.PidType.fanli);
                     convertLinkJumpVO = new ConvertLinkJumpVO(GoodsJumpUtil.getPDDJumpInfo(convertLinkResult), Constant.SOURCE_TYPE_PDD);
                     outPrintConvertResult(convertLinkJumpVO, out);
                     return;
@@ -928,7 +919,7 @@
                 if (convertResult != null) {
                     String originUrl = convertResult.getOrigin_url();
                     long goodsId = convertResult.getNum_iid();
-                    TaoBaoLink taoBaoLink = tbConvertLinkManager.convertGoods(goodsId, uid, acceptData.getSystem(), SystemPIDInfo.PidType.fanli);
+                    TaoBaoLink taoBaoLink = tbConvertLinkManager.convertGoods(goodsId, uid, acceptData.getSystem(), uid == null ? SystemPIDInfo.PidType.coupon : SystemPIDInfo.PidType.fanli);
                     convertLinkJumpVO = new ConvertLinkJumpVO(GoodsJumpUtil.getTBJumpInfo(taoBaoLink), Constant.SOURCE_TYPE_TAOBAO);
                     outPrintConvertResult(convertLinkJumpVO, out);
                     return;
@@ -1023,6 +1014,13 @@
                 out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
                 return;
             }
+
+
+            if (userFunctionsLimitService.isLimit(uid, SystemFunction.share, new Date())) {
+                out.print(JsonUtil.loadFalseResult(1, "璇ュ姛鑳介檺鍒朵娇鐢�"));
+                return;
+            }
+
 
             UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
             String relationId = null;
@@ -1234,6 +1232,11 @@
             return;
         }
 
+        if (userFunctionsLimitService.isLimit(uid, SystemFunction.share, new Date())) {
+            out.print(JsonUtil.loadFalseResult(1, "璇ュ姛鑳介檺鍒朵娇鐢�"));
+            return;
+        }
+
         UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
         String relationId = null;
         if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
@@ -1261,7 +1264,7 @@
         String newText = text; // 闈為�氱敤鍒搁渶瑕侀獙璇�
 
         //鐗逛环鍙渶瑕佸鍒舵枃瀛楋紝涓嶉渶瑕佽浆閾�
-        if (acceptData.getSystem() == SystemEnum.yhqjx) {
+        if (acceptData.getSystem() == SystemEnum.yhqjx || acceptData.getSystem() == SystemEnum.hsb) {
             newText = GoodsTextUtil.decodeAppHtmlText(newText);
             //鍙鍒舵枃瀛�
             JSONObject data = new JSONObject();
@@ -1274,8 +1277,8 @@
         if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) {
             try {
                 newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true);
-            } catch (ConvertLinkExceptionException e) {
-                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
+            } catch (ConvertLinkException e) {
+                if (e.getCode() != ConvertLinkException.CODE_NONE) {
                     out.print(JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
                     return;
                 }
@@ -1358,8 +1361,8 @@
         if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
             try {
                 newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true);
-            } catch (ConvertLinkExceptionException e) {
-                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
+            } catch (ConvertLinkException e) {
+                if (e.getCode() != ConvertLinkException.CODE_NONE) {
                     out.print(JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
                     return;
                 }
@@ -1427,7 +1430,7 @@
 
             int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
             jumpDetail = jumpDetailV2Service.getByTypeCache("web", platformCode,
-                    Integer.parseInt(acceptData.getVersion()));
+                    Integer.parseInt(acceptData.getVersion()), acceptData.getSystem());
             JSONObject inner = new JSONObject();
             inner.put("url", jumpLink);
             params = inner.toString();
@@ -1553,8 +1556,8 @@
         if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) {
             try {
                 newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true);
-            } catch (ConvertLinkExceptionException e) {
-                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
+            } catch (ConvertLinkException e) {
+                if (e.getCode() != ConvertLinkException.CODE_NONE) {
                     JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
                     return;
                 }
@@ -1705,8 +1708,8 @@
                 }
 
                 imgUrl = createActivityShareImg(type, id, erCodeContent);
-            } catch (ConvertLinkExceptionException e) {
-                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
+            } catch (ConvertLinkException e) {
+                if (e.getCode() != ConvertLinkException.CODE_NONE) {
                     JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
                     return;
                 }
@@ -1782,8 +1785,8 @@
         if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) {
             try {
                 newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true);
-            } catch (ConvertLinkExceptionException e) {
-                if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
+            } catch (ConvertLinkException e) {
+                if (e.getCode() != ConvertLinkException.CODE_NONE) {
                     JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇勮鐢熸垚澶辫触"));
                     return;
                 }

--
Gitblit v1.8.0