|
@@ -96,7 +96,6 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
|
|
|
}
|
|
|
|
|
|
public TbFeeStatistics getByDayAndFeeType(String day, Integer feeType) {
|
|
|
-// TbFeeStatistics Fee = tbFeeStatisticsMapper.getByDayAndFeeType(Day, feeType);
|
|
|
QueryWrapper<TbFeeStatistics> qw = new QueryWrapper<>();
|
|
|
qw.eq("day", day);
|
|
|
qw.eq("fee_type", feeType);
|
|
@@ -114,14 +113,22 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
|
|
|
parkFee = new TbFeeStatistics();
|
|
|
parkFee.setTaxRate(BigDecimal.valueOf(TbFeeStatistics.taxRate.PARK.getValue()));
|
|
|
}
|
|
|
+ BigDecimal totalPrice = BigDecimal.valueOf(0);
|
|
|
+ Integer totalNum = parkFee.getNum();
|
|
|
for (PriceBO bo1 : cars) {
|
|
|
BigDecimal price = bo1.getP();
|
|
|
- TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
|
|
|
- if (car.getMoney().compareTo(new BigDecimal(0)) == 0) {
|
|
|
- parkFee.setNum(parkFee.getNum() + 1);
|
|
|
+ if(price.compareTo(BigDecimal.valueOf(0)) != 0){
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
+ TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
|
|
|
+ if(car.getMoney().compareTo(partConfig.getBasePrice()) == -1 || car.getMoney().compareTo(partConfig.getBasePrice()) == 0){
|
|
|
+ totalNum++;
|
|
|
+ }
|
|
|
}
|
|
|
- parkFee.setTaxMoney(parkFee.getTaxMoney().add(price));
|
|
|
}
|
|
|
+ if(totalPrice.compareTo(BigDecimal.valueOf(0)) == 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ parkFee.setNum(totalNum).setTaxMoney(parkFee.getTaxMoney().add(totalPrice));
|
|
|
BigDecimal taxes = parkFee.getTaxMoney()
|
|
|
.divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()),2, BigDecimal.ROUND_HALF_UP)
|
|
|
.multiply(parkFee.getTaxRate());
|
|
@@ -192,8 +199,9 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
|
|
|
if(StrUtil.isEmpty(business.getCardNo())){
|
|
|
carNo = business.getChinaCarNo();
|
|
|
}
|
|
|
+ TbBusinessCar businessCar = tbBusinessCarService.findByBusinessIdAndCarNo(item.getBusinessId(), carNo);
|
|
|
businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
|
|
|
- .setBusinessItemNo(item.getNo())
|
|
|
+ .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCar.getId()).setBusinessCarNo(businessCar.getNo())
|
|
|
.setCarNo(carNo)
|
|
|
.setItemPrice(item.getItemPrice()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
|
|
|
.setFeeType(feeType)
|