改为异步操作

This commit is contained in:
2024-03-25 14:26:13 +08:00
parent 393a60eda5
commit 99c6a584a3

View File

@@ -1067,9 +1067,6 @@ public class OrderService {
memberTransactionRecordService.insertSelective(record);
if (StringUtils.equals(scenarioType, ScenarioEnum.ORDER.getValue())) { // 1-订单支付
// JSONObject json = new JSONObject();
// json.put("paymentId", paymentId);
// json.put("amount", amount);
PaymentInfo paymentInfo = new PaymentInfo();
paymentInfo.setPaymentId(paymentId);
paymentInfo.setAmount(amount.toString());
@@ -1087,7 +1084,13 @@ public class OrderService {
orderPayRecordService.batchInsert(Lists.newArrayList(orderPayRecord));
// 更新冻结金额 支付成功后全部冻结
memberAdapayRecordService.updateFreezeAmount(paymentId, amount);
CompletableFuture.runAsync(() -> {
try {
memberAdapayRecordService.updateFreezeAmount(paymentId, amount);
} catch (Exception e) {
log.error("更新冻结金额 支付成功后全部冻结error", e);
}
});
// 支付订单成功
PayOrderSuccessCallbackDTO callbackDTO = PayOrderSuccessCallbackDTO.builder()