From c48ecad4633a6624fec92e42ecd9eeca488a636c Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 06 三月 2025 13:42:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
index 92617fc..ecc4884 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.basic.PageInfo;
+import com.ruoyi.common.config.SmsProperties;
 import com.ruoyi.common.constant.AmountConstant;
 import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.core.redis.RedisCache;
@@ -251,7 +252,7 @@
             throw new ServiceException("实付金额不能高于于流水可抵扣剩余金额");
         }
         //如果实付金额大于欠费金额
-        if (dto.getAmount().compareTo(bill.getOutstandingMoney())>=0){
+        if (dto.getAmount().compareTo(bill.getOutstandingMoney())>0){
             throw new ServiceException("实付金额不能高于该账单欠费金额");
         }
 
@@ -383,7 +384,7 @@
         int failNum = 0;
         for (String billId : dto.getBillIds()) {
             TBillDto bill = getDetailByBillId(billId);
-            if (bill.getSmsLastTime()!=null
+            if (bill.getSmsLastTime()!=null && bill.getSmsStatus()==1
                     && (System.currentTimeMillis()-bill.getSmsLastTime().getTime()<smsUtil.getPro().getBillSmsDelayPeriod()*60*1000L)){
                 throw new ServiceException("有账单最近一次发送的时间是:"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,bill.getSmsLastTime()));
             }
@@ -412,7 +413,7 @@
         int failNum = 0;
         for (String billId : dto.getBillIds()) {
             TBillDto bill = getDetailByBillId(billId);
-            if (bill.getMailLastTime()!=null
+            if (bill.getMailLastTime()!=null && bill.getMailStatus()==1
                     && (System.currentTimeMillis()-bill.getMailLastTime().getTime()<mailUtil.getPro().getBillMailDelayPeriod()*60*1000L)){
                 throw new ServiceException("有账单最近一次发送的时间是:"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,bill.getMailLastTime()));
             }
@@ -463,7 +464,7 @@
                 throw new ServiceException("实付金额不能高于于流水可抵扣剩余金额");
             }
             //如果实付金额大于欠费金额
-            if (dto.getAmount().compareTo(bill.getOutstandingMoney())>=0){
+            if (dto.getAmount().compareTo(bill.getOutstandingMoney())>0){
                 throw new ServiceException("实付金额不能高于该账单欠费金额");
             }
         }
@@ -500,5 +501,15 @@
         return true;
     }
 
+    @Override
+    public BillStatisticsDto statistics() {
+        BillStatisticsDto dto = new BillStatisticsDto();
+        dto.setRent(getBaseMapper().statisticsAllRent());
+        dto.setNopay(getBaseMapper().statisticsNoPay());
+        dto.setPayed(getBaseMapper().statisticsPayed());
+        dto.setOverdue(getBaseMapper().statisticsOverdue());
+        return dto;
+    }
+
 
 }

--
Gitblit v1.7.1