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:
@@ -43,6 +43,7 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@@ -315,6 +316,14 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
||||
// 需要计费的时间
|
||||
BigDecimal time = totalOccupyTime.subtract(totalFreeTime);
|
||||
resultAmount = time.multiply(occupyFee);
|
||||
BigDecimal maxOccupyFee = billingTemplate.getMaxOccupyFee();
|
||||
if (Objects.isNull(maxOccupyFee)) {
|
||||
maxOccupyFee = new BigDecimal("100");
|
||||
}
|
||||
if (resultAmount.compareTo(maxOccupyFee) > 0) {
|
||||
// 计算出来的费用高于计费模板中设置的最高占桩费用,设置占桩费为计费模板中的费用
|
||||
resultAmount = maxOccupyFee;
|
||||
}
|
||||
log.info("计算占桩订单金额 end:{}", JSON.toJSONString(orderPileOccupy));
|
||||
return resultAmount;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ public class BillingTemplateVO {
|
||||
// 占桩费率(单位:元/分钟)
|
||||
private BigDecimal occupyFee;
|
||||
|
||||
// 最高占桩费用
|
||||
private BigDecimal maxOccupyFee;
|
||||
|
||||
// 停车免费描述
|
||||
private String parkFeeDescribe;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user