|
@@ -980,6 +980,47 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 在线支付开通超级会员
|
|
|
+ *
|
|
|
+ * @param userId
|
|
|
+ * @param packageId
|
|
|
+ * @param headers
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<Integer> superVipUpByPay(Integer userId, Integer packageId, HttpHeaders headers) {
|
|
|
+ SuperVipDto endFlag = findEnd(userId);
|
|
|
+ VipPackage pac = vipMapper.findUserPackage(packageId);
|
|
|
+ if (null == pac) {
|
|
|
+ return ResponseJson.error("超级会员套餐不存在!", null);
|
|
|
+ }
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ Date beginTime = new Date();
|
|
|
+ if (null != endFlag.getVipFlag() && 1 == endFlag.getVipFlag()){
|
|
|
+ // 有效期内续费
|
|
|
+ beginTime = endFlag.getEndTime();
|
|
|
+ }
|
|
|
+ cal.setTime(beginTime);
|
|
|
+ cal.add(Calendar.MONTH, pac.getDuration());
|
|
|
+ //userId, packageId, beginTime, endTime, payStatus, payWay, payType, price, userBeans, payTime
|
|
|
+ VipPayHistoryPo payHistory = new VipPayHistoryPo();
|
|
|
+ payHistory.setUserId(userId);
|
|
|
+ payHistory.setPackageId(packageId);
|
|
|
+ payHistory.setBeginTime(beginTime);
|
|
|
+ payHistory.setEndTime(cal.getTime());
|
|
|
+ // 支付状态 0 未付款 1 已付款
|
|
|
+ payHistory.setPayStatus(0);
|
|
|
+ // 线上支付
|
|
|
+ payHistory.setPayWay(1);
|
|
|
+ payHistory.setPrice(pac.getPrice());
|
|
|
+ // 新增超级会员购买记录
|
|
|
+ int id = vipMapper.addPayHistory(payHistory);
|
|
|
+ if (id > 0) {
|
|
|
+ return ResponseJson.success(id);
|
|
|
+ }
|
|
|
+ return ResponseJson.error("支付开通超级会员异常!", null);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 根据userId查是否过期,返回dto对象,flag=0未买过,-1过期,1有效,endTime过期时间
|
|
@@ -1038,6 +1079,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
//2.超级会员表更改,重买标记是0生效时间就是now
|
|
|
vipMapper.addVip(superVip);
|
|
|
//购买记录表加数据
|
|
|
+ superVip.setPayStatus(1);
|
|
|
+ superVip.setPayWay(4);
|
|
|
setHistory(superVip);
|
|
|
//发短信
|
|
|
message = "【采美365】恭喜您成功开通采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。";
|
|
@@ -1063,6 +1106,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
//vip表改到期时间
|
|
|
vipMapper.updateVip(superVip);
|
|
|
//购买记录表加数据
|
|
|
+ superVip.setPayStatus(1);
|
|
|
+ superVip.setPayWay(4);
|
|
|
setHistory(superVip);
|
|
|
//发短信
|
|
|
message="【采美365】恭喜您成功续费采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。";
|
|
@@ -1091,6 +1136,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
//vip表改到期时间
|
|
|
vipMapper.updateVip(superVip);
|
|
|
//购买记录表加数据
|
|
|
+ superVip.setPayStatus(1);
|
|
|
+ superVip.setPayWay(4);
|
|
|
setHistory(superVip);
|
|
|
//发短信
|
|
|
message="【采美365】恭喜您成功续费采美平台超级会员,为期" + userPackageTime + "个月,快戳采美网站链接 www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。";
|
|
@@ -1115,7 +1162,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
payHistory.setUserId(vip.getUserId());
|
|
|
payHistory.setUserBeans(vip.getPrice() * pac.getProportion());
|
|
|
payHistory.setPayTime(vip.getUpdateTime());
|
|
|
- payHistory.setPayWay(4);
|
|
|
+ payHistory.setPayStatus(vip.getPayStatus());
|
|
|
+ payHistory.setPayWay(vip.getPayWay());
|
|
|
payHistory.setPackageId(vip.getPackageId());
|
|
|
payHistory.setPrice(0.00);
|
|
|
payHistory.setBeginTime(vip.getBeginTime());
|