From 9392cd85c0c04fac4889b723a79085ad7c911372 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 06 五月 2020 11:14:47 +0800
Subject: [PATCH] 用户申请超级会员发送邮件
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java | 117 +++++++++++++++++++++++++++++++---------------------------
1 files changed, 63 insertions(+), 54 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 0a92bff..6aabcbc 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
@@ -35,6 +35,7 @@
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.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
@@ -55,6 +56,7 @@
import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
+import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
@@ -104,6 +106,9 @@
@Resource
private HongBaoManageService hongBaoManageService;
+
+ @Resource
+ private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
@Resource
private MonitorService monitorService;
@@ -177,7 +182,7 @@
"涓嬭浇閾炬帴锛�" + Constant.YINGYONGBAO_LINK, false, true));
list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "杩斿埄閲戦",
- "杩斿埄閲戦锛毬� " + fanliMoney, false, true));
+ String.format("銆愯仈绯绘垜涓嬭浇APP銆戞渶楂樺彲杩旇繕%s鍏�", fanliMoney + ""), false, true));
return list;
}
@@ -244,8 +249,6 @@
}
}
-
-
public static String getERCodeContentNew(String template, TaoBaoGoodsBrief goods, String token) {
String commentText = template.replace("[鍘熶环]", goods.getZkPrice().toString());
commentText = commentText.replace("[娣樺彛浠", token);
@@ -255,11 +258,11 @@
} else {
commentText = commentText.replace("[鍒稿悗浠穄", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
}
-
- commentText =commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
+
+ commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
return commentText;
}
-
+
/**
* 鍒涘缓娣樺疂鍒嗕韩淇℃伅
*
@@ -494,7 +497,7 @@
TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
- ConfigParamsDTO dto = hongBaoManageService.getShowComputeRate(platform, version);
+ ConfigParamsDTO dto = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version);
GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
shareInfo.setGoodsInfo(goodsInfo);
}
@@ -534,41 +537,44 @@
shareInfo.setCommentTexts(commentTexts);
TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
-
+
boolean coupon = false;
if (!StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
coupon = true;
}
-
+
String template = shareGoodsTextTemplateService.getTextTemplateByTB(uid);
- String shareText = shareGoodsTextTemplateService.createContentTB(template, goods, taoBaoLink.getTaoToken(), coupon);
+ String shareText = shareGoodsTextTemplateService.createContentTB(template, goods, taoBaoLink.getTaoToken(),
+ coupon);
shareInfo.setShareText(shareText);
-
+
String descText = shareText.replace(taoBaoLink.getGoods().getTitle(), "").trim();
if (descText.startsWith("\\r\\n")) {
descText = descText.substring(0);
}
shareInfo.setDescText(deleteBlankLine(descText));
-
+
// 娴嬭瘯
// 2.0.2涔嬪墠
if (VersionUtil.greaterThan_2_0_7(platform, version)) {
- shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()),
- taoBaoLink.getGoods(), shareInfo.getToken()));
+ shareInfo.setClickUrl(
+ getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()),
+ taoBaoLink.getGoods(), shareInfo.getToken()));
} else if (!VersionUtil.greaterThan_2_0_2(platform, version)) {
- shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
- taoBaoLink.getGoods(), shareInfo.getToken()));
+ shareInfo.setClickUrl(
+ getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
+ taoBaoLink.getGoods(), shareInfo.getToken()));
}
- if (VersionUtil.greaterThan_2_0_7(platform, version)) {
- shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()),
+ // if (VersionUtil.greaterThan_2_0_7(platform, version)) {
+ // shareInfo.setWxErCode(
+ // getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()),
+ // taoBaoLink.getGoods(), shareInfo.getToken()));
+ // } else {
+ shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
taoBaoLink.getGoods(), shareInfo.getToken()));
- } else {
- shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
- taoBaoLink.getGoods(), shareInfo.getToken()));
- }
-
-
+ // }
+
// 鎻愮ず鍥炬枃鍐呭
String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), platform,
Integer.parseInt(version));
@@ -600,7 +606,7 @@
e1.printStackTrace();
}
}
-
+
String commentText = "";
String recommendText = "";
if (VersionUtil.greaterThan_2_0_7(platform, version)) {
@@ -609,9 +615,13 @@
if (!coupon) {
recommendText = recommendText.replace("鎺ㄨ崘鐞嗙敱:[鎺ㄨ崘璇璢", "");
} else {
- recommendText = recommendText.replace("[鎺ㄨ崘璇璢", goods.getDescription());
+ if (!StringUtil.isNullOrEmpty(goods.getDescription())) {
+ recommendText = recommendText.replace("[鎺ㄨ崘璇璢", goods.getDescription());
+ } else {
+ recommendText = recommendText.replace("鎺ㄨ崘鐞嗙敱:[鎺ㄨ崘璇璢", "");
+ }
}
-
+
String sales = TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day());
if (sales.equals("0")) {
recommendText = recommendText.replace("閿�閲�:[閿�閲廬", "");
@@ -629,8 +639,7 @@
commentText = commentText.replace("[鍒稿悗浠穄",
TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
}
-
-
+
if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
recommendText = recommendText.replace("浼樻儬鍒�:[鍒搁潰棰漖鍏�", "");
} else {
@@ -646,7 +655,7 @@
// 璁剧疆璇勮鏂囨湰閫夐」
shareInfo.setCommentTextChoiceList(getCommentChoiceList(shareInfo.getCommentText(), null, inviteCode,
- TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate())));
+ TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
out.print(JsonUtil.loadTrueResult(
JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -726,13 +735,13 @@
if (needGoods)
shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
- hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
+ orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
boolean hasCoupon = false;
if (couponInfo != null) {
hasCoupon = true;
}
-
+
String template = shareGoodsTextTemplateService.getTextTemplateByJD(uid);
String shareText = shareGoodsTextTemplateService.createContentJD(template, jdGoods, jumpLink, hasCoupon);
shareInfo.setShareText(shareText);
@@ -786,13 +795,13 @@
} else {
recommendText = recommendText.replace("[閿�閲廬", sales.replace("涓�", "w"));
}
-
+
BigDecimal price = jdGoods.getPrice();
JDPingouInfo pinGouInfo = jdGoods.getPinGouInfo();
if (pinGouInfo != null) {
price = pinGouInfo.getPingouPrice();
}
-
+
String template3 = configService.get(ConfigKeyEnum.quickShareJDCommentText.getKey());
commentText = template3.replace("[鍘熶环]", BigDecimalUtil.getWithNoZera(price).toString());
if (!hasCoupon) {
@@ -800,8 +809,10 @@
commentText = commentText.replace("銆愬埜鍚庝环銆慬鍒稿悗浠穄鍏�", "");
commentText = commentText.replace("棰嗗埜鎶㈣喘", "鎶㈣喘");
} else {
- recommendText = recommendText.replace("[鍒搁潰棰漖", BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString());
- commentText = commentText.replace("[鍒稿悗浠穄", BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString());
+ recommendText = recommendText.replace("[鍒搁潰棰漖",
+ BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString());
+ commentText = commentText.replace("[鍒稿悗浠穄",
+ BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString());
}
commentText = commentText.replace("[閾炬帴]", jumpLink);
} else {
@@ -813,7 +824,7 @@
// 璁剧疆璇勮鏂囨湰閫夐」
shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode,
- JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate())));
+ JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
out.print(JsonUtil.loadTrueResult(
JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -845,12 +856,10 @@
}
});
}
-
-
- private String deleteBlankLine(String st){
+
+ private String deleteBlankLine(String st) {
return st.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
}
-
/**
* 鎷煎澶氬垎浜�
@@ -888,16 +897,16 @@
.setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods,
new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
- hongBaoManageService.getVIPFanLiRate())));
+ hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
}
// 鍒涘缓鍙d护
-// String token = PinDuoDuoApiUtil.createGenerate(goodsId);
-
+ // String token = PinDuoDuoApiUtil.createGenerate(goodsId);
+
boolean hasCoupon = true;
if (goods.getHasCoupon() == null || !goods.getHasCoupon()) {
hasCoupon = false;
- }
+ }
String template = shareGoodsTextTemplateService.getTextTemplateByPDD(uid);
String shareText = shareGoodsTextTemplateService.createContentPDD(template, goods, jumpLink, hasCoupon);
shareInfo.setShareText(shareText);
@@ -984,8 +993,8 @@
shareInfo.setCommentText(deleteBlankLine(commentText));
// 璁剧疆璇勮鏂囨湰閫夐」
- shareInfo.setCommentTextChoiceList(getCommentChoiceList(null,shareInfo.getCommentText(), inviteCode,
- PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate())));
+ shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode,
+ PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
out.print(JsonUtil.loadTrueResult(
JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -1101,7 +1110,7 @@
out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
return;
}
-
+
// 鏌ヨ鏄惁鏈夊垎浜�
UserShareGoodsHistory userShareHistory = shareGoodsService.getShareGoodsHistory(uid, goods.getAuctionId());
String token = "";
@@ -1121,7 +1130,7 @@
StringUtil.isNullOrEmpty(goodsLink.getCouponLink()) ? goodsLink.getAuctionUrl()
: goodsLink.getCouponLink());
}
- String content = shareGoodsTextTemplateService.createContentTB(template, goods, token, hasCoupon);
+ String content = shareGoodsTextTemplateService.createContentTB(template, goods, token, hasCoupon);
JSONObject data = new JSONObject();
data.put("content", content);
out.print(JsonUtil.loadTrueResult(data));
@@ -1214,8 +1223,8 @@
String shortLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + "");
-// // 鍒涘缓鍙d护
-// String token = PinDuoDuoApiUtil.createGenerate(goodsId);
+ // // 鍒涘缓鍙d护
+ // String token = PinDuoDuoApiUtil.createGenerate(goodsId);
// 鐢熸垚鍒嗕韩鍐呭
String content = shareGoodsTextTemplateService.createContentPDD(template, goods, shortLink, hasCoupon);
@@ -1423,7 +1432,7 @@
}
}
- ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+ ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
acceptData.getVersion());
Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
@@ -1495,7 +1504,7 @@
}
GoodsDetailVO goodsDetail = null;
- ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+ ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
acceptData.getVersion());
paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
@@ -1530,7 +1539,7 @@
String template = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey());
template = template.replace("[鍟嗗搧鏍囬]", goodsDetail.getTitle()).replace("[閿�閲廬", goodsDetail.getSalesCount());
- if (StringUtil.isNullOrEmpty(goodsDetail.getDescription())) {
+ if (!StringUtil.isNullOrEmpty(goodsDetail.getDescription())) {
template = template.replace("[鎺ㄨ崘璇璢", goodsDetail.getDescription());
} else {
template = template.replace("鎺ㄨ崘璇�:[鎺ㄨ崘璇璢", "");
--
Gitblit v1.8.0