Просмотр исходного кода

费用分项报表新增费用类型和费用项查询;费用分项报表导出新增导出费用类型字段

xiaogang лет назад: 5
Родитель
Сommit
2ea12bb3da

+ 11 - 0
java110-bean/src/main/java/com/java110/dto/reportFeeMonthStatistics/ReportFeeMonthStatisticsDto.java

@@ -74,6 +74,9 @@ public class ReportFeeMonthStatisticsDto extends PageDto implements Serializable
 
     private List<FeeConfigDto> FeeConfigDtos;
 
+    //费用类型
+    private String feeTypeCd;
+
     public String getReceivableAmount() {
         return receivableAmount;
     }
@@ -386,4 +389,12 @@ public class ReportFeeMonthStatisticsDto extends PageDto implements Serializable
     public void setPrimeRate(String primeRate) {
         this.primeRate = primeRate;
     }
+
+    public String getFeeTypeCd() {
+        return feeTypeCd;
+    }
+
+    public void setFeeTypeCd(String feeTypeCd) {
+        this.feeTypeCd = feeTypeCd;
+    }
 }

+ 16 - 7
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml

@@ -438,12 +438,14 @@
     <select id="queryFeeBreakdownCount" parameterType="Map" resultType="Map">
         select count(1) count
         from (
-        select t.fee_name,pfc.start_time
+        select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,pfc.start_time feeCreateTime,t.create_time createTime,SUM(t.receivable_amount)
+        receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
         from report_fee_month_statistics t
         inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
         left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
         left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
         left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+        left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name="pay_fee_config" and td.table_columns="fee_type_cd"
         where t.status_cd = '0'
         <if test="roomNum !=null and roomNum != ''">
             and br.room_num= #{roomNum}
@@ -467,7 +469,7 @@
             and t.fee_id= #{feeId}
         </if>
         <if test="configId !=null and configId != ''">
-            and t.config_id= #{configId}
+            and pfc.config_id= #{configId}
         </if>
         <if test="objId !=null and objId != ''">
             and t.obj_id= #{objId}
@@ -475,6 +477,9 @@
         <if test="feeName !=null and feeName != ''">
             and t.fee_name= #{feeName}
         </if>
+        <if test="feeTypeCd != null and feeTypeCd != ''">
+            and pfc.fee_type_cd = #{feeTypeCd}
+        </if>
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
@@ -490,13 +495,14 @@
 
     <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
     <select id="queryFeeBreakdown" parameterType="Map" resultType="Map">
-        select t.fee_name feeName,pfc.start_time feeCreateTime,t.create_time createTime,SUM(t.receivable_amount)
+        select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,pfc.start_time feeCreateTime,t.create_time createTime,SUM(t.receivable_amount)
         receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
         from report_fee_month_statistics t
         inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
         left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
         left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
         left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+        left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name="pay_fee_config" and td.table_columns="fee_type_cd"
         where t.status_cd = '0'
         <if test="roomNum !=null and roomNum != ''">
             and br.room_num= #{roomNum}
@@ -520,7 +526,7 @@
             and t.fee_id= #{feeId}
         </if>
         <if test="configId !=null and configId != ''">
-            and t.config_id= #{configId}
+            and pfc.config_id= #{configId}
         </if>
         <if test="objId !=null and objId != ''">
             and t.obj_id= #{objId}
@@ -528,6 +534,9 @@
         <if test="feeName !=null and feeName != ''">
             and t.fee_name= #{feeName}
         </if>
+        <if test="feeTypeCd != null and feeTypeCd != ''">
+            and pfc.fee_type_cd = #{feeTypeCd}
+        </if>
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
@@ -851,7 +860,7 @@
             and t.fee_id= #{feeId}
         </if>
         <if test="configId !=null and configId != ''">
-            and t.config_id= #{configId}
+            and pfc.config_id= #{configId}
         </if>
         <if test="objId !=null and objId != ''">
             and t.obj_id= #{objId}
@@ -913,7 +922,7 @@
             and t.fee_id= #{feeId}
         </if>
         <if test="configId !=null and configId != ''">
-            and t.config_id= #{configId}
+            and pfc.config_id= #{configId}
         </if>
         <if test="objId !=null and objId != ''">
             and t.obj_id= #{objId}
@@ -972,7 +981,7 @@
             and t.fee_id= #{feeId}
         </if>
         <if test="configId !=null and configId != ''">
-            and t.config_id= #{configId}
+            and pfc.config_id= #{configId}
         </if>
         <if test="objId !=null and objId != ''">
             and t.obj_id= #{objId}

+ 12 - 10
service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportReportFeeSMOImpl.java

@@ -277,11 +277,12 @@ public class ExportReportFeeSMOImpl extends BaseComponentSMO implements IExportR
         Sheet sheet = workbook.createSheet("费用分项表");
         Row row = sheet.createRow(0);
         row.createCell(0).setCellValue("费用编号");
-        row.createCell(1).setCellValue("费用项");
-        row.createCell(2).setCellValue("费用开始时间");
-        row.createCell(3).setCellValue("应收金额");
-        row.createCell(4).setCellValue("实收金额");
-        row.createCell(5).setCellValue("欠费金额");
+        row.createCell(1).setCellValue("费用类型");
+        row.createCell(2).setCellValue("费用项");
+        row.createCell(3).setCellValue("费用开始时间");
+        row.createCell(4).setCellValue("应收金额");
+        row.createCell(5).setCellValue("实收金额");
+        row.createCell(6).setCellValue("欠费金额");
 
 
         //查询楼栋信息
@@ -292,11 +293,12 @@ public class ExportReportFeeSMOImpl extends BaseComponentSMO implements IExportR
             dataObj = rooms.getJSONObject(roomIndex);
 
             row.createCell(0).setCellValue(roomIndex + 1);
-            row.createCell(1).setCellValue(dataObj.getString("feeName"));
-            row.createCell(2).setCellValue(dataObj.getString("feeCreateTime"));
-            row.createCell(3).setCellValue(dataObj.getString("receivableAmount"));
-            row.createCell(4).setCellValue(dataObj.getString("receivedAmount"));
-            row.createCell(5).setCellValue(dataObj.getString("oweAmount"));
+            row.createCell(1).setCellValue(dataObj.getString("feeTypeCd"));
+            row.createCell(2).setCellValue(dataObj.getString("feeName"));
+            row.createCell(3).setCellValue(dataObj.getString("feeCreateTime"));
+            row.createCell(4).setCellValue(dataObj.getString("receivableAmount"));
+            row.createCell(5).setCellValue(dataObj.getString("receivedAmount"));
+            row.createCell(6).setCellValue(dataObj.getString("oweAmount"));
 
         }
     }

