| | |
| | | if (dayOfMonth == 1) { |
| | | money = money.add(contract.getMonthRent()); |
| | | } else { |
| | | long allDays = ChronoUnit.DAYS.between(contract.getStartPayTime(), contract.getStartPayTime().with(TemporalAdjusters.lastDayOfMonth())) + 1; |
| | | long allDays = ChronoUnit.DAYS.between(rentBill.getStartTime(), rentBill.getStartTime().with(TemporalAdjusters.lastDayOfMonth())) + 1; |
| | | money =money.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(allDays))); |
| | | } |
| | | // 后续 |
| | |
| | | }else{ |
| | | // LocalDateTime localDateTime = rentBill.getStartTime().plusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); |
| | | LocalDateTime localDateTime = rentBill.getStartTime().with(TemporalAdjusters.lastDayOfMonth()).plusDays(1); |
| | | |
| | | while (true){ |
| | | if (localDateTime.isBefore(rentBill.getEndTime())){ |
| | | localDateTime = localDateTime.plusMonths(1); |