From 5706757a0bcec3318c8c460d34c1827788065d7c Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 12 三月 2025 13:53:47 +0800 Subject: [PATCH] Merge branch 'xizang-changyun' of https://gitee.com/xiaochen991015/xizang --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 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 f50b8d0..7c136f2 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 @@ -31,14 +31,8 @@ import com.ruoyi.common.enums.SubmitStatusEnum; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.system.mapper.TCheckAcceptRecordMapper; -import com.ruoyi.system.model.TBill; -import com.ruoyi.system.model.TCheckAcceptRecord; -import com.ruoyi.system.model.TContract; -import com.ruoyi.system.model.TContractRentType; -import com.ruoyi.system.service.ISysRoleService; -import com.ruoyi.system.service.TBillService; -import com.ruoyi.system.service.TContractRentTypeService; -import com.ruoyi.system.service.TContractService; +import com.ruoyi.system.model.*; +import com.ruoyi.system.service.*; import com.ruoyi.system.task.base.QuartzManager; import com.ruoyi.system.task.base.TimeJobType; import com.ruoyi.system.task.jobs.StateProcessJob; @@ -84,6 +78,7 @@ private final TContractRentTypeService contractRentTypeService; private final TBillService billService; private final TCheckAcceptRecordMapper checkAcceptRecordMapper; + private final THouseService houseService; public static void main(String[] args) { // LocalDate localDate1 = LocalDate.now().withYear(2025).withMonth(4).withDayOfMonth(1); @@ -278,6 +273,12 @@ int submitStatus = status == 0 ? 3 : (status == 1 ? 4 : 5); contractService.updateContractAuditStatus(processParameter.getString("projectId"), submitStatus); TContract contract = contractService.getById(processParameter.getString("projectId")); + // 修改房屋状态 + THouse house = houseService.getById(contract.getHouseId()); + if(Objects.nonNull(house)){ + house.setLeaseStatus("2"); + houseService.updateById(house); + } List<TContractRentType> contractRentTypes = contractRentTypeService.list(); TContractRentType tContractRentType = contractRentTypes.stream().filter(e -> e.getContractId().equals(contract.getId())).findFirst().orElse(null); @@ -339,7 +340,7 @@ break; } // 不需要涨租金的时间段 - long originalDays = Math.abs(ChronoUnit.DAYS.between(contract.getFirstPayTime(), tContractRentType.getChangeTime()))+1; + long originalDays = Math.abs(ChronoUnit.DAYS.between(contract.getFirstPayTime(), tContractRentType.getChangeTime())); originalMoney = originalMoney.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN)) .multiply(new BigDecimal(originalDays)); rentBill.setPayableFeesMoney(contractRentTypeMoney.add(originalMoney)); @@ -387,9 +388,8 @@ if (beforeBill.getEndTime().plusMonths(contract.getPayType().equals("1") ? 1 : contract.getPayType().equals("2") ? 3 : 12).getDayOfMonth() <= 15) { tBill.setPayableFeesTime(contract.getEndTime().toLocalDate()); } else { - tBill.setPayableFeesTime((contract.getPayType().equals("1") ? - beforeBill.getEndTime().plusMonths(1).withDayOfMonth(15).toLocalDate() : contract.getPayType().equals("2") ? - beforeBill.getEndTime().plusMonths(3).withDayOfMonth(15).toLocalDate() : beforeBill.getEndTime().withDayOfMonth(15).plusMonths(12).toLocalDate())); + tBill.setPayableFeesTime((contract.getPayType().equals("1") || contract.getPayType().equals("2")? + beforeBill.getEndTime().plusMonths(1).withDayOfMonth(15).toLocalDate() : beforeBill.getEndTime().withDayOfMonth(15).plusMonths(12).toLocalDate())); } tBill.setContractId(contract.getId()); if (contract.getIsIncreasing()) { @@ -437,7 +437,7 @@ break; } // 不需要涨租金的时间段 - long originalDays = ChronoUnit.DAYS.between(beforeBill.getEndTime(), tContractRentType.getChangeTime()); + long originalDays = ChronoUnit.DAYS.between(tBill.getStartTime(), tContractRentType.getChangeTime()); if (originalDays > 0) { originalMoney = originalMoney.add(contract.getChangeRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN)) .multiply(new BigDecimal(originalDays)); @@ -490,7 +490,7 @@ break; } // 不需要涨租金的时间段 - long originalDays = ChronoUnit.DAYS.between(beforeBill.getEndTime(), tContractRentType.getChangeTime()); + long originalDays = ChronoUnit.DAYS.between(tBill.getStartTime(), tContractRentType.getChangeTime()); System.err.println("不需要长租金时长"+originalDays); if (originalDays > 0) { originalMoney = originalMoney.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN)) @@ -581,7 +581,7 @@ break; } // 不需要涨租金的时间段 - long originalDays = ChronoUnit.DAYS.between(beforeBill.getEndTime(), changeTime); + long originalDays = ChronoUnit.DAYS.between(tBill.getStartTime(), changeTime); if (originalDays > 0) { originalMoney = originalMoney.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN)) .multiply(new BigDecimal(originalDays)); @@ -632,7 +632,7 @@ break; } // 不需要涨租金的时间段 - long originalDays = ChronoUnit.DAYS.between(beforeBill.getEndTime(), tContractRentType.getChangeTime()); + long originalDays = ChronoUnit.DAYS.between(tBill.getStartTime(), tContractRentType.getChangeTime()); if (originalDays > 0) { originalMoney = originalMoney.add(contract.getMonthRent().divide(new BigDecimal(30), 2, BigDecimal.ROUND_DOWN)) .multiply(new BigDecimal(originalDays)).setScale(2,BigDecimal.ROUND_DOWN); -- Gitblit v1.7.1