退款回调
This commit is contained in:
parent
5962f66ef0
commit
a7c15a81f9
@ -86,8 +86,8 @@ payment:
|
|||||||
merchant-serial-number: 7873E3E694ADD0368EA3E9FAC929F496EECB8DF9
|
merchant-serial-number: 7873E3E694ADD0368EA3E9FAC929F496EECB8DF9
|
||||||
api-v3-key: 1715147005V3Key20250425174554633
|
api-v3-key: 1715147005V3Key20250425174554633
|
||||||
public-key-id: PUB_KEY_ID_0117151470052025042500331704000601
|
public-key-id: PUB_KEY_ID_0117151470052025042500331704000601
|
||||||
pay-notify_url: http://192.168.101.18:10010/payment/wxPayment/pay-notify
|
pay-notify_url: http://192.168.101.40/payment/wxPayment/notify/pay
|
||||||
refund-notify_url: http://192.168.101.18:10010/payment/wxPayment/refund-notify
|
refund-notify_url: http://192.168.101.40/payment/wxPayment/notify/refund
|
||||||
expire-minutes: 1440
|
expire-minutes: 1440
|
||||||
pay-schedule: 0 0 0/12 * * ?
|
pay-schedule: 0 0 0/12 * * ?
|
||||||
refund-schedule: 0 0/30 * * * ?
|
refund-schedule: 0 0/30 * * * ?
|
||||||
|
|||||||
@ -225,6 +225,14 @@ public class EbikeOrderImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> im
|
|||||||
FeignEbikeUserLockDto data = jsonResult.getData();
|
FeignEbikeUserLockDto data = jsonResult.getData();
|
||||||
// 订单费用计算
|
// 订单费用计算
|
||||||
BigDecimal totalAmount = costCalculation(order.getStartTime(), order.getEndTime(), bikeInfo, data);
|
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.setTotalAmount(totalAmount);
|
||||||
order.setActualAmount(totalAmount);
|
order.setActualAmount(totalAmount);
|
||||||
updateById(order);
|
updateById(order);
|
||||||
@ -367,10 +375,10 @@ public class EbikeOrderImpl extends ServiceImpl<EbikeOrderMapper, EbikeOrder> im
|
|||||||
Integer chargeDurationMinutes = bikeInfo.getChargeDurationMinutes();
|
Integer chargeDurationMinutes = bikeInfo.getChargeDurationMinutes();
|
||||||
// 骑行时长(分钟)
|
// 骑行时长(分钟)
|
||||||
long totalRideMinutes = Duration.between(startTime, endTime).toMinutes();
|
long totalRideMinutes = Duration.between(startTime, endTime).toMinutes();
|
||||||
// 如果骑行时长小于等于免费时长,只收取起步费
|
// 如果骑行时长小于等于免费时长,不收费
|
||||||
BigDecimal baseCost;
|
BigDecimal baseCost;
|
||||||
if (totalRideMinutes <= freeDurationMinutes) {
|
if (totalRideMinutes <= freeDurationMinutes) {
|
||||||
baseCost = baseFee;
|
return BigDecimal.ZERO;
|
||||||
} else {
|
} else {
|
||||||
long chargeableMinutes = totalRideMinutes - freeDurationMinutes;
|
long chargeableMinutes = totalRideMinutes - freeDurationMinutes;
|
||||||
long chargeUnits = (chargeableMinutes + chargeDurationMinutes - 1) / chargeDurationMinutes;
|
long chargeUnits = (chargeableMinutes + chargeDurationMinutes - 1) / chargeDurationMinutes;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user