计算续租金额修复

This commit is contained in:
2025-09-05 01:21:28 +08:00
parent c674cfd940
commit 4ea0b23a44

View File

@ -1129,13 +1129,13 @@ public class OrderServiceImpl implements OrderService {
Integer overdueHours = OrderUtil.getOrderOverdueHours(endRentTime); Integer overdueHours = OrderUtil.getOrderOverdueHours(endRentTime);
rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(overdueHours+1))); rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(overdueHours+1)));
} else if(RentCarTypeEnum.DAILY_RENTAL.getCode().equalsIgnoreCase(rentalType)){ } else if(RentCarTypeEnum.DAILY_RENTAL.getCode().equalsIgnoreCase(rentalType)){
Integer rentalDays = OrderUtil.getOrderExpectedDays(endRentTime); Integer rentalDays = OrderUtil.getOrderOverdueDays(endRentTime);
rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(rentalDays+1))); rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(rentalDays+1)));
} else if(RentCarTypeEnum.DAYS_RENTAL.getCode().equalsIgnoreCase(rentalType)){ } else if(RentCarTypeEnum.DAYS_RENTAL.getCode().equalsIgnoreCase(rentalType)){
Integer rentalDays = OrderUtil.getOrderExpectedDays(endRentTime); Integer rentalDays = OrderUtil.getOrderOverdueDays(endRentTime);
rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(rentalDays+ruleRentalDays))); rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(rentalDays+ruleRentalDays)));
} else { } else {
Integer rentalDays = OrderUtil.getOrderExpectedDays(endRentTime); Integer rentalDays = OrderUtil.getOrderOverdueDays(endRentTime);
rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(rentalDays+30))); rentCarOrderAmount = rentCarOrderAmount.add(rentalPrice.multiply(new BigDecimal(rentalDays+30)));
} }
return rentCarOrderAmount; return rentCarOrderAmount;