|
@@ -23,7 +23,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
@@ -956,47 +955,6 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
return ResponseJson.success(clubTemporary);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 现金买超级会员回调
|
|
|
- *
|
|
|
- * @param userId
|
|
|
- * @param packageId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- @Override
|
|
|
- public ResponseJson superVipByMoney(Integer userId, Integer packageId) throws ParseException {
|
|
|
-// SuperVipDto endFlag = findEnd(userId);
|
|
|
-// VipPackage pac = vipMapper.findUserPackage(packageId);
|
|
|
-// Calendar cal = Calendar.getInstance();
|
|
|
-// SuperVipPo superVip = new SuperVipPo();
|
|
|
-// //flag=0未买过,-1过期,1有效,endTime过期时间
|
|
|
-// if (endFlag.getVipFlag() == 0) {
|
|
|
-// //svipuser表改生效时间,过期时间
|
|
|
-// Integer duration = pac.getDuration();
|
|
|
-// String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
|
|
-// today += " 00:00:00";
|
|
|
-// today= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(today);
|
|
|
-// Date parse = new SimpleDateFormat("yyyy-MM-dd").parse(today);
|
|
|
-// cal.setTime(parse);
|
|
|
-// Date beginTime = cal.getTime();
|
|
|
-// superVip.setBeginTime(beginTime);
|
|
|
-// superVip.setUpdateTime(beginTime);
|
|
|
-// cal.add(Calendar.MONTH,duration);
|
|
|
-// superVip.setEndTime(cal.getTime());
|
|
|
-// superVip.setUserId(userId);
|
|
|
-// superVip.setDelFlag(0);
|
|
|
-// vipMapper.addVip(superVip);
|
|
|
-// //sviphistory表加入现金买会员历史
|
|
|
-//
|
|
|
-// //cm_discern_receipt加入收款记录
|
|
|
-// }else if(endFlag.getVipFlag() == -1){
|
|
|
-//
|
|
|
-// }else if(endFlag.getVipFlag() == 1){
|
|
|
-//
|
|
|
-// }
|
|
|
- return null;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 采美豆买超级会员
|
|
@@ -1146,7 +1104,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
//新会员开通,开始时间作为历史表的本次购买套餐的开始时间
|
|
|
setHistory(superVip, beginTime);
|
|
|
//发短信
|
|
|
- message = "【采美365】恭喜您成功开通采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。";
|
|
|
+ String shortLink = getShortLink(8, 2, "https://www.caimei365.com/user/member.html?userId=" + userId);
|
|
|
+ message = "恭喜您成功开通采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com/t/" + shortLink + "或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。退订回T";
|
|
|
String mobile = vipMapper.findMobile(userId);
|
|
|
if (mobile != null && mobile != "") {
|
|
|
try {
|
|
@@ -1174,7 +1133,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
//需费时历史记录开始时间为svipuser改变前的终止时间
|
|
|
setHistory(superVip, beginTime);
|
|
|
//发短信
|
|
|
- message = "【采美365】恭喜您成功续费采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。";
|
|
|
+ String shortLink = getShortLink(8, 2, "https://www.caimei365.com/user/member.html?userId=" + userId);
|
|
|
+ message = "恭喜您成功续费采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www-b.caimei365.com/t/" + shortLink + "或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。退订回T";
|
|
|
String mobile = vipMapper.findMobile(userId);
|
|
|
if (mobile != null && mobile != "") {
|
|
|
try {
|
|
@@ -1205,8 +1165,9 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
superVip.setPayWay(4);
|
|
|
//过期再买,历史表开始时间是现在时间/支付时间
|
|
|
setHistory(superVip, beginTime);
|
|
|
- //发短信
|
|
|
- message = "【采美365】恭喜您成功续费采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。";
|
|
|
+ //发短信 "https://www-b.caimei365.com/user/member.html?userId=" + userId
|
|
|
+ String shortLink = getShortLink(8, 2, "https://www.caimei365.com/user/member.html?userId=" + userId);
|
|
|
+ message = "恭喜您成功续费采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com/t/" + shortLink + "或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。退订回T";
|
|
|
String mobile = vipMapper.findMobile(userId);
|
|
|
if (mobile != null && mobile != "") {
|
|
|
try {
|
|
@@ -1282,14 +1243,14 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
-// public String getShortLink(int length, int markId, String url) {
|
|
|
-// String shortLink = RandomCodeGenerator.generateShortLink(length);
|
|
|
-// Integer id = vipMapper.findBYShortLink(shortLink);
|
|
|
-// if (id != null && id > 0) {
|
|
|
-// getShortLink(length, markId, url);
|
|
|
-// }
|
|
|
-// vipMapper.insertShortLink(markId, shortLink, url);
|
|
|
-// return shortLink;
|
|
|
-// }
|
|
|
+ public String getShortLink(int length, int markId, String url) {
|
|
|
+ String shortLink = RandomCodeGenerator.generateShortLink(length);
|
|
|
+ Integer id = vipMapper.findBYShortLink(shortLink);
|
|
|
+ if (id != null && id > 0) {
|
|
|
+ getShortLink(length, markId, url);
|
|
|
+ }
|
|
|
+ vipMapper.insertShortLink(markId, shortLink, url);
|
|
|
+ return shortLink;
|
|
|
+ }
|
|
|
}
|
|
|
|