mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-06 02:50:13 +08:00
字段改名
This commit is contained in:
@@ -767,7 +767,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
throw new BusinessException(ReturnCodeEnum.CODE_REFUND_MEMBER_BALANCE_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_REFUND_MEMBER_BALANCE_ERROR);
|
||||||
}
|
}
|
||||||
// 退款金额 元转分 123
|
// 退款金额 元转分 123
|
||||||
int totalCents = refundAmount.multiply(new BigDecimal(100)).intValue();
|
int refundTotalCents = refundAmount.multiply(new BigDecimal(100)).intValue();
|
||||||
// 查询最近一年余额充值订单
|
// 查询最近一年余额充值订单
|
||||||
List<WxpayCallbackRecord> recordList = wxpayCallbackRecordService.queryBalanceRechargeRecordOfTheLatestYear(dto.getMemberId());
|
List<WxpayCallbackRecord> recordList = wxpayCallbackRecordService.queryBalanceRechargeRecordOfTheLatestYear(dto.getMemberId());
|
||||||
// 也许需要多笔支付订单才够退款
|
// 也许需要多笔支付订单才够退款
|
||||||
@@ -775,7 +775,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
WechatPayRefundRequest request;
|
WechatPayRefundRequest request;
|
||||||
for (WxpayCallbackRecord record : recordList) {
|
for (WxpayCallbackRecord record : recordList) {
|
||||||
int payerTotal = Integer.parseInt(record.getPayerTotal()); // 该笔支付订单的支付金额,单位分
|
int payerTotal = Integer.parseInt(record.getPayerTotal()); // 该笔支付订单的支付金额,单位分
|
||||||
totalCents = totalCents - payerTotal; // 123 - 100
|
refundTotalCents = refundTotalCents - payerTotal; // 123 - 100
|
||||||
request = new WechatPayRefundRequest();
|
request = new WechatPayRefundRequest();
|
||||||
request.setTransaction_id(record.getTransactionId()); // 微信支付单号
|
request.setTransaction_id(record.getTransactionId()); // 微信支付单号
|
||||||
request.setOut_trade_no(record.getOutTradeNo()); // 商户订单号
|
request.setOut_trade_no(record.getOutTradeNo()); // 商户订单号
|
||||||
@@ -783,7 +783,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
request.setNotify_url(WeChatPayParameter.refundNotifyUrl); // 回调接口
|
request.setNotify_url(WeChatPayParameter.refundNotifyUrl); // 回调接口
|
||||||
request.setReason("用户余额退款");
|
request.setReason("用户余额退款");
|
||||||
request.setFunds_account("AVAILABLE");
|
request.setFunds_account("AVAILABLE");
|
||||||
if (totalCents > 0) {
|
if (refundTotalCents > 0) {
|
||||||
// 如果大于0说明,这笔单退完也不够
|
// 如果大于0说明,这笔单退完也不够
|
||||||
WechatPayRefundRequest.Amount amount = new WechatPayRefundRequest.Amount();
|
WechatPayRefundRequest.Amount amount = new WechatPayRefundRequest.Amount();
|
||||||
amount.setRefund(payerTotal); // 退款金额
|
amount.setRefund(payerTotal); // 退款金额
|
||||||
@@ -795,7 +795,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
// 生成退款单号
|
// 生成退款单号
|
||||||
WechatPayRefundRequest.Amount amount = new WechatPayRefundRequest.Amount();
|
WechatPayRefundRequest.Amount amount = new WechatPayRefundRequest.Amount();
|
||||||
// 部分退
|
// 部分退
|
||||||
int i = payerTotal + totalCents;
|
int i = payerTotal + refundTotalCents;
|
||||||
amount.setRefund(i); // 退款金额
|
amount.setRefund(i); // 退款金额
|
||||||
amount.setTotal(payerTotal); // 原订单金额
|
amount.setTotal(payerTotal); // 原订单金额
|
||||||
request.setAmount(amount);
|
request.setAmount(amount);
|
||||||
|
|||||||
Reference in New Issue
Block a user