fix(payment): 同步/关闭记录商户号显式赋值,修复非HTTP场景上下文缺失致mchNo为null

This commit is contained in:
DaxPay Dev
2026-07-05 18:14:27 +08:00
parent 9242f80500
commit 000597fb22
2 changed files with 4 additions and 0 deletions

View File

@@ -117,6 +117,8 @@ public class PayCloseService {
.setClosed(StrUtil.isBlank(errMsg))
.setCloseType(closeType.getCode())
.setErrorMsg(errMsg);
// 商户号显式赋值, 不依赖线程上下文自动填充(异步通知/定时任务等非HTTP场景上下文缺失会导致填充null)
record.setMchNo(trade.getMchNo());
payCloseRecordService.saveRecord(record);
}
}

View File

@@ -214,6 +214,8 @@ public class PaySyncService {
.setAdjust(adjust)
.setErrorCode(syncResult.getSyncErrorCode())
.setErrorMsg(syncResult.getSyncErrorMsg());
// 商户号显式赋值, 不依赖线程上下文自动填充(异步通知/定时任务等非HTTP场景上下文缺失会导致填充null)
record.setMchNo(trade.getMchNo());
paySyncRecordService.saveRecord(record);
}
}