高峰出行日收费规则:优化

This commit is contained in:
attiya 2025-04-27 17:19:17 +08:00
parent ac24106757
commit 7b13ec246b

View File

@ -377,7 +377,7 @@ public class UserOrdersServiceImpl extends ServiceImpl<UserOrdersMapper, EbikeUs
//时长费用计算 //时长费用计算
Character timeDivisionCharging = feignEbikeSysRcostsetDto.getTimeDivisionCharging(); Character timeDivisionCharging = feignEbikeSysRcostsetDto.getTimeDivisionCharging();
BigDecimal decimal = switch (timeDivisionCharging) { BigDecimal decimal = switch (timeDivisionCharging) {
case TIME_SLOT -> timeSlotCostCalculation(list, minutes, userOrders, feignEbikeSysRcostsetDto); case TIME_SLOT -> timeSlotCostCalculation(list, userOrders, feignEbikeSysRcostsetDto);
case WEEK -> weekCostCalculation(list, userOrders, feignEbikeSysRcostsetDto); case WEEK -> weekCostCalculation(list, userOrders, feignEbikeSysRcostsetDto);
default -> defaultCostCalculation(list, userOrders, feignEbikeSysRcostsetDto, userOrders.getOrderId()); default -> defaultCostCalculation(list, userOrders, feignEbikeSysRcostsetDto, userOrders.getOrderId());
}; };
@ -390,12 +390,12 @@ public class UserOrdersServiceImpl extends ServiceImpl<UserOrdersMapper, EbikeUs
/** /**
* 按照特殊时间段计费 * 按照特殊时间段计费
* *
* @param minutes 骑行总分钟 * @param list 订单详细信息列表
* @param userOrders 订单信息 * @param userOrders 订单信息
* @param feignEbikeSysRcostsetDto 计费规则 * @param feignEbikeSysRcostsetDto 计费规则
* @return 计费后总金额 * @return 计费后总金额
*/ */
BigDecimal timeSlotCostCalculation(List<EbikeOrderDetails> list, long minutes, EbikeUserOrders userOrders, ResFeignEbikeSysRcostsetDto feignEbikeSysRcostsetDto) { BigDecimal timeSlotCostCalculation(List<EbikeOrderDetails> list, EbikeUserOrders userOrders, ResFeignEbikeSysRcostsetDto feignEbikeSysRcostsetDto) {
List<ResFeignEbikeSysRcostsetTimePeriodDto> ebikeSysRcostsetTimePeriodDtos = feignEbikeSysRcostsetDto.getEbikeSysRcostsetTimePeriodDtos(); List<ResFeignEbikeSysRcostsetTimePeriodDto> ebikeSysRcostsetTimePeriodDtos = feignEbikeSysRcostsetDto.getEbikeSysRcostsetTimePeriodDtos();
//TODO:时间划分不同自然时间段每一段才判断在高峰时间段内有多长时间收费多少非高峰期多长时间收费多少 //TODO:时间划分不同自然时间段每一段才判断在高峰时间段内有多长时间收费多少非高峰期多长时间收费多少
return new BigDecimal(0); return new BigDecimal(0);