|
@@ -1042,6 +1042,8 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
}
|
|
|
cal.setTime(beginTime);
|
|
|
cal.add(Calendar.MONTH, pac.getDuration());
|
|
|
+ // 查询未支付的当前超级会员套餐购买记录
|
|
|
+ Integer dbHistoryId = vipMapper.getVipHistoryId(userId, packageId);
|
|
|
//userId, packageId, beginTime, endTime, payStatus, payWay, payType, price, userBeans, payTime
|
|
|
VipPayHistoryPo payHistory = new VipPayHistoryPo();
|
|
|
payHistory.setUserId(userId);
|
|
@@ -1053,8 +1055,14 @@ public class RegisterServiceImpl implements RegisterService {
|
|
|
// 线上支付
|
|
|
payHistory.setPayWay(1);
|
|
|
payHistory.setPrice(pac.getPrice());
|
|
|
- // 新增超级会员购买记录
|
|
|
- int id = vipMapper.addPayHistory(payHistory);
|
|
|
+ if (null != dbHistoryId && dbHistoryId > 0) {
|
|
|
+ payHistory.setId(dbHistoryId);
|
|
|
+ // 更新未支付的当前超级会员购买记录
|
|
|
+ vipMapper.updatePayHistory(payHistory);
|
|
|
+ } else {
|
|
|
+ // 新增超级会员购买记录
|
|
|
+ vipMapper.addPayHistory(payHistory);
|
|
|
+ }
|
|
|
if (payHistory.getId() > 0) {
|
|
|
return ResponseJson.success(payHistory.getId());
|
|
|
}
|