From ae0e155d723c6b955e4632b868703eb7c282503d Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期三, 08 一月 2020 17:47:57 +0800
Subject: [PATCH] 版本不同性别Redis缓存

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java |  190 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 138 insertions(+), 52 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 5133402..2b9deb2 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
@@ -32,9 +32,11 @@
 import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
 import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
+import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
 import com.yeshi.fanli.entity.goods.CommonGoods;
 import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
 import com.yeshi.fanli.entity.jd.JDGoods;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
 import com.yeshi.fanli.entity.taobao.TaoBaoLink;
 import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
@@ -67,6 +69,7 @@
 import com.yeshi.fanli.util.RedisManager;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.TaoBaoConstant;
+import com.yeshi.fanli.util.VersionUtil;
 import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
 import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
 import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
@@ -156,21 +159,29 @@
 	private UserTaoLiJinRecordService userTaoLiJinRecordService;
 
 	/**
-	 * 鑾峰彇娣樺疂鐨勫垎浜摼鎺�
 	 * 
 	 * @param acceptData
 	 * @param uid
 	 *            -鐢ㄦ埛ID
-	 * @param auctionId-鍟嗗搧ID
+	 * @param goodsId-鍟嗗搧ID
+	 * @param source
+	 * @param totalNum
+	 * @param goodsType
+	 * @param needGoods
+	 *            -鏄惁闇�瑕佸晢鍝佷俊鎭�
+	 * @param request
 	 * @param out
 	 */
 	@RequestMapping(value = "createShareInfo")
 	public void createShareInfo(AcceptData acceptData, Long uid, Long goodsId, String source, Integer totalNum,
-			Integer goodsType, HttpServletRequest request, PrintWriter out) {
+			Integer goodsType, Boolean needGoods, HttpServletRequest request, PrintWriter out) {
 		if (uid == null || uid <= 0) {
 			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛ID涓嶈兘涓虹┖"));
 			return;
 		}
+
+		if (needGoods == null)
+			needGoods = false;
 		try {
 			// 鏃ュ織璁板綍
 			String info = String.format("type=share&uid=%s&goodsId=%s&source=%s&goodsType=%s", uid, goodsId, source,
@@ -192,21 +203,25 @@
 
 		// 娣樺疂
 		if (goodsType == null || goodsType == Constant.SOURCE_TYPE_TAOBAO) {
-			createTaoBaoShare(acceptData, uid, goodsId, totalNum, source, request, out);
+			createTaoBaoShare(acceptData, uid, goodsId, totalNum, source, needGoods, request, out);
 			return;
 		}
 
 		// 浜笢
 		if (goodsType == Constant.SOURCE_TYPE_JD) {
-			createJDShare(acceptData, uid, goodsId, source, out);
+			createJDShare(acceptData, uid, goodsId, source, needGoods, out);
 			return;
 		}
 
 		// 鎷煎澶�
 		if (goodsType == Constant.SOURCE_TYPE_PDD) {
-			createPDDShare(acceptData, uid, goodsId, source, out);
+			createPDDShare(acceptData, uid, goodsId, source, needGoods, out);
 			return;
 		}
+	}
+
+	public static String getERCodeContent(String template, TaoBaoGoodsBrief goods, String token) {
+		return template.replace("[娣樺彛浠", token);
 	}
 
 	/**
@@ -221,9 +236,20 @@
 	 * @param out
 	 */
 	public void createTaoBaoShare(AcceptData acceptData, Long uid, Long goodsId, Integer totalNum, String source,
-			HttpServletRequest request, PrintWriter out) {
+			Boolean needGoods, HttpServletRequest request, PrintWriter out) {
+		if (needGoods == null)
+			needGoods = false;
 
 		UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService.getByUid(uid);
+		UserInfoExtra userExtraInfo = userInfoExtraService.getUserInfoExtra(uid);
+		String inviteCode = null;
+		if (userExtraInfo != null) {
+			if (!StringUtil.isNullOrEmpty(userExtraInfo.getInviteCodeVip())) {
+				inviteCode = userExtraInfo.getInviteCodeVip();
+			} else {
+				inviteCode = userExtraInfo.getInviteCode();
+			}
+		}
 		String relationId = null;
 		if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
 				&& extraInfo.getRelationValid() == true)
@@ -243,7 +269,17 @@
 		try {
 			ShareInfoVO shareInfo = new ShareInfoVO();
 
+			// 娴嬭瘯
+
 			TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
+
+			if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
+				ConfigParamsDTO dto = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+						acceptData.getVersion());
+
+				GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
+				shareInfo.setGoodsInfo(goodsInfo);
+			}
 
 			String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
 					Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
@@ -256,8 +292,28 @@
 
 			shareInfo.setClickUrl(url);
 			shareInfo.setToken(TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
-			shareInfo.setRule(configService.get("share_single_goods_rule"));
+			shareInfo.setRule(configService.get(ConfigKeyEnum.shareSingleGoodsRule.getKey()));
 			shareInfo.setPictUrl(TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
+
+			String commentTextStr = configService.get(ConfigKeyEnum.shareSingleGoodsCommentText.getKey());
+			List<String> commentTexts = new ArrayList<>();
+			if (!StringUtil.isNullOrEmpty(commentTextStr)) {
+				JSONArray array = JSONArray.fromObject(commentTextStr);
+				for (int i = 0; i < array.size(); i++) {
+					if (StringUtil.isNullOrEmpty(inviteCode)) {
+						if (array.optString(i).contains("[閭�璇风爜]")) {
+							continue;
+						}
+					}
+					if (StringUtil.isNullOrEmpty(inviteCode))
+						commentTexts.add(array.optString(i).replace("[涓嬭浇閾炬帴]", Constant.YINGYONGBAO_LINK)
+								.replace("[娣樺彛浠", shareInfo.getToken()));
+					else
+						commentTexts.add(array.optString(i).replace("[涓嬭浇閾炬帴]", Constant.YINGYONGBAO_LINK)
+								.replace("[閭�璇风爜]", inviteCode).replace("[娣樺彛浠", shareInfo.getToken()));
+				}
+			}
+			shareInfo.setCommentTexts(commentTexts);
 
 			String shareText = "";
 			// 鏃犲埜
@@ -267,14 +323,14 @@
 			if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
 				String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
 				if (StringUtil.isNullOrEmpty(text))
-					text = configService.get("goods_share_text_nocoupon");
+					text = configService.get(ConfigKeyEnum.goodsShareTextNoCoupon.getKey());
 				shareText = text.replace("{鏍囬}", taoBaoLink.getGoods().getTitle()).replace("{鍟嗗搧鍘熶环}",
 						MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "");
 			} else// 鏈夊埜
 			{
 				String text = shareGoodsTextTemplateService.geteCouponTemplate(uid);
 				if (StringUtil.isNullOrEmpty(text))
-					text = configService.get("goods_share_text_coupon");
+					text = configService.get(ConfigKeyEnum.goodsShareTextCoupon.getKey());
 
 				shareText = text.replace("{鏍囬}", taoBaoLink.getGoods().getTitle())
 						.replace("{鍟嗗搧鍘熶环}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
@@ -294,15 +350,23 @@
 				descText = descText.substring(0);
 			}
 			shareInfo.setDescText(descText);
+			// 娴嬭瘯
+			// 2.0.2涔嬪墠
+			if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
+				shareInfo.setClickUrl(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
+						taoBaoLink.getGoods(), shareInfo.getToken()));
+
+			shareInfo.setWxErCode(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), taoBaoLink.getGoods(),
+					shareInfo.getToken()));
 
 			// 鎻愮ず鍥炬枃鍐呭
