|
@@ -25,6 +25,7 @@ import com.caimei365.order.utils.MathUtil;
|
|
|
import com.caimei365.order.utils.PayUtil;
|
|
|
import com.caimei365.order.utils.helipay.Disguiser;
|
|
|
import com.caimei365.order.utils.helipay.HttpClientService;
|
|
|
+import com.caimei365.order.utils.helipay.MessageHandle;
|
|
|
import com.caimei365.order.utils.helipay.MyBeanUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -206,6 +207,12 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
} catch (NumberFormatException e) {
|
|
|
log.info("【购买优惠券异步回调】>>>>>>>>>>>>>>获取回调参数解析失败!");
|
|
|
}
|
|
|
+ couponPayCheck(source, userId, couponId, recordId, payType, amount, payFormData, mbOrderId, orderRequestNo);
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
+ public void couponPayCheck(Integer source, Integer userId, Integer couponId, Integer recordId, Integer payType,
|
|
|
+ Double amount, String payFormData, String mbOrderId, String orderRequestNo) {
|
|
|
//cm_coupon_club数据库修改
|
|
|
CouponClubPo couponClubPo = new CouponClubPo();
|
|
|
couponClubPo.setSource(source);
|
|
@@ -252,7 +259,6 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
log.info("【购买优惠券异步回调】>>>>>>>>>>>收款项和购买历史关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",couponRecordId:" + recordId);
|
|
|
//修改分账付款状态
|
|
|
payOrderMapper.updateSplitAccountByPay(mbOrderId);
|
|
|
- return "SUCCESS";
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -679,7 +685,7 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
* @param res
|
|
|
*/
|
|
|
@Override
|
|
|
- public String paymentSuperVipCallback(NotifyResponseVo res) throws NoSuchAlgorithmException, InvalidKeySpecException, IntrospectionException, InvocationTargetException, IllegalAccessException {
|
|
|
+ public String paymentSuperVipCallback(NotifyResponseVo res) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
|
|
|
log.info("******************** 升级超级会员异步回调 start *******************");
|
|
|
String sign = res.getSign();
|
|
|
log.info("回调签名" + sign);
|
|
@@ -708,13 +714,13 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
// 附加数据,支付时若有传输则原样返回(vipId,userId,recordId,payType),下单时为空,则不返回该数据
|
|
|
String attach = res.getRt8_desc();
|
|
|
String[] split = attach.split(",");
|
|
|
- int vipId = 0;
|
|
|
+ int packageId = 0;
|
|
|
int userId = 0;
|
|
|
int recordId = 0;
|
|
|
int payType = 0;
|
|
|
try {
|
|
|
// 会员套餐Id
|
|
|
- vipId = Integer.parseInt(split[0]);
|
|
|
+ packageId = Integer.parseInt(split[0]);
|
|
|
// 用户Id
|
|
|
userId = Integer.parseInt(split[1]);
|
|
|
// 购买历史记录Id
|
|
@@ -724,6 +730,12 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
} catch (NumberFormatException e) {
|
|
|
log.info("【升级超级会员异步回调】>>>>>>>>>>>>>>获取回调参数解析失败!");
|
|
|
}
|
|
|
+ superVipStatusCheck(userId, packageId, payType, recordId, amount, payFormData, mbOrderId, orderRequestNo);
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
+ public void superVipStatusCheck(Integer userId, Integer packageId, Integer payType, Integer recordId,
|
|
|
+ Double amount, String payFormData, String mbOrderId, String orderRequestNo) {
|
|
|
//超级会员数据库修改
|
|
|
UserVipPo userVip = new UserVipPo();
|
|
|
UserVipPo dbUserVip = payOrderMapper.getUserVipInfo(userId);
|
|
@@ -739,7 +751,7 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
cal.setTime(beginTime);
|
|
|
// 超级会员套餐时长(月)
|
|
|
- Integer mouth = payOrderMapper.getVipPackageDurationById(vipId);
|
|
|
+ Integer mouth = payOrderMapper.getVipPackageDurationById(packageId);
|
|
|
cal.add(Calendar.MONTH, mouth);
|
|
|
userVip.setEndTime(cal.getTime());
|
|
|
userVip.setDelFlag(0);
|
|
@@ -877,12 +889,11 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
if (smsPushFlag && StringUtils.isNotBlank(bindMobile)) {
|
|
|
String shortLink = remoteCallService.getShortLink(8, 2, "https://www.caimei365.com/user/member.html?userId=" + userId);
|
|
|
String content = "恭喜您成功开通采美平台超级会员,为期" + mouth + "个月,快戳采美网站链接www.caimei365.com/t/" + shortLink + "或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。退订回T";
|
|
|
- boolean sendSms = remoteCallService.getSendSms(3,2, bindMobile, content);
|
|
|
+ boolean sendSms = remoteCallService.getSendSms(3, 2, bindMobile, content);
|
|
|
if (!sendSms) {
|
|
|
log.info("购买会员短信推送失败");
|
|
|
}
|
|
|
}
|
|
|
- return "SUCCESS";
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1064,93 +1075,7 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
} catch (NumberFormatException e) {
|
|
|
log.info("【升级超级会员异步回调】>>>>>>>>>>>>>>获取回调参数解析失败!");
|
|
|
}
|
|
|
- //超级会员数据库修改
|
|
|
- UserVipPo userVip = new UserVipPo();
|
|
|
- UserVipPo dbUserVip = payOrderMapper.getUserVipInfo(userId);
|
|
|
- Date beginTime = new Date();
|
|
|
- if (null != dbUserVip && null != dbUserVip.getEndTime()) {
|
|
|
- // 有效期内续费
|
|
|
- beginTime = dbUserVip.getEndTime();
|
|
|
- userVip.setId(dbUserVip.getId());
|
|
|
- }
|
|
|
- userVip.setUserId(userId);
|
|
|
- userVip.setUpdateTime(new Date());
|
|
|
- userVip.setBeginTime(beginTime);
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- cal.setTime(beginTime);
|
|
|
- // 超级会员套餐时长(月)
|
|
|
- Integer mouth = payOrderMapper.getVipPackageDurationById(vipId);
|
|
|
- cal.add(Calendar.MONTH, mouth);
|
|
|
- userVip.setEndTime(cal.getTime());
|
|
|
- userVip.setDelFlag(0);
|
|
|
- if (null != userVip.getId()) {
|
|
|
- // 更新会员信息
|
|
|
- payOrderMapper.updateUserVipInfo(userVip);
|
|
|
- } else {
|
|
|
- // 新增会员信息
|
|
|
- payOrderMapper.insertUserVipInfo(userVip);
|
|
|
- }
|
|
|
- // 修改会员历史记录支付状态
|
|
|
- VipRecordBo record = payOrderMapper.getVipPackageRecord(recordId);
|
|
|
- record.setPayStatus(1);
|
|
|
- record.setBeginTime(beginTime);
|
|
|
- record.setEndTime(cal.getTime());
|
|
|
- record.setPayWay(1);
|
|
|
- record.setPayType(payType);
|
|
|
- record.setPayTime(new Date());
|
|
|
- payOrderMapper.updateVipPackageRecord(record);
|
|
|
- // 修改支付链接状态
|
|
|
- OrderPayLinkVo orderPayLink = payOrderMapper.getVipPayLink(recordId, amount);
|
|
|
- if (null != orderPayLink && (12 == payType || 17 == payType)) {
|
|
|
- orderPayLink.setPayStatus(1);
|
|
|
- payOrderMapper.updateOrderPayLinkStatus(orderPayLink);
|
|
|
- }
|
|
|
- Date date = new Date();
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- // 保存收款记录
|
|
|
- DiscernReceiptPo discernReceipt = new DiscernReceiptPo();
|
|
|
- discernReceipt.setPayWay(1);
|
|
|
- discernReceipt.setPayType(record.getPayType());
|
|
|
- discernReceipt.setReceiptType(6);
|
|
|
- discernReceipt.setReceiptStatus(3);
|
|
|
- discernReceipt.setReceiptAmount(amount);
|
|
|
- discernReceipt.setConfirmType(4);
|
|
|
- discernReceipt.setRePayFlag(1);
|
|
|
- discernReceipt.setFormData(payFormData);
|
|
|
- discernReceipt.setReceiptDate(curDateStr);
|
|
|
- discernReceipt.setConfirmDate(curDateStr);
|
|
|
- discernReceipt.setReviewDate(curDateStr);
|
|
|
- discernReceipt.setUpdateDate(curDateStr);
|
|
|
- discernReceipt.setDelFlag(0);
|
|
|
- // 保存 收款记录
|
|
|
- baseMapper.insertDiscernReceipt(discernReceipt);
|
|
|
- log.info("【升级超级会员异步回调】>>>>>>>>>>>>>>保存识别款项(insert[cm_discern_receipt])id:" + discernReceipt.getId() + ",vipRecordId:" + recordId);
|
|
|
- // 收款项和订单关系表
|
|
|
- OrderReceiptRelationPo relation = new OrderReceiptRelationPo();
|
|
|
- relation.setReceiptId(discernReceipt.getId());
|
|
|
- relation.setVipRecordId(recordId);
|
|
|
- relation.setAssociateAmount(amount);
|
|
|
- relation.setMbOrderId(mbOrderId);
|
|
|
- relation.setOrderRequestNo(orderRequestNo);
|
|
|
- relation.setSplitStatus(1);
|
|
|
- relation.setRelationType(3);
|
|
|
- relation.setDelFlag(0);
|
|
|
- // 保存 收款项和订单关系
|
|
|
- baseMapper.insertOrderReceiptRelation(relation);
|
|
|
- log.info("【升级超级会员异步回调】>>>>>>>>>>>收款项和购买历史关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",vipRecordId:" + recordId);
|
|
|
- //已支付推送
|
|
|
- boolean smsPushFlag = !orderRequestNo.contains("BETA") && !orderRequestNo.contains("DEV");
|
|
|
- String bindMobile = baseMapper.getBindMobileByUserId(userId);
|
|
|
- if (smsPushFlag && StringUtils.isNotBlank(bindMobile)) {
|
|
|
- String shortLink = remoteCallService.getShortLink(8, 2, "https://www.caimei365.com/user/member.html?userId=" + userId);
|
|
|
- String content = "恭喜您成功开通采美平台超级会员,为期" + mouth + "个月,快戳采美网站链接www.caimei365.com/t/" + shortLink + "或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美365网”可获取更多优惠和精彩资讯。退订回T";
|
|
|
- boolean sendSms = remoteCallService.getSendSms(3,2, bindMobile, content);
|
|
|
- if (!sendSms) {
|
|
|
- log.info("购买会员短信推送失败");
|
|
|
- }
|
|
|
- }
|
|
|
- //修改分账付款状态
|
|
|
- payOrderMapper.updateSplitAccount(mbOrderId, orderRequestNo);
|
|
|
+ superVipStatusCheck(userId, vipId, payType, recordId, amount, payFormData, mbOrderId, orderRequestNo);
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|
|
@@ -1405,52 +1330,7 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
} catch (NumberFormatException e) {
|
|
|
log.info("【购买优惠券异步回调】>>>>>>>>>>>>>>获取回调参数解析失败!");
|
|
|
}
|
|
|
- //cm_coupon_club数据库修改
|
|
|
- CouponClubPo couponClubPo = new CouponClubPo();
|
|
|
- couponClubPo.setSource(source);
|
|
|
- couponClubPo.setUserId(userId);
|
|
|
- couponClubPo.setCouponId(couponId);
|
|
|
- couponClubPo.setStatus("1");
|
|
|
- couponClubPo.setDelFlag("0");
|
|
|
- couponClubPo.setCreateDate(new Date());
|
|
|
- orderClubMapper.insertCouponClub(couponClubPo);
|
|
|
- // 改历史记录支付状态
|
|
|
- payOrderMapper.updateCouponRecord(recordId);
|
|
|
- Date date = new Date();
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- // 保存收款记录
|
|
|
- DiscernReceiptPo discernReceipt = new DiscernReceiptPo();
|
|
|
- discernReceipt.setPayWay(1);
|
|
|
- discernReceipt.setPayType(payType);
|
|
|
- discernReceipt.setReceiptType(8);
|
|
|
- discernReceipt.setReceiptStatus(3);
|
|
|
- discernReceipt.setReceiptAmount(amount);
|
|
|
- discernReceipt.setConfirmType(4);
|
|
|
- discernReceipt.setRePayFlag(1);
|
|
|
- discernReceipt.setFormData(payFormData);
|
|
|
- discernReceipt.setReceiptDate(curDateStr);
|
|
|
- discernReceipt.setConfirmDate(curDateStr);
|
|
|
- discernReceipt.setReviewDate(curDateStr);
|
|
|
- discernReceipt.setUpdateDate(curDateStr);
|
|
|
- discernReceipt.setDelFlag(0);
|
|
|
- // 保存 收款记录
|
|
|
- baseMapper.insertDiscernReceipt(discernReceipt);
|
|
|
- log.info("【购买优惠券异步回调】>>>>>>>>>>>>>>保存识别款项(insert[cm_discern_receipt])id:" + discernReceipt.getId() + ",couponRecordId:" + recordId);
|
|
|
- // 收款项和订单关系表
|
|
|
- OrderReceiptRelationPo relation = new OrderReceiptRelationPo();
|
|
|
- relation.setReceiptId(discernReceipt.getId());
|
|
|
- relation.setCouponRecordId(recordId);
|
|
|
- relation.setAssociateAmount(amount);
|
|
|
- relation.setMbOrderId(mbOrderId);
|
|
|
- relation.setOrderRequestNo(orderRequestNo);
|
|
|
- relation.setSplitStatus(1);
|
|
|
- relation.setRelationType(6);
|
|
|
- relation.setDelFlag(0);
|
|
|
- // 保存 收款项和订单关系
|
|
|
- baseMapper.insertOrderReceiptRelation(relation);
|
|
|
- log.info("【购买优惠券异步回调】>>>>>>>>>>>收款项和购买历史关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",couponRecordId:" + recordId);
|
|
|
- //修改分账付款状态
|
|
|
- payOrderMapper.updateSplitAccount(mbOrderId, orderRequestNo);
|
|
|
+ couponPayCheck(source, userId, couponId, recordId, payType, amount, payFormData, mbOrderId, orderRequestNo);
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|
|
@@ -1732,6 +1612,12 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
} catch (NumberFormatException e) {
|
|
|
log.info("【开通认证通会员异步回调】>>>>>>>>>>>>>>获取回调参数解析失败!");
|
|
|
}
|
|
|
+ authVipStatusCheck(userId, vipId, recordId, payType, amount, payFormData, mbOrderId, orderRequestNo);
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
+ public void authVipStatusCheck(Integer userId, Integer vipId, Integer recordId, Integer payType, Double amount,
|
|
|
+ String payFormData, String mbOrderId, String orderRequestNo) {
|
|
|
//超级会员数据库修改
|
|
|
UserVipPo authVip = new UserVipPo();
|
|
|
UserVipPo dbAuthVip = payOrderMapper.getAuthVipInfo(userId);
|
|
@@ -1820,7 +1706,6 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
log.info("【开通认证通会员异步回调】>>>>>>>>>>>收款项和购买历史关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",vipRecordId:" + recordId);
|
|
|
//修改分账付款状态
|
|
|
payOrderMapper.updateSplitAccountByPay(mbOrderId);
|
|
|
- return "SUCCESS";
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1869,94 +1754,7 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
} catch (NumberFormatException e) {
|
|
|
log.info("【开通认证通会员异步回调】>>>>>>>>>>>>>>获取回调参数解析失败!");
|
|
|
}
|
|
|
- //超级会员数据库修改
|
|
|
- UserVipPo authVip = new UserVipPo();
|
|
|
- UserVipPo dbAuthVip = payOrderMapper.getAuthVipInfo(userId);
|
|
|
- Date beginTime = new Date();
|
|
|
- if (null != dbAuthVip) {
|
|
|
- authVip.setId(dbAuthVip.getId());
|
|
|
- if (dbAuthVip.getEndTime().compareTo(beginTime) > 0) {
|
|
|
- // 有效期内续费,用原结束时间作为开始时间来计算结束时间
|
|
|
- beginTime = dbAuthVip.getEndTime();
|
|
|
- }
|
|
|
- }
|
|
|
- authVip.setUserId(userId);
|
|
|
- authVip.setBeginTime(beginTime);
|
|
|
- authVip.setUpdateTime(new Date());
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- cal.setTime(beginTime);
|
|
|
- // 查询认证通会员套餐信息
|
|
|
- AuthVipPackagePo packagePo = payOrderMapper.getAuthVipPackageById(vipId);
|
|
|
- cal.add(1 == packagePo.getUnit() ? Calendar.MONTH : Calendar.YEAR, packagePo.getDuration());
|
|
|
- authVip.setEndTime(cal.getTime());
|
|
|
- authVip.setDelFlag(0);
|
|
|
- if (null != authVip.getId()) {
|
|
|
- // 更新会员信息
|
|
|
- payOrderMapper.updateAuthVipInfo(authVip);
|
|
|
- if (authVip.getBeginTime().compareTo(beginTime) >= 0) {
|
|
|
- // 删除原有角色关联
|
|
|
- payOrderMapper.deleteAuthVipRoleRelation(userId);
|
|
|
- // 会员过期重新分配角色
|
|
|
- saveRoleRelation(userId, "1");
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 新增会员信息
|
|
|
- payOrderMapper.insertAuthVipInfo(authVip);
|
|
|
- // 删除原有角色关联
|
|
|
- payOrderMapper.deleteAuthVipRoleRelation(userId);
|
|
|
- // 分配角色
|
|
|
- saveRoleRelation(userId, "1");
|
|
|
- }
|
|
|
- // 修改会员历史记录支付状态
|
|
|
- VipRecordBo record = payOrderMapper.getAuthVipRecord(recordId);
|
|
|
- record.setPayStatus(1);
|
|
|
- record.setBeginTime(beginTime);
|
|
|
- record.setEndTime(cal.getTime());
|
|
|
- record.setPayWay(1);
|
|
|
- record.setPayType(payType);
|
|
|
- record.setPayTime(new Date());
|
|
|
- payOrderMapper.updateAuthVipRecord(record);
|
|
|
- // 修改支付链接状态
|
|
|
- OrderPayLinkVo orderPayLink = payOrderMapper.getAuthVipPayLink(recordId, amount);
|
|
|
- if (null != orderPayLink && (12 == payType || 17 == payType)) {
|
|
|
- orderPayLink.setPayStatus(1);
|
|
|
- payOrderMapper.updateOrderPayLinkStatus(orderPayLink);
|
|
|
- }
|
|
|
- Date date = new Date();
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- // 保存收款记录
|
|
|
- DiscernReceiptPo discernReceipt = new DiscernReceiptPo();
|
|
|
- discernReceipt.setPayWay(1);
|
|
|
- discernReceipt.setPayType(record.getPayType());
|
|
|
- discernReceipt.setReceiptType(9);
|
|
|
- discernReceipt.setReceiptStatus(3);
|
|
|
- discernReceipt.setReceiptAmount(amount);
|
|
|
- discernReceipt.setConfirmType(4);
|
|
|
- discernReceipt.setRePayFlag(1);
|
|
|
- discernReceipt.setFormData(payFormData);
|
|
|
- discernReceipt.setReceiptDate(curDateStr);
|
|
|
- discernReceipt.setConfirmDate(curDateStr);
|
|
|
- discernReceipt.setReviewDate(curDateStr);
|
|
|
- discernReceipt.setUpdateDate(curDateStr);
|
|
|
- discernReceipt.setDelFlag(0);
|
|
|
- // 保存 收款记录
|
|
|
- baseMapper.insertDiscernReceipt(discernReceipt);
|
|
|
- log.info("【开通认证通会员异步回调】>>>>>>>>>>>>>>保存识别款项(insert[cm_discern_receipt])id:" + discernReceipt.getId() + ",vipRecordId:" + recordId);
|
|
|
- // 收款项和订单关系表
|
|
|
- OrderReceiptRelationPo relation = new OrderReceiptRelationPo();
|
|
|
- relation.setReceiptId(discernReceipt.getId());
|
|
|
- relation.setAuthVipRecordId(recordId);
|
|
|
- relation.setAssociateAmount(amount);
|
|
|
- relation.setMbOrderId(mbOrderId);
|
|
|
- relation.setOrderRequestNo(orderRequestNo);
|
|
|
- relation.setSplitStatus(1);
|
|
|
- relation.setRelationType(3);
|
|
|
- relation.setDelFlag(0);
|
|
|
- // 保存 收款项和订单关系
|
|
|
- baseMapper.insertOrderReceiptRelation(relation);
|
|
|
- log.info("【开通认证通会员异步回调】>>>>>>>>>>>收款项和购买历史关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",vipRecordId:" + recordId);
|
|
|
- //修改分账付款状态
|
|
|
- payOrderMapper.updateSplitAccountByPay(mbOrderId);
|
|
|
+ authVipStatusCheck(userId, vipId, recordId, payType, amount, payFormData, mbOrderId, orderRequestNo);
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
|
|
@@ -2020,6 +1818,84 @@ public class HeliPayNonOrderServiceImpl implements HeliPayNonOrderService {
|
|
|
return ResponseJson.success("抵扣成功!", null);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String quickCallback(QuickPayConfirmPayResponseVo res) {
|
|
|
+ try {
|
|
|
+ if (MessageHandle.checkSign(res)) {
|
|
|
+ if ("SUCCESS".equals(res.getRt9_orderStatus())) {
|
|
|
+ log.info("快捷支付付款成功============================> res:" + res);
|
|
|
+ /**
|
|
|
+ * 验签通过 查看交易状态码是否成功,是则继续业务逻辑
|
|
|
+ * 保存身份证,银行卡,姓名,银行编码, 合利宝绑定ip 若已经存在,则不保存
|
|
|
+ */
|
|
|
+ checkUnOrderStatus(res);
|
|
|
+ return "SUCCESS";
|
|
|
+ } else {
|
|
|
+ log.info("快捷支付付款状态异常============================> res:" + res);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log.info("快捷支付回调验签失败=========================> res:" + res);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void checkUnOrderStatus(QuickPayConfirmPayResponseVo res) {
|
|
|
+ /**
|
|
|
+ * 超级会员
|
|
|
+ * orderId = "VP" + "_" +record.getPackageId() + "_" + record.getUserId() + "_" + heliDto.getVipRecordId() + "_" + time;
|
|
|
+ * 认证通会员
|
|
|
+ * orderId ="AVP" + "_" + record.getPackageId() + "_" + record.getUserId() + "_" + heliDto.getVipRecordId() + "_" + time;
|
|
|
+ * 优惠券
|
|
|
+ * orderId ="CP" + "_" + heliDto.getCouponId() + "_" + heliDto.getUserId() + "_" + heliDto.getCouponRecordId() + "_" + heliDto.getSource() + "_" + time;
|
|
|
+ */
|
|
|
+ String orderId = res.getRt5_orderId();
|
|
|
+ boolean vp = orderId.startsWith("VP");
|
|
|
+ boolean avp = orderId.startsWith("AVP");
|
|
|
+ boolean cp = orderId.startsWith("CP");
|
|
|
+ String mbOrderId = res.getRt5_orderId();
|
|
|
+ String orderRequestNo = res.getRt6_serialNumber();
|
|
|
+ Double amount = Double.valueOf(res.getRt8_orderAmount());
|
|
|
+ String formData = JSON.toJSONString(res);
|
|
|
+ if (vp) {
|
|
|
+ /**
|
|
|
+ * Integer userId, Integer packageId, Integer payType, Integer recordId,
|
|
|
+ * Double amount, String payFormData, String mbOrderId, String orderRequestNo
|
|
|
+ */
|
|
|
+ String[] s = orderId.split("_");
|
|
|
+ Integer packageId = Integer.valueOf(s[1]);
|
|
|
+ Integer userId = Integer.valueOf(s[2]);
|
|
|
+ Integer recordId = Integer.valueOf(s[3]);
|
|
|
+ superVipStatusCheck(userId, packageId, 28, recordId, amount, formData, mbOrderId, orderRequestNo);
|
|
|
+ } else if (avp) {
|
|
|
+ /**
|
|
|
+ * Integer userId, Integer vipId, Integer recordId, Integer payType, Double amount,
|
|
|
+ * String payFormData, String mbOrderId, String orderRequestNo
|
|
|
+ */
|
|
|
+ String[] s = orderId.split("_");
|
|
|
+ Integer packageId = Integer.valueOf(s[1]);
|
|
|
+ Integer userId = Integer.valueOf(s[2]);
|
|
|
+ Integer recordId = Integer.valueOf(s[3]);
|
|
|
+ authVipStatusCheck(userId, packageId, recordId, 28, amount, formData, mbOrderId, orderRequestNo);
|
|
|
+ } else if (cp) {
|
|
|
+ /**
|
|
|
+ * Integer source, Integer userId, Integer couponId, Integer recordId, Integer payType,
|
|
|
+ * Double amount, String payFormData, String mbOrderId, String orderRequestNo
|
|
|
+ */
|
|
|
+ String[] s = orderId.split("_");
|
|
|
+ Integer userId = Integer.valueOf(s[2]);
|
|
|
+ Integer couponId = Integer.valueOf(s[1]);
|
|
|
+ Integer recordId = Integer.valueOf(s[3]);
|
|
|
+ Integer source = Integer.valueOf(s[4]);
|
|
|
+ couponPayCheck(source, userId, couponId, recordId, 28, amount, formData, mbOrderId, orderRequestNo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public void saveRoleRelation(Integer userId, String roleIds) {
|
|
|
if (StringUtils.isNotEmpty(roleIds)) {
|
|
|
// 设置用户角色
|