|
@@ -486,25 +486,25 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
if (minutes < 0 || minutes < partConfig.getFreeMinutes()) {
|
|
|
return zero;
|
|
|
}
|
|
|
- BigDecimal extraPrice=partConfig.getExtraPrice();
|
|
|
- BigDecimal basePrice=partConfig.getBasePrice();
|
|
|
+ BigDecimal extraPrice = partConfig.getExtraPrice();
|
|
|
+ BigDecimal basePrice = partConfig.getBasePrice();
|
|
|
BigDecimal uniPrice = basePrice.add(extraPrice);//超过24小时之后每24个小时收费金额
|
|
|
//4.2~9.6
|
|
|
if (carSize <= partConfig.getMildCarLength() && carSize > partConfig.getFreeCarLength()) {
|
|
|
- basePrice=partConfig.getMildCarBasePrice();
|
|
|
+ basePrice = partConfig.getMildCarBasePrice();
|
|
|
uniPrice = basePrice.add(extraPrice);
|
|
|
}
|
|
|
//间隔小时
|
|
|
long hours = ChronoUnit.HOURS.between(inDayTime, outDayTime);
|
|
|
- final int hoursOf24=24;
|
|
|
+ final int hoursOf24 = 24;
|
|
|
//24小时内只用交20或者30元
|
|
|
- if (hours<hoursOf24){
|
|
|
+ if (hours < hoursOf24) {
|
|
|
return basePrice;
|
|
|
}
|
|
|
//24小时个数
|
|
|
- int count=(int) Math.ceil(NumberUtil.div(hours, hoursOf24));
|
|
|
+ long count = hours / hoursOf24;
|
|
|
//超过24小时总停车费
|
|
|
- BigDecimal price=new BigDecimal(count).multiply(uniPrice);
|
|
|
+ BigDecimal price = new BigDecimal(count).multiply(uniPrice);
|
|
|
return price.add(basePrice);
|
|
|
|
|
|
}
|
|
@@ -570,10 +570,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
}
|
|
|
partMoney = this.calculationPartMoney(inTime, now, tbBusinessCar.getCarSize());
|
|
|
}
|
|
|
- if (StrUtil.isNotEmpty(tbBusinessCar.getColor())&&tbBusinessCar.getCarSize()!=null) {
|
|
|
+ if (StrUtil.isNotEmpty(tbBusinessCar.getColor()) && tbBusinessCar.getCarSize() != null) {
|
|
|
String freeColor = partConfig.getFreeColor();
|
|
|
//4.2米以下蓝色车辆
|
|
|
- if (tbBusinessCar.getColor().contains(freeColor)&&tbBusinessCar.getCarSize()<=partConfig.getFreeCarLength()) {
|
|
|
+ if (tbBusinessCar.getColor().contains(freeColor) && tbBusinessCar.getCarSize() <= partConfig.getFreeCarLength()) {
|
|
|
partMoney = new BigDecimal("0");
|
|
|
}
|
|
|
}
|