-			String imgs = configService.get("goods_share_notify_imgs");
+			String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
 			JSONArray array = JSONArray.fromObject(imgs);
 			int p = (int) (array.size() * Math.random());
 			if (p < array.size()) {
 				shareInfo.setNotifyPicture(array.optString(p));
 			}
-			shareInfo.setNotifyDesc(configService.get("goods_share_notify"));
+			shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotify.getKey()));
 
 			// 鍒嗕韩閲戦
 			BigDecimal rate = hongBaoManageService.getShareRate();
@@ -322,7 +386,8 @@
 				}
 			}
 
-			out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
+			out.print(JsonUtil.loadTrueResult(
+					JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
 
 			final TaoBaoLink taobaoLink = taoBaoLink;
 			// 寮傛鎿嶄綔
@@ -340,7 +405,7 @@
 					history.setQuanLink(taobaoLink.getCouponLink());
 					history.setGoodsId(taobaoLink.getGoods().getAuctionId());
 					history.setPostPicture(taobaoLink.getGoods().getPictUrl());
-
+					history.setShareImg(taobaoLink.getClickUrl());
 					List<String> imgList = taobaoLink.getGoods().getImgList();
 					if (imgList == null) {
 						imgList = new ArrayList<>();
@@ -441,7 +506,7 @@
 				}
 			}
 			shareInfo.setToken(TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
-			shareInfo.setRule(configService.get("share_single_goods_rule"));
+			shareInfo.setRule(configService.get(ConfigKeyEnum.shareSingleGoodsRule.getKey()));
 			shareInfo.setPictUrl(TbImgUtil.getTBSizeImg(goods.getPictUrl(), 500));
 
 			// 鏃犲埜
@@ -452,7 +517,7 @@
 			if (StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
 				String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
 				if (StringUtil.isNullOrEmpty(text))
-					text = configService.get("goods_share_text_nocoupon");
+					text = configService.get(ConfigKeyEnum.goodsShareTextNoCoupon.getKey());
 				shareText = text.replace("{鏍囬}", goods.getTitle()).replace("{鍟嗗搧鍘熶环}",
 						MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
 			} else// 鏈夊埜
@@ -479,13 +544,13 @@
 
 			shareInfo.setDescText(descText);
 
-			String imgs = configService.get("goods_share_notify_imgs");
+			String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
 			JSONArray array = JSONArray.fromObject(imgs);
 			int p = (int) (array.size() * Math.random());
 			if (p < array.size()) {
 				shareInfo.setNotifyPicture(array.optString(p));
 			}
-			shareInfo.setNotifyDesc(configService.get("goods_share_notify"));
+			shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotify.getKey()));
 
 			// 娣诲姞鍒嗕韩璁板綍
 			BigDecimal rate = hongBaoManageService.getShareRate();
@@ -521,7 +586,7 @@
 					history.setQuanLink(taobaoLink.getCouponLink());
 					history.setGoodsId(finalGoods.getAuctionId());
 					history.setPostPicture(finalGoods.getPictUrl());
-
+					history.setShareImg(taobaoLink.getClickUrl());
 					List<String> imgList = finalGoods.getImgList();
 					if (imgList == null) {
 						imgList = new ArrayList<>();
@@ -549,10 +614,11 @@
 	 * @param request
 	 * @param out
 	 */
-	public void createJDShare(AcceptData acceptData, Long uid, Long goodsId, String source, PrintWriter out) {
+	public void createJDShare(AcceptData acceptData, Long uid, Long goodsId, String source, boolean needGoods,
+			PrintWriter out) {
 		JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsId);
 		if (jdGoods == null) {
-			out.print(JsonUtil.loadFalseResult(1, "璇ュ晢鍝佹窐宸蹭笅鏋�"));
+			out.print(JsonUtil.loadFalseResult(1, "璇ュ晢鍝佸凡涓嬫灦"));
 			return;
 		}
 
@@ -563,17 +629,24 @@
 		// goodsId + "");
 
 		String couponUrl = null;
-		JDCouponInfo couponInfo = jdGoods.getCouponInfo();
+		JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods);
 		if (couponInfo != null) {
 			couponUrl = couponInfo.getLink();
 		}
 		String materialId = "https://item.jd.com/" + goodsId + ".html";
-		String jumpLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + "");
+		String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
+				uid + "");
 
 		ShareInfoVO shareInfo = new ShareInfoVO();
 		shareInfo.setClickUrl(jumpLink);
