From 7619c42bb891691aa61376a5ff48fb0b80c9f7f9 Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期三, 23 十二月 2020 08:55:21 +0800
Subject: [PATCH] 1、费用明细报表新增大计和小计2、费用明细报表新增查询费用项信息sql语句3、车辆收费sql业主名称查询改为模糊查询

---
 service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java b/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
index 92266cc..bd79c11 100644
--- a/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -1,6 +1,7 @@
 package com.java110.report.bmo.reportFeeMonthStatistics.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.fee.FeeDto;
 import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
 import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
@@ -111,13 +112,48 @@
         int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryFeeDetailCount(reportFeeMonthStatisticsDto);
 
         List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
+        //搴旀敹鎬婚噾棰�(澶ц)
+        Double allReceivableAmount = 0.0;
+        //瀹炴敹閲戦(澶ц)
+        Double allReceivedAmount = 0.0;
         if (count > 0) {
             reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryFeeDetail(reportFeeMonthStatisticsDto);
+            List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsList = reportFeeMonthStatisticsInnerServiceSMOImpl.queryAllFeeDetail(reportFeeMonthStatisticsDto);
+            allReceivableAmount = Double.valueOf(reportFeeMonthStatisticsList.get(0).getAllReceivableAmount());
+            allReceivedAmount = Double.valueOf(reportFeeMonthStatisticsList.get(0).getAllReceivedAmount());
         } else {
             reportFeeMonthStatisticsDtos = new ArrayList<>();
         }
 
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
+        //搴旀敹鎬婚噾棰�(灏忚)
+        Double totalReceivableAmount = 0.0;
+        //瀹炴敹鎬婚噾棰�(灏忚)
+        Double totalReceivedAmount = 0.0;
+        List<ReportFeeMonthStatisticsDto> reportList = new ArrayList<>();
+        for (ReportFeeMonthStatisticsDto reportFeeMonthStatistics : reportFeeMonthStatisticsDtos) {
+            //搴旀敹閲戦
+            Double receivableAmount = Double.valueOf(reportFeeMonthStatistics.getReceivableAmount());
+            //瀹炴敹閲戦
+            Double receivedAmount = Double.valueOf(reportFeeMonthStatistics.getReceivedAmount());
+            totalReceivableAmount = totalReceivableAmount + receivableAmount;
+            totalReceivedAmount = totalReceivedAmount + receivedAmount;
+        }
+
+        //鏌ヨ璇ュ皬鍖轰笅鐨勮垂鐢ㄩ」鐩�
+        FeeConfigDto feeConfigDto = new FeeConfigDto();
+        feeConfigDto.setCommunityId(reportFeeMonthStatisticsDto.getCommunityId());
+        List<FeeConfigDto> feeConfigDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
+
+        for (ReportFeeMonthStatisticsDto reportFeeMonthStatistics : reportFeeMonthStatisticsDtos) {
+            reportFeeMonthStatistics.setTotalReceivableAmount(String.format("%.2f", totalReceivableAmount));
+            reportFeeMonthStatistics.setTotalReceivedAmount(String.format("%.2f", totalReceivedAmount));
+            reportFeeMonthStatistics.setAllReceivableAmount(String.format("%.2f", allReceivableAmount));
+            reportFeeMonthStatistics.setAllReceivedAmount(String.format("%.2f", allReceivedAmount));
+            reportFeeMonthStatistics.setFeeConfigDtos(feeConfigDtos);
+            reportList.add(reportFeeMonthStatistics);
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportList);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 

--
Gitblit v1.8.0