|
@@ -745,6 +745,10 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
|
*/
|
|
|
@Override
|
|
|
public ResponseJson<JSONObject> payCouponByWeChat(PayCouponDto payCouponDto, HttpHeaders headers) {
|
|
|
+ Integer status = payOrderMapper.findPayStatus(payCouponDto.getCouponRecordId());
|
|
|
+ if (null != status && 1 == status) {
|
|
|
+ return ResponseJson.error("该笔记录已支付,请勿重复支付!", null);
|
|
|
+ }
|
|
|
PayParamBo tempParam = new PayParamBo();
|
|
|
// payDto -> payParam
|
|
|
BeanUtils.copyProperties(payCouponDto, tempParam);
|
|
@@ -757,11 +761,7 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
|
Double price = payOrderMapper.getCouponPrice(payCouponDto.getCouponId());
|
|
|
payParam.setPayAmount(MathUtil.mul(price, 100).intValue());
|
|
|
payParam.setNotifyUrl(couponUrl);
|
|
|
- CouponRecordPo cr = new CouponRecordPo();
|
|
|
- cr.setCouponId(payCouponDto.getCouponId());
|
|
|
- cr.setUserId(payCouponDto.getUserId());
|
|
|
- payOrderMapper.insertCouponRecord(cr);
|
|
|
- payParam.setCouponRecordId(cr.getId());
|
|
|
+ payParam.setCouponRecordId(payCouponDto.getCouponRecordId());
|
|
|
log.info("【购买价值优惠券微信支付】>>>>>>>>>>>couponId:" + payParam.getCouponId() + ",获取openId:" + payParam.getOpenId());
|
|
|
return toPayCoupon(payParam, headers);
|
|
|
}
|
|
@@ -773,6 +773,10 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
|
*/
|
|
|
@Override
|
|
|
public ResponseJson<JSONObject> payCouponByAlipay(PayCouponDto payCouponDto, HttpHeaders headers) {
|
|
|
+ Integer status = payOrderMapper.findPayStatus(payCouponDto.getCouponRecordId());
|
|
|
+ if (null != status && 1 == status) {
|
|
|
+ return ResponseJson.error("该笔记录已支付,请勿重复支付!", null);
|
|
|
+ }
|
|
|
PayParamBo payParam = new PayParamBo();
|
|
|
// payDto -> payParam
|
|
|
BeanUtils.copyProperties(payCouponDto, payParam);
|
|
@@ -783,17 +787,17 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
|
Double price = payOrderMapper.getCouponPrice(payCouponDto.getCouponId());
|
|
|
payParam.setPayAmount(MathUtil.mul(price, 100).intValue());
|
|
|
payParam.setNotifyUrl(couponUrl);
|
|
|
- CouponRecordPo cr = new CouponRecordPo();
|
|
|
- cr.setCouponId(payCouponDto.getCouponId());
|
|
|
- cr.setUserId(payCouponDto.getUserId());
|
|
|
- payOrderMapper.insertCouponRecord(cr);
|
|
|
- payParam.setCouponRecordId(cr.getId());
|
|
|
+ payParam.setCouponRecordId(payCouponDto.getCouponRecordId());
|
|
|
log.info("【购买价值优惠券支付宝支付】>>>>>>>>>>>couponId:" + payParam.getCouponId());
|
|
|
return toPayCoupon(payParam, headers);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public ResponseJson<JSONObject> payCouponUnionPay(PayCouponDto payCouponDto, HttpHeaders headers) {
|
|
|
+ Integer status = payOrderMapper.findPayStatus(payCouponDto.getCouponRecordId());
|
|
|
+ if (null != status && 1 == status) {
|
|
|
+ return ResponseJson.error("该笔记录已支付,请勿重复支付!", null);
|
|
|
+ }
|
|
|
PayParamBo payParam = new PayParamBo();
|
|
|
// payDto -> payParam
|
|
|
BeanUtils.copyProperties(payCouponDto, payParam);
|
|
@@ -807,13 +811,38 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
|
}
|
|
|
payParam.setPayAmount(MathUtil.mul(price, 100).intValue());
|
|
|
payParam.setNotifyUrl(couponUrl);
|
|
|
+ payParam.setCouponRecordId(payCouponDto.getCouponRecordId());
|
|
|
+ log.info("【购买价值优惠券银联线上支付】>>>>>>>>>>>RecordId:" + payCouponDto.getCouponRecordId());
|
|
|
+ return toPayCoupon(payParam, headers);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson<PayCouponDto> getCouponRecord(PayCouponDto payCouponDto, HttpHeaders headers) {
|
|
|
CouponRecordPo cr = new CouponRecordPo();
|
|
|
cr.setCouponId(payCouponDto.getCouponId());
|
|
|
cr.setUserId(payCouponDto.getUserId());
|
|
|
payOrderMapper.insertCouponRecord(cr);
|
|
|
- payParam.setCouponRecordId(cr.getId());
|
|
|
- log.info("【购买价值优惠券银联线上支付】>>>>>>>>>>>RecordId:" + cr.getId());
|
|
|
- return toPayCoupon(payParam, headers);
|
|
|
+ payCouponDto.setCouponRecordId(cr.getId());
|
|
|
+ return ResponseJson.success(payCouponDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson couponCheck(Integer recordId) {
|
|
|
+ Integer status = payOrderMapper.findPayStatus(recordId);
|
|
|
+ if (null != status && 1 == status) {
|
|
|
+ return ResponseJson.success("支付成功", null);
|
|
|
+ }
|
|
|
+ return ResponseJson.error("支付失败", null);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson vipCheck(Integer recordId) {
|
|
|
+ // 获取会员套餐记录
|
|
|
+ VipRecordBo record = payOrderMapper.getVipPackageRecord(recordId);
|
|
|
+ if (null != record.getPayStatus() && 1 == record.getPayStatus()) {
|
|
|
+ return ResponseJson.success("支付成功!", null);
|
|
|
+ }
|
|
|
+ return ResponseJson.error("支付失败", null);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -945,7 +974,7 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
|
// 支付方式
|
|
|
payType = Integer.parseInt(split[3]);
|
|
|
//购买渠道
|
|
|
- source=Integer.parseInt(split[4]);
|
|
|
+ source = Integer.parseInt(split[4]);
|
|
|
} catch (NumberFormatException e) {
|
|
|
log.info("【购买优惠券异步回调】>>>>>>>>>>>>>>获取回调参数解析失败!");
|
|
|
}
|