-		shareInfo.setRule(configService.get("share_rule_link_jd"));
+		shareInfo.setWxErCode(jumpLink);
+		shareInfo.setRule(configService.get(ConfigKeyEnum.shareRuleLinkJD.getKey()));
 		shareInfo.setPictUrl(jdGoods.getPicUrl());
+		shareInfo.setCommentTexts(new ArrayList<>());
+
+		if (needGoods)
+			shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
+					hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
 
 		String shareText = "";
 		boolean hasCoupon = false;
@@ -585,14 +658,14 @@
 				shareText = textTemplate.getShareJDTextTemplate();
 
 			if (StringUtil.isNullOrEmpty(shareText))
-				shareText = configService.get("goods_share_text_nocoupon_jd");
+				shareText = configService.get(ConfigKeyEnum.goodsShareTextNoCouponJD.getKey());
 		} else { // 鏈夊埜妯℃澘
 			hasCoupon = true;
 			if (textTemplate != null)
 				shareText = textTemplate.getShareJDTextTemplateCoupon();
 
 			if (StringUtil.isNullOrEmpty(shareText))
-				shareText = configService.get("goods_share_text_coupon_jd");
+				shareText = configService.get(ConfigKeyEnum.goodsShareTextCouponJD.getKey());
 		}
 		shareText = shareGoodsTextTemplateService.createContentByTemplateJD(shareText, uid, jdGoods, jumpLink,
 				hasCoupon);
@@ -604,13 +677,13 @@
 		}
 		shareInfo.setDescText(descText);
 
-		String imgs = configService.get("goods_share_notify_imgs");
+		String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
 		JSONArray array = JSONArray.fromObject(imgs);
 		int p = (int) (array.size() * Math.random());
 		if (p < array.size()) {
 			shareInfo.setNotifyPicture(array.optString(p));
 		}
-		shareInfo.setNotifyDesc(configService.get("goods_share_notify_jd"));
+		shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotifyJD.getKey()));
 
 		// 娣诲姞鍒嗕韩璁板綍
 		BigDecimal shareRate = hongBaoManageService.getShareRate();
@@ -627,7 +700,8 @@
 				e1.printStackTrace();
 			}
 		}
-		out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
+		out.print(JsonUtil.loadTrueResult(
+				JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
 
 		// 寮傛鎿嶄綔
 		final JDGoods goods = jdGoods;
@@ -645,7 +719,8 @@
 				history.setQuanLink(null);
 				history.setGoodsId(goodsId);
 				history.setPostPicture(goods.getPicUrl());
-
+				history.setShareImg(jumpLink);
+				
 				List<String> imgList = goods.getImageList();
 				if (imgList == null) {
 					imgList = new ArrayList<>();
@@ -665,7 +740,8 @@
 	 * @param source
 	 * @param out
 	 */
-	public void createPDDShare(AcceptData acceptData, Long uid, Long goodsId, String source, PrintWriter out) {
+	public void createPDDShare(AcceptData acceptData, Long uid, Long goodsId, String source, boolean needGoods,
+			PrintWriter out) {
 		PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId);
 		if (goods == null) {
 			out.print(JsonUtil.loadFalseResult(1, "璇ュ晢鍝佸凡涓嬫灦"));
@@ -682,8 +758,17 @@
 
 		ShareInfoVO shareInfo = new ShareInfoVO();
 		shareInfo.setClickUrl(jumpLink);
-		shareInfo.setRule(configService.get("share_rule_link_pdd"));
+		shareInfo.setWxErCode(jumpLink);
+		shareInfo.setCommentTexts(new ArrayList<>());
+		shareInfo.setRule(configService.get(ConfigKeyEnum.shareRuleLinkPDD.getKey()));
 		shareInfo.setPictUrl(goods.getGoodsImageUrl());
+		if (needGoods) {
+			shareInfo
+					.setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods,
+							new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
+									hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
+									hongBaoManageService.getVIPFanLiRate())));
+		}
 
 		String template = "";
 		boolean hasCoupon = false;
@@ -693,14 +778,14 @@
 				template = textTemplate.getSharePDDTextTemplate();
 
 			if (StringUtil.isNullOrEmpty(template))
-				template = configService.get("goods_share_text_nocoupon_pdd");
+				template = configService.get(ConfigKeyEnum.goodsShareTextNocouponPDD.getKey());
 		} else {
 			hasCoupon = true;
 			if (textTemplate != null)
 				template = textTemplate.getSharePDDTextTemplateCoupon();
 
 			if (StringUtil.isNullOrEmpty(template))
-				template = configService.get("goods_share_text_coupon_pdd");
+				template = configService.get(ConfigKeyEnum.goodsShareTextCouponPDD.getKey());
 		}
 
 		// 鍒涘缓鍙d护
@@ -718,13 +803,13 @@
 		shareInfo.setDescText(descText);
 
 		//
-		String imgs = configService.get("goods_share_notify_imgs");
+		String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
 		JSONArray array = JSONArray.fromObject(imgs);
 		int p = (int) (array.size() * Math.random());
 		if (p < array.size()) {
 			shareInfo.setNotifyPicture(array.optString(p));
 		}
-		shareInfo.setNotifyDesc(configService.get("goods_share_notify_pdd"));
+		shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotifyPDD.getKey()));
 
 		// 娣诲姞鍒嗕韩璁板綍
 		BigDecimal shareRate = hongBaoManageService.getShareRate();
@@ -742,7 +827,8 @@
 				e1.printStackTrace();
 			}
 		}
-		out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
+		out.print(JsonUtil.loadTrueResult(
+				JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
 
 		// 寮傛鎿嶄綔
 		com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
@@ -759,7 +845,7 @@
 				history.setQuanLink(null);
 				history.setGoodsId(goodsId);
 				history.setPostPicture(goods.getGoodsImageUrl());
-
+				history.setShareImg(jumpLink);
 				List<String> imgList = null;
 				String[] goodsGalleryUrls = goods.getGoodsGalleryUrls();
 				if (goodsGalleryUrls != null) {
@@ -962,12 +1048,13 @@
 		}
 
 		String couponUrl = null;
-		JDCouponInfo couponInfo = goods.getCouponInfo();
+		JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(goods);
 		if (couponInfo != null) {
 			couponUrl = couponInfo.getLink();
 		}
 		String materialId = "https://item.jd.com/" + goodsId + ".html";
-		String shortLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + "");
+		String shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
+				uid + "");
 
 		String content = shareGoodsTextTemplateService.createContentByTemplateJD(template, uid, goods, shortLink,
 				hasCoupon);
@@ -1060,13 +1147,13 @@
 				} else {
 					template = shareGoodsTextTemplateService.geteCouponTemplate(uid);
 					if (StringUtil.isNullOrEmpty(template))
-						template = configService.get("goods_share_text_coupon");
+						template = configService.get(ConfigKeyEnum.goodsShareTextCoupon.getKey());
 				}
 
 			} else {
 				template = shareGoodsTextTemplateService.getCommonTemplate(uid);
 				if (StringUtil.isNullOrEmpty(template))
-					template = configService.get("goods_share_text_nocoupon");
+					template = configService.get(ConfigKeyEnum.goodsShareTextNoCoupon.getKey());
 			}
 		} else if (goodsType == Constant.SOURCE_TYPE_JD) {
 			ShareGoodsTextTemplate textTemplate = shareGoodsTextTemplateService.getShareGoodsTextTemplate(uid);
@@ -1075,7 +1162,7 @@
 					template = textTemplate.getShareJDTextTemplateCoupon();
 				}
 				if (StringUtil.isNullOrEmpty(template)) {
-					template = configService.get("goods_share_text_coupon_jd");
+					template = configService.get(ConfigKeyEnum.goodsShareTextCouponJD.getKey());
 				}
 			} else {
 				if (textTemplate != null) {
@@ -1083,7 +1170,7 @@
 				}
 
 				if (StringUtil.isNullOrEmpty(template)) {
-					template = configService.get("goods_share_text_nocoupon_jd");
+					template = configService.get(ConfigKeyEnum.goodsShareTextNoCouponJD.getKey());
 				}
 			}
 		} else if (goodsType == Constant.SOURCE_TYPE_PDD) {
@@ -1093,7 +1180,7 @@
 					template = textTemplate.getSharePDDTextTemplateCoupon();
 				}
 				if (StringUtil.isNullOrEmpty(template)) {
-					template = configService.get("goods_share_text_coupon_pdd");
+					template = configService.get(ConfigKeyEnum.goodsShareTextCouponPDD.getKey());
 				}
 			} else {
 				if (textTemplate != null) {
@@ -1101,7 +1188,7 @@
 				}
 
 				if (StringUtil.isNullOrEmpty(template)) {
-					template = configService.get("goods_share_text_nocoupon_pdd");
+					template = configService.get(ConfigKeyEnum.goodsShareTextNocouponPDD.getKey());
 				}
 			}
 		}
@@ -1152,12 +1239,12 @@
 				out.print(
 						JsonUtil.loadTrueResult(configTaoLiJinService.getValueByKey("share_goods_rules", new Date())));
 			} else {
-				out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
+				out.print(JsonUtil.loadTrueResult(configService.get(ConfigKeyEnum.shareGoodsTemplateRules.getKey())));
 			}
 		} else if (goodsType == Constant.SOURCE_TYPE_JD) {
-			out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules_jd")));
+			out.print(JsonUtil.loadTrueResult(configService.get(ConfigKeyEnum.shareGoodsTemplateRulesJD.getKey())));
 		} else if (goodsType == Constant.SOURCE_TYPE_PDD) {
-			out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules_pdd")));
+			out.print(JsonUtil.loadTrueResult(configService.get(ConfigKeyEnum.shareGoodsTemplateRulesPDD.getKey())));
 		}
 	}
 
@@ -1330,9 +1417,8 @@
 			}
 		}
 
-		BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-		BigDecimal shareRate = hongBaoManageService.getShareRate();
-	    ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
+		ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+				acceptData.getVersion());
 
 		Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 				.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();

--
Gitblit v1.8.0