退款回调

This commit is contained in:
yanglei 2025-11-20 17:06:07 +08:00
parent 5962f66ef0
commit a7c15a81f9
2 changed files with 12 additions and 4 deletions

View File

@ -86,8 +86,8 @@ payment:
merchant-serial-number: 7873E3E694ADD0368EA3E9FAC929F496EECB8DF9
api-v3-key: 1715147005V3Key20250425174554633
public-key-id: PUB_KEY_ID_0117151470052025042500331704000601
pay-notify_url: http://192.168.101.18:10010/payment/wxPayment/pay-notify
refund-notify_url: http://192.168.101.18:10010/payment/wxPayment/refund-notify
pay-notify_url: http://192.168.101.40/payment/wxPayment/notify/pay
refund-notify_url: http://192.168.101.40/payment/wxPayment/notify/refund
expire-minutes: 1440
pay-schedule: 0 0 0/12 * * ?
refund-schedule: 0 0/30 * * * ?

View File

@ -225,6 +225,14 @@ public class EbikeOrderImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> im
FeignEbikeUserLockDto data = jsonResult.getData();
// 订单费用计算
BigDecimal totalAmount = costCalculation(order.getStartTime(), order.getEndTime(), bikeInfo, data);
// 费用为0不生成支付订单直接订单已支付返回订单id
if (totalAmount.compareTo(BigDecimal.ZERO) == 0) {
order.setTotalAmount(BigDecimal.ZERO);
order.setActualAmount(BigDecimal.ZERO);
order.setOrderStatus(OrderStatus.PAID);
updateById(order);
return order.getOrderId();
}
order.setTotalAmount(totalAmount);
order.setActualAmount(totalAmount);
updateById(order);
@ -367,10 +375,10 @@ public class EbikeOrderImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> im
Integer chargeDurationMinutes = bikeInfo.getChargeDurationMinutes();
// 骑行时长分钟
long totalRideMinutes = Duration.between(startTime, endTime).toMinutes();
// 如果骑行时长小于等于免费时长只收取起步
// 如果骑行时长小于等于免费时长,不收
BigDecimal baseCost;
if (totalRideMinutes <= freeDurationMinutes) {
baseCost = baseFee;
return BigDecimal.ZERO;
} else {
long chargeableMinutes = totalRideMinutes - freeDurationMinutes;
long chargeUnits = (chargeableMinutes + chargeDurationMinutes - 1) / chargeDurationMinutes;