无关风月
2025-03-26 eb96b1edcb0c4105c527a21b100d466419574310
bug修改
1个文件已修改
32 ■■■■■ 已修改文件
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java
@@ -91,19 +91,21 @@
    private final THouseService houseService;
    public static void main(String[] args) {
        LocalDate localDate1 = LocalDate.now().withYear(2025).withMonth(1).withDayOfMonth(31);
        System.err.println(localDate1.plusMonths(1));
//        LocalDate localDate1 = LocalDate.now().withYear(2025).withMonth(2).withDayOfMonth(10).with;
//        System.err.println(localDate1.plusMonths(1));
////        LocalDate localDate2 = LocalDate.now().withYear(2025).withMonth(4).withDayOfMonth(16);
//        LocalDateTime localDate1 = LocalDateTime.now().withYear(2025).withMonth(4).withDayOfMonth(16);
//        LocalDateTime localDate2 = LocalDateTime.now().withYear(2025).withMonth(10).withDayOfMonth(24);
//
        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 monthValue = LocalDateTime.now().getMonthValue();
//         LocalDateTime.now();
//         LocalDateTime.now();
        System.err.println(LocalDateTime.now().isBefore(LocalDateTime.now()));
//        System.err.println(LocalDateTime.now().isBefore(LocalDateTime.now()));
    }
    @Override
@@ -269,6 +271,7 @@
    }
    /**
     * 业务状态变更
     */
@@ -426,7 +429,7 @@
                            if (dayOfMonth == 1) {
                                money = money.add(contract.getMonthRent());
                            } else {
                                long allDays = ChronoUnit.DAYS.between(contract.getStartPayTime(), contract.getStartPayTime().with(TemporalAdjusters.lastDayOfMonth())) + 1;
                                long allDays = Math.abs(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)));
                            }
                            // 后续
@@ -436,10 +439,13 @@
                            }else{
                                LocalDateTime localDateTime = rentBill.getStartTime().plusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
                                while (true){
                                    if (localDateTime.isBefore(rentBill.getEndTime())){
                                    if (localDateTime.toLocalDate().isBefore(rentBill.getEndTime().toLocalDate())){
                                        money = money.add(contract.getMonthRent());
                                    }else if(localDateTime.toLocalDate().equals(rentBill.getEndTime().toLocalDate())){
                                        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(rentBill.getEndTime(),localDateTime.with(TemporalAdjusters.firstDayOfMonth()))+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());
@@ -977,7 +983,7 @@
                                }
                            }
                            if (originalTime.isBefore(tBill.getEndTime())){
                                long tempOriginal  = ChronoUnit.DAYS.between(originalTime,tBill.getEndTime());
                                long tempOriginal  = ChronoUnit.DAYS.between(originalTime,tBill.getEndTime())+1;
                                originalMoney = originalMoney.add(contract.getChangeRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(tempOriginal)));
                            }
                            tBill.setPayableFeesMoney(originalMoney);