|
|
|
|
@@ -283,7 +283,8 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
String payOrderNo = orderInfo.getPlatformType() + IdUtil.getSnowflakeNextId();
|
|
|
|
|
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), shopUser.getId(), "memberIn", payOrderNo,
|
|
|
|
|
"", rechargeDetail.getAmount(), rechargeDetail.getId()));
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.VIP_PAY, paymentId);
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.VIP_PAY, paymentId,
|
|
|
|
|
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
|
|
|
|
|
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, rechargeDetail.getAmount().multiply(MONEY_RATE).longValue(),
|
|
|
|
|
payParam.getPayType(), "充值并支付", "wechatPay".equals(payParam.getPayType()) ? userInfo.getWechatOpenId() : userInfo.getAlipayOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
|
|
|
|
}
|
|
|
|
|
@@ -295,7 +296,8 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
String payOrderNo = orderInfo.getPlatformType() + IdUtil.getSnowflakeNextId();
|
|
|
|
|
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
|
|
|
|
|
"order", payOrderNo, "", orderInfo.getOrderAmount()));
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.H5_PAY, paymentId);
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.H5_PAY, paymentId,
|
|
|
|
|
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
|
|
|
|
|
return h5Pay(payParam.getShopId(), new CzgH5PayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
|
|
|
|
|
"点餐支付", clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
|
|
|
|
}
|
|
|
|
|
@@ -310,7 +312,8 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
String payOrderNo = orderInfo.getPlatformType() + IdUtil.getSnowflakeNextId();
|
|
|
|
|
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
|
|
|
|
|
"order", payOrderNo, "", orderInfo.getOrderAmount()));
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId);
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId,
|
|
|
|
|
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
|
|
|
|
|
return jsPay(payParam.getShopId(), payParam.getPayType(), new CzgJsPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
|
|
|
|
|
"点餐支付", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
|
|
|
|
}
|
|
|
|
|
@@ -333,7 +336,8 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
String payOrderNo = orderInfo.getPlatformType() + IdUtil.getSnowflakeNextId();
|
|
|
|
|
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
|
|
|
|
|
"order", payOrderNo, "", orderInfo.getOrderAmount()));
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId);
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId,
|
|
|
|
|
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
|
|
|
|
|
return jsPay(payParam.getShopId(), payParam.getPayType(), new CzgJsPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
|
|
|
|
|
"点餐支付", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
|
|
|
|
}
|
|
|
|
|
@@ -347,7 +351,8 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
String payOrderNo = orderInfo.getPlatformType() + IdUtil.getSnowflakeNextId();
|
|
|
|
|
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
|
|
|
|
|
"order", payOrderNo, "", orderInfo.getOrderAmount()));
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId);
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), "aliPay".equals(payParam.getPayType()) ? PayEnums.ALIPAY_MINI : PayEnums.WECHAT_MINI, paymentId,
|
|
|
|
|
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
|
|
|
|
|
return ltPay(payParam.getShopId(), payParam.getPayType(), new CzgLtPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
|
|
|
|
|
payParam.getPayType(), "点餐支付", payParam.getOpenId(), clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
|
|
|
|
}
|
|
|
|
|
@@ -369,7 +374,8 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
String payOrderNo = orderInfo.getPlatformType() + IdUtil.getSnowflakeNextId();
|
|
|
|
|
Long paymentId = initOrderPayment(new OrderPayment(payParam.getShopId(), orderInfo.getId(),
|
|
|
|
|
"order", payOrderNo, "", orderInfo.getOrderAmount()));
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.MAIN_SCAN, paymentId);
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.MAIN_SCAN, paymentId,
|
|
|
|
|
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
|
|
|
|
|
return scanPay(payParam.getShopId(), new CzgScanPayReq(payOrderNo, orderInfo.getOrderAmount().multiply(MONEY_RATE).longValue(),
|
|
|
|
|
"点餐支付", clintIp, payParam.getReturnUrl(), payParam.getBuyerRemark(), ""));
|
|
|
|
|
}
|
|
|
|
|
@@ -396,7 +402,8 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
|
|
|
|
LocalDateTime.now(), paymentId, PayEnums.BACK_SCAN);
|
|
|
|
|
} else {
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.BACK_SCAN, paymentId);
|
|
|
|
|
upOrderPayInfo(orderInfo.getId(), PayEnums.BACK_SCAN, paymentId,
|
|
|
|
|
payParam.getCheckOrderPay() == null ? null : payParam.getCheckOrderPay().getRemark());
|
|
|
|
|
}
|
|
|
|
|
return mapCzgResult;
|
|
|
|
|
}
|
|
|
|
|
@@ -835,11 +842,11 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
return payment.getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void upOrderPayInfo(@NonNull Long orderId, @NonNull PayEnums payType, @NotBlank Long paymentId) {
|
|
|
|
|
private void upOrderPayInfo(@NonNull Long orderId, @NonNull PayEnums payType, @NotBlank Long paymentId, String remark) {
|
|
|
|
|
if (paymentId == null) {
|
|
|
|
|
throw new CzgException("未获取到支付记录");
|
|
|
|
|
}
|
|
|
|
|
orderInfoService.updatePayOrderId(orderId, paymentId, payType.getValue());
|
|
|
|
|
orderInfoService.updatePayOrderId(orderId, paymentId, payType.getValue(), remark);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|