+ 6 - 0
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java

@@ -193,6 +193,8 @@ public class ReportFeeMonthStatisticsApi {
                                                     @RequestParam(value = "unitId", required = false) String unitId,
                                                     @RequestParam(value = "roomId", required = false) String roomId,
                                                     @RequestParam(value = "roomNum", required = false) String roomNum,
+                                                    @RequestParam(value = "configId", required = false) String configId,
+                                                    @RequestParam(value = "feeTypeCd", required = false) String feeTypeCd,
                                                     @RequestParam(value = "startTime", required = false) String startTime,
                                                     @RequestParam(value = "endTime", required = false) String endTime,
                                                     @RequestParam(value = "page") int page,
@@ -207,6 +209,8 @@ public class ReportFeeMonthStatisticsApi {
         reportFeeMonthStatisticsDto.setUnitNum(unitNum);
         reportFeeMonthStatisticsDto.setRoomId(roomId);
         reportFeeMonthStatisticsDto.setRoomNum(roomNum);
+        reportFeeMonthStatisticsDto.setConfigId(configId);
+        reportFeeMonthStatisticsDto.setFeeTypeCd(feeTypeCd);
         reportFeeMonthStatisticsDto.setStartTime(startTime);
         reportFeeMonthStatisticsDto.setEndTime(endTime);
         return getReportFeeMonthStatisticsBMOImpl.queryFeeBreakdown(reportFeeMonthStatisticsDto);
@@ -303,6 +307,7 @@ public class ReportFeeMonthStatisticsApi {
                                                     @RequestParam(value = "roomId", required = false) String roomId,
                                                     @RequestParam(value = "roomNum", required = false) String roomNum,
                                                     @RequestParam(value = "primeRate", required = false) String primeRate,
+                                                    @RequestParam(value = "configId", required = false) String configId,
                                                     @RequestParam(value = "startTime", required = false) String startTime,
                                                     @RequestParam(value = "endTime", required = false) String endTime,
                                                     @RequestParam(value = "page") int page,
@@ -318,6 +323,7 @@ public class ReportFeeMonthStatisticsApi {
         reportFeeMonthStatisticsDto.setRoomId(roomId);
         reportFeeMonthStatisticsDto.setRoomNum(roomNum);
         reportFeeMonthStatisticsDto.setPrimeRate(primeRate);
+        reportFeeMonthStatisticsDto.setConfigId(configId);
         reportFeeMonthStatisticsDto.setStartTime(startTime);
         reportFeeMonthStatisticsDto.setEndTime(endTime);
         return getReportFeeMonthStatisticsBMOImpl.queryPayFeeDetail(reportFeeMonthStatisticsDto);

+ 18 - 1
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java

@@ -100,7 +100,18 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
             reportFeeMonthStatisticsDtos = new ArrayList<>();
         }
 
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos);
+        //查询该小区下的费用项目
+        FeeConfigDto feeConfigDto = new FeeConfigDto();
+        feeConfigDto.setCommunityId(reportFeeMonthStatisticsDto.getCommunityId());
+        List<FeeConfigDto> feeConfigDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
+
+        List<ReportFeeMonthStatisticsDto> reportList = new ArrayList<>();
+        for (ReportFeeMonthStatisticsDto reportFeeMonthStatistics : reportFeeMonthStatisticsDtos) {
+            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);
 
@@ -188,6 +199,10 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
 
         List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
         List<ReportFeeMonthStatisticsDto> reportList = new ArrayList<>();
+        //查询该小区下的费用项目
+        FeeConfigDto feeConfigDto = new FeeConfigDto();
+        feeConfigDto.setCommunityId(reportFeeMonthStatisticsDto.getCommunityId());
+        List<FeeConfigDto> feeConfigDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
         //应收总金额(大计)
         Double allReceivableAmount = 0.0;
         //实收金额(大计)
@@ -229,6 +244,8 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
                 tmpReportFeeMonthStatisticsDto.setAllReceivableAmount(String.format("%.2f", allReceivableAmount));
                 //实收金额(大计)
                 tmpReportFeeMonthStatisticsDto.setAllReceivedAmount(String.format("%.2f", allReceivedAmount));
+                //费用项目
+                tmpReportFeeMonthStatisticsDto.setFeeConfigDtos(feeConfigDtos);
                 reportList.add(tmpReportFeeMonthStatisticsDto);
             }
         } else {