mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
支付时间取订单支付记录中的值
This commit is contained in:
@@ -1012,4 +1012,21 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
return null; // 或者返回一个默认值
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回多个Date参数中不为null并且时间最大的Date
|
||||
*
|
||||
* @param dates 多个Date类型的参数
|
||||
* @return 参数列表中不为null且时间最大的Date对象
|
||||
*/
|
||||
public static Date getMaxDate(Date... dates) {
|
||||
Date maxDate = null;
|
||||
for (Date date : dates) {
|
||||
if (date != null && (maxDate == null || date.after(maxDate))) {
|
||||
maxDate = date;
|
||||
}
|
||||
}
|
||||
return maxDate;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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-支付宝支付)
|
||||
|
||||
@@ -1716,6 +1716,9 @@
|
||||
<if test="mobileNumber != null and mobileNumber != ''">
|
||||
and t2.mobile_number = #{mobileNumber,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="merchantId != null and merchantId != ''">
|
||||
and t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="stationId != null and stationId != ''">
|
||||
and t1.station_id = #{stationId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
@@ -1731,9 +1734,6 @@
|
||||
<if test="endSettleTime != null and endSettleTime != ''">
|
||||
and t1.settlement_time <![CDATA[ <= ]]> #{endSettleTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="merchantId != null and merchantId != ''">
|
||||
and t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="groupCode != null and groupCode != ''">
|
||||
and t1.group_code = #{groupCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user