支付时间取订单支付记录中的值

This commit is contained in:
Guoqs
2024-06-04 14:47:03 +08:00
parent a66e42f768
commit 323965dbbf
3 changed files with 26 additions and 4 deletions

View File

@@ -123,7 +123,12 @@ public class OrderPayRecordServiceImpl implements OrderPayRecordService {
payInfo.setPayAmount(Convert.toStr(orderPayRecord.getPayAmount(), Constants.ZERO));
payInfo.setPayStatus(orderBasicInfo.getPayStatus());
payInfo.setPayTime(DateUtils.formatDateTime(orderBasicInfo.getPayTime()));
// 支付时间取订单支付记录中的值在创建时间和更新事件中取不为null并且最大的注意历史数据有可能两个时间都为null
Date payTime = DateUtils.getMaxDate(orderPayRecord.getCreateTime(), orderPayRecord.getUpdateTime());
if (Objects.isNull(payTime)) {
payTime = orderBasicInfo.getPayTime();
}
payInfo.setPayTime(DateUtils.formatDateTime(payTime));
payInfo.setRefundAmount(Convert.toStr(orderPayRecord.getRefundAmount(), Constants.ZERO));
// 支付方式1-本金余额支付2-赠送余额支付3-白名单支付4-微信支付5-支付宝支付)