| | |
| | | // System.err.println(localDate1.plusMonths(1)); |
| | | |
| | | //// LocalDate localDate2 = LocalDate.now().withYear(2025).withMonth(4).withDayOfMonth(16); |
| | | LocalDateTime localDate1 = LocalDateTime.now().withYear(2025).withMonth(2).withDayOfMonth(10).withHour(00).withMinute(00).withSecond(00); |
| | | LocalDateTime localDate2 = LocalDateTime.now().withYear(2025).withMonth(3).withDayOfMonth(31).withHour(00).withMinute(00).withSecond(00); |
| | | LocalDateTime with = localDate1.plusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); |
| | | boolean before = with.isBefore(localDate2); |
| | | System.err.println(before); |
| | | // LocalDateTime localDate1 = LocalDateTime.now().withYear(2025).withMonth(2).withDayOfMonth(10).withHour(00).withMinute(00).withSecond(00); |
| | | // LocalDateTime localDate2 = LocalDateTime.now().withYear(2025).withMonth(3).withDayOfMonth(31).withHour(00).withMinute(00).withSecond(00); |
| | | // LocalDateTime with = localDate1.plusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); |
| | | // boolean before = with.isBefore(localDate2); |
| | | // System.err.println(before); |
| | | // long between = ChronoUnit.DAYS.between(localDate1, localDate2)+1; |
| | | // int monthValue = LocalDateTime.now().getMonthValue(); |
| | | // LocalDateTime.now(); |
| | | // LocalDateTime.now(); |
| | | |
| | | int dayOfMonth = LocalDateTime.now().getMonthValue(); |
| | | System.err.println(dayOfMonth); |
| | | // System.err.println(LocalDateTime.now().isBefore(LocalDateTime.now())); |
| | | } |
| | | |
| | |
| | | money = money.add(contract.getMonthRent()); |
| | | break; |
| | | }else { |
| | | money = money.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(ChronoUnit.DAYS.between(localDateTime.with(TemporalAdjusters.firstDayOfMonth()),rentBill.getEndTime())+1))); |
| | | money = money.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN).multiply( |
| | | new BigDecimal(ChronoUnit.DAYS.between(localDateTime.with(TemporalAdjusters.firstDayOfMonth()),rentBill.getEndTime())+1)) |
| | | ); |
| | | break; |
| | | } |
| | | localDateTime = localDateTime.plusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); |
| | |
| | | tBill.setPayableFeesMoney(originalMoney); |
| | | tBill.setOutstandingMoney(tBill.getPayableFeesMoney()); |
| | | } |
| | | if (tBill.getEndTime().getDayOfMonth() >= 15) { |
| | | // if (tBill.getEndTime().getDayOfMonth() >= 15) { |
| | | // tBill.setPayableFeesTime(tBill.getStartTime().withDayOfMonth(15).toLocalDate()); |
| | | // } else if (tBill.getStartTime().getYear() == tBill.getEndTime().getYear() && tBill.getStartTime().getMonthValue() == tBill.getEndTime().getMonthValue()) { |
| | | // // 如果同年同月 且日小于15 缴费时间取合同 |
| | | // tBill.setPayableFeesTime(tBill.getStartTime().toLocalDate()); |
| | | // } else { |
| | | tBill.setPayableFeesTime(tBill.getStartTime().withDayOfMonth(15).toLocalDate()); |
| | | } else if (tBill.getStartTime().getYear() == tBill.getEndTime().getYear() && tBill.getStartTime().getMonthValue() == tBill.getEndTime().getMonthValue()) { |
| | | // 如果同年同月 且日小于15 缴费时间取合同 |
| | | tBill.setPayableFeesTime(tBill.getStartTime().toLocalDate()); |
| | | } else { |
| | | tBill.setPayableFeesTime(tBill.getStartTime().withDayOfMonth(15).toLocalDate()); |
| | | } |
| | | // } |
| | | billService.save(tBill); |
| | | } |
| | | } |