mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-24 00:59:43 +08:00
交易分账 重构
This commit is contained in:
@@ -3119,14 +3119,16 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
// 记录支订单付流水
|
// 记录支订单付流水
|
||||||
List<OrderPayRecord> payRecordList = Lists.newArrayList();
|
List<OrderPayRecord> payRecordList = Lists.newArrayList();
|
||||||
for (BalanceDeductionAmountVO balanceDeductionAmountVO : list) {
|
for (BalanceDeductionAmountVO balanceDeductionAmountVO : list) {
|
||||||
|
String paymentId = balanceDeductionAmountVO.getPaymentId();
|
||||||
|
BigDecimal deductionAmount = balanceDeductionAmountVO.getDeductionAmount();
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("paymentId", balanceDeductionAmountVO.getPaymentId());
|
json.put("paymentId", paymentId);
|
||||||
json.put("amount", balanceDeductionAmountVO.getDeductionAmount());
|
json.put("amount", deductionAmount);
|
||||||
// 记录流水
|
// 记录流水
|
||||||
payRecordList.add(OrderPayRecord.builder()
|
payRecordList.add(OrderPayRecord.builder()
|
||||||
.orderCode(orderCode)
|
.orderCode(orderCode)
|
||||||
.payMode(OrderPayRecordEnum.PRINCIPAL_BALANCE_PAYMENT.getValue())
|
.payMode(OrderPayRecordEnum.PRINCIPAL_BALANCE_PAYMENT.getValue())
|
||||||
.payAmount(balanceDeductionAmountVO.getDeductionAmount())
|
.payAmount(deductionAmount)
|
||||||
.acquirer(AcquirerEnum.LOCAL.getValue())
|
.acquirer(AcquirerEnum.LOCAL.getValue())
|
||||||
.deductionRecord(json.toJSONString())
|
.deductionRecord(json.toJSONString())
|
||||||
.createBy(dto.getMemberId())
|
.createBy(dto.getMemberId())
|
||||||
@@ -3135,6 +3137,14 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
// 订单支付流水入库
|
// 订单支付流水入库
|
||||||
if (CollectionUtils.isNotEmpty(payRecordList)) {
|
if (CollectionUtils.isNotEmpty(payRecordList)) {
|
||||||
orderPayRecordService.batchInsert(payRecordList);
|
orderPayRecordService.batchInsert(payRecordList);
|
||||||
|
for (OrderPayRecord record : payRecordList) {
|
||||||
|
String deductionRecord = record.getDeductionRecord();
|
||||||
|
JSONObject jsonObject = JSON.parseObject(deductionRecord);
|
||||||
|
String paymentId = jsonObject.getString("paymentId");
|
||||||
|
BigDecimal amount = jsonObject.getBigDecimal("amount");
|
||||||
|
// 余额支付 临时冻结金额
|
||||||
|
memberAdapayRecordService.updateFreezeAmount(paymentId, amount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 余额支付可以直接调支付回调方法
|
// 余额支付可以直接调支付回调方法
|
||||||
|
|||||||
Reference in New Issue
Block a user