From f708174b00e73a501dca4eb5ffb23520b4be3f67 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期三, 26 三月 2025 15:45:24 +0800 Subject: [PATCH] Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/xizang into dev --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java index 94a394a..a18f96b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java @@ -301,7 +301,6 @@ } List<TContractRentType> contractRentTypes = contractRentTypeService.list(); TContractRentType tContractRentType = contractRentTypes.stream().filter(e -> e.getContractId().equals(contract.getId())).findFirst().orElse(null); - // 生成第一笔账单 // 第一次应缴费日期 LocalDateTime firstPayTime = contract.getStartTime().plusDays(10).withHour(0).withMinute(0).withSecond(0); @@ -455,7 +454,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 = ChronoUnit.DAYS.between(rentBill.getStartTime(), rentBill.getStartTime().with(TemporalAdjusters.lastDayOfMonth())) ; money =money.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(allDays))); } // 后续 @@ -463,15 +462,16 @@ rentBill.setPayableFeesMoney(money); rentBill.setOutstandingMoney(rentBill.getPayableFeesMoney()); }else{ - LocalDateTime localDateTime = rentBill.getStartTime().plusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); +// 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); money = money.add(contract.getMonthRent()); }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(rentBill.getEndTime(),localDateTime.with(TemporalAdjusters.firstDayOfMonth()))))); break; } - localDateTime = localDateTime.plusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); } rentBill.setPayableFeesMoney(money); rentBill.setOutstandingMoney(rentBill.getPayableFeesMoney()); -- Gitblit v1.7.1