From 985ee7c411ef9ee76120d0acdd588c0c10ddaffb Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 02 四月 2025 20:03:32 +0800
Subject: [PATCH] bug修改

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java   |    1 +
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/THouseServiceImpl.java   |    7 ++++++-
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java |   31 +++++++++++++++++--------------
 ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java                    |    4 ++++
 4 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
index 5e0643f..53c4160 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
@@ -266,6 +266,7 @@
         // 将所有未缴费账单设置未已失效
         List<TBill> tBills = billService.list(new LambdaQueryWrapper<TBill>()
                 .ne(TBill::getPayFeesStatus, 3)
+                        .ne(TBill::getBillType,4)
                 .eq(TBill::getContractId, contract.getId()));
         for (TBill tBill : tBills) {
             tBill.setPayFeesStatus("5");
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java b/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java
index afa3846..31150c5 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java
@@ -100,4 +100,8 @@
     @TableField("bank_name")
     private String bankName;
 
+    @ApiModelProperty(value = "承租人")
+    @TableField("lessee")
+    private String lessee;
+
 }
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 e63cd52..685686b 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
@@ -95,16 +95,17 @@
 //        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()));
     }
 
@@ -445,7 +446,9 @@
                                         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());
@@ -989,14 +992,14 @@
                             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);
                     }
                 }
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/THouseServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/THouseServiceImpl.java
index d6f8b6d..d736b8b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/THouseServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/THouseServiceImpl.java
@@ -50,7 +50,12 @@
                 tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,"2"));
 
             }else{
-                tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,tHouse.getLeaseStatus()));
+                if (tHouse.getLeaseStatus().equals("3")){
+                    tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,tHouse.getLeaseStatus()));
+                }else{
+                    tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,"1"));
+
+                }
             }
 
         }

--
Gitblit v1.7.1