mitao
2025-03-26 901c0f797ef242055a960d8a4f2be71efb2ba453
大屏统计新增
3个文件已修改
47 ■■■■ 已修改文件
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenRentIncomeTrendVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenTopStaticsDataVO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java
@@ -21,6 +21,7 @@
import java.util.Map;
import java.util.Calendar;
import java.util.ArrayList;
import java.util.Objects;
/**
 * @author mitao
@@ -72,6 +73,19 @@
        BigDecimal totalRentShould = currentQuarterBillList.stream().filter(item -> !item.getPayFeesStatus().equals("5"))
                .map(TBill::getPayableFeesMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
        vo.setTotalRentShould(totalRentShould);
        //本季度欠费
        BigDecimal totalRentOwe = currentQuarterBillList.stream()
                .map(TBill::getOutstandingMoney)
                .reduce(BigDecimal.ZERO, BigDecimal::add)
                .divide(BigDecimal.valueOf(10000L), 2, BigDecimal.ROUND_HALF_UP);
        vo.setTotalRentOwe(totalRentOwe);
        //总计欠费
        List<TBill> allBillList = tBillService.lambdaQuery().le(TBill::getPayableFeesTime, last).list();
        BigDecimal totalRentOweAll = allBillList.stream()
                .map(TBill::getOutstandingMoney)
                .reduce(BigDecimal.ZERO, BigDecimal::add)
                .divide(BigDecimal.valueOf(10000L), 2, BigDecimal.ROUND_HALF_UP);
        vo.setTotalRentOweAll(totalRentOweAll);
        return vo;
    }
@@ -92,8 +106,9 @@
        
        // 获取当前日期
        Date currentDate = new Date();
        List<String> quarterLabels = new ArrayList<>();
        List<BigDecimal> incomeData = new ArrayList<>();
        List<String> quarterLabels = new ArrayList<>(); // 季度标签列表
        List<BigDecimal> incomeData = new ArrayList<>(); //收入数据列表
        List<BigDecimal> outstandingData = new ArrayList<>();  // 欠费数据列表
        
        // 获取最近7个季度的数据
        for (int i = 6; i >= 0; i--) {
@@ -103,12 +118,21 @@
            Date quarterStart = quarterDate.get("first");
            Date quarterEnd = quarterDate.get("last");
            
            // 获取该季度的账单数据并计算总和
            BigDecimal quarterIncome = tBillService.lambdaQuery()
            // 获取该季度的账单数据
            List<TBill> quarterBills = tBillService.lambdaQuery()
                .between(TBill::getPayableFeesTime, quarterStart, quarterEnd)
                .list()
                .stream()
                .list();
            // 计算季度租金收入总和
            BigDecimal quarterIncome = quarterBills.stream()
                .map(TBill::getPayFeesMoney)
                .filter(Objects::nonNull)
                .reduce(BigDecimal.ZERO, BigDecimal::add);
            // 计算季度欠费总和
            BigDecimal quarterOutstanding = quarterBills.stream()
                .map(TBill::getOutstandingMoney)
                .filter(Objects::nonNull)
                .reduce(BigDecimal.ZERO, BigDecimal::add);
            
            // 生成季度标签 (格式: YY-MM月)
@@ -120,10 +144,12 @@
            
            quarterLabels.add(label);
            incomeData.add(quarterIncome);
            outstandingData.add(quarterOutstanding);  // 添加欠费数据
        }
        
        vo.setQuarters(quarterLabels);
        vo.setIncomeData(incomeData);
        vo.setOutstandingData(outstandingData);  // 设置欠费数据到VO
        return vo;
    }
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenRentIncomeTrendVO.java
@@ -20,4 +20,7 @@
    @ApiModelProperty("y轴 收入列表")
    private List<BigDecimal> incomeData;
    @ApiModelProperty("y轴 欠费列表")
    private List<BigDecimal> outstandingData;
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScreenTopStaticsDataVO.java
@@ -37,5 +37,11 @@
    @ApiModelProperty("本季度应交租金")
    private BigDecimal totalRentShould;
    @ApiModelProperty("本季度欠费")
    private BigDecimal totalRentOwe;
    @ApiModelProperty("总计欠费")
    private BigDecimal totalRentOweAll;
}