From 449e10ac595070ebe0d0e18ac61a1ebe742e44c2 Mon Sep 17 00:00:00 2001
From: yupeng <roc__yu@163.com>
Date: 星期五, 28 二月 2025 20:30:52 +0800
Subject: [PATCH] feat: 新增账单统计接口

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 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..896ea36 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
@@ -383,7 +383,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 +412,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()));
             }
@@ -500,5 +500,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