Parcourir la source

1、导出优化

xiaogang il y a 2 ans
Parent
commit
f6e0243a9e

+ 21 - 18
java110-db/src/main/resources/mapper/report/ReportFeeYearCollectionServiceDaoImplMapper.xml

@@ -1,16 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="reportFeeYearCollectionServiceDaoImpl">
 
     <!-- 保存费用年收费信息 add by wuxw 2018-07-03 -->
     <insert id="saveReportFeeYearCollectionInfo" parameterType="Map">
-        insert into report_fee_year_collection(
-        owner_link,obj_name,owner_id,fee_id,built_up_area,owner_name,config_id,obj_id,fee_name,community_id,collection_id,obj_type
-        ) values (
-        #{ownerLink},#{objName},#{ownerId},#{feeId},#{builtUpArea},#{ownerName},#{configId},#{objId},#{feeName},#{communityId},#{collectionId},#{objType}
-        )
+        insert into report_fee_year_collection(owner_link, obj_name, owner_id, fee_id, built_up_area, owner_name,
+                                               config_id, obj_id, fee_name, community_id, collection_id, obj_type)
+        values (#{ownerLink}, #{objName}, #{ownerId}, #{feeId}, #{builtUpArea}, #{ownerName}, #{configId}, #{objId},
+                #{feeName}, #{communityId}, #{collectionId}, #{objType})
     </insert>
 
     <select id="getReportFeeYearCollectionInfos" parameterType="Map" resultType="Map">
@@ -18,13 +16,17 @@
         objName,t.owner_id,t.owner_id ownerId,t.fee_id,t.fee_id feeId,t.built_up_area,t.built_up_area
         builtUpArea,t.owner_name,t.owner_name ownerName,t.config_id,t.config_id configId,t.obj_id,t.obj_id
         objId,t.fee_name,t.fee_name feeName,t.community_id,t.community_id communityId,t.collection_id,t.collection_id
-        collectionId,t.obj_type,t.obj_type objType,rd.collection_year collectionYear,rd.receivable_amount receivableAmount,
-        rd.relation_year relationYear,rd.received_amount receivedAmount,pfc.fee_type_cd feeTypeCd,td.name feeTypeCdName
+        collectionId,t.obj_type,t.obj_type objType,rd.collection_year collectionYear,rd.receivable_amount
+        receivableAmount,
+        rd.relation_year relationYear,rd.received_amount receivedAmount,pfc.fee_type_cd feeTypeCd,td.name feeTypeCdName,
+        t.collection_id,t.collection_id collectionId
         from report_fee_year_collection t
         inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and rd.community_id = t.community_id
+        left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and
+        rd.community_id = t.community_id
         left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
-        left join t_dict td on td.status_cd = pfc.fee_type_cd and td.table_name = 'pay_fee_config' and td.table_columns = 'fee_type_cd'
+        left join t_dict td on td.status_cd = pfc.fee_type_cd and td.table_name = 'pay_fee_config' and td.table_columns
+        = 'fee_type_cd'
         where 1 = 1 and rd.receivable_amount >= 0 and rd.received_amount >= 0
         <if test="ownerLink !=null and ownerLink != ''">
             and t.owner_link= #{ownerLink}
@@ -77,12 +79,15 @@
         objName,t.owner_id,t.owner_id ownerId,t.fee_id,t.fee_id feeId,t.built_up_area,t.built_up_area
         builtUpArea,t.owner_name,t.owner_name ownerName,t.config_id,t.config_id configId,t.obj_id,t.obj_id
         objId,t.fee_name,t.fee_name feeName,t.community_id,t.community_id communityId,t.collection_id,t.collection_id
-        collectionId,t.obj_type,t.obj_type objType,pfc.fee_type_cd feeTypeCd,td.name feeTypeCdName,t.create_time
+        collectionId,t.obj_type,t.obj_type objType,pfc.fee_type_cd feeTypeCd,td.name feeTypeCdName,t.create_time,
+        t.collection_id,t.collection_id collectionId
         from report_fee_year_collection t
         inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
         left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
-        left join t_dict td on td.status_cd = pfc.fee_type_cd and td.table_name = 'pay_fee_config' and td.table_columns = 'fee_type_cd'
-        left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and rd.community_id = t.community_id
+        left join t_dict td on td.status_cd = pfc.fee_type_cd and td.table_name = 'pay_fee_config' and td.table_columns
+        = 'fee_type_cd'
+        left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and
+        rd.community_id = t.community_id
         where 1 = 1 and rd.receivable_amount >= 0 and rd.received_amount >= 0
         <if test="ownerLink !=null and ownerLink != ''">
             and t.owner_link= #{ownerLink}
@@ -174,7 +179,6 @@
         <if test="collectionId !=null and collectionId != ''">
             and t.collection_id= #{collectionId}
         </if>
-
     </update>
 
     <update id="deleteReportFeeYearCollectionInfo" parameterType="Map">
@@ -189,7 +193,6 @@
         <if test="collectionId !=null and collectionId != ''">
             and t.collection_id= #{collectionId}
         </if>
-
     </update>
 
     <!-- 查询费用年收费数量 add by wuxw 2018-07-03 -->
@@ -197,7 +200,8 @@
         select count(DISTINCT t.collection_id) count
         from report_fee_year_collection t
         inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
-        left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and rd.community_id = t.community_id
+        left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and
+        rd.community_id = t.community_id
         left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
         where 1 = 1 and rd.receivable_amount >= 0 and rd.received_amount >= 0
         <if test="ownerLink !=null and ownerLink != ''">
@@ -240,5 +244,4 @@
             and t.obj_type= #{objType}
         </if>
     </select>
-
 </mapper>

+ 1 - 1
service-community/src/main/java/com/java110/community/cmd/ownerRepair/SaveOwnerRepairCmd.java

@@ -167,7 +167,7 @@ public class SaveOwnerRepairCmd extends Cmd {
         feeDto.setState(FeeDto.STATE_DOING);
         //查询报修业主处理中的报修费
         List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
-        //取出开关映射的值(维修师傅未处理最大单数)
+        //取出开关映射的值(报修业主未处理费用条数)
         String repairFeeNumber = MappingCache.getValue(MappingConstant.REPAIR_DOMAIN, REPAIR_FEE_NUMBER);
         if (feeDtos != null && StringUtil.isInteger(repairFeeNumber) && feeDtos.size() >= Integer.parseInt(repairFeeNumber)) {
             ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "该房屋存在" + Integer.parseInt(repairFeeNumber) + "条未处理的费用,请缴费后再进行报修!");

+ 127 - 0
service-job/src/main/java/com/java110/job/export/adapt/ReportCollectFeesAdapt.java

@@ -0,0 +1,127 @@
+package com.java110.job.export.adapt;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.ReportFeeMonthStatisticsPrepaymentDto.ReportFeeMonthStatisticsPrepaymentDto;
+import com.java110.dto.data.ExportDataDto;
+import com.java110.intf.report.IQueryPayFeeDetailInnerServiceSMO;
+import com.java110.job.export.IExportDataAdapt;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 收费状况表导出
+ */
+@Service("reportCollectFees")
+public class ReportCollectFeesAdapt implements IExportDataAdapt {
+
+    @Autowired
+    private IQueryPayFeeDetailInnerServiceSMO queryPayFeeDetailInnerServiceSMOImpl;
+
+    private static final int MAX_ROW = 200;
+
+    @Override
+    public SXSSFWorkbook exportData(ExportDataDto exportDataDto) {
+        SXSSFWorkbook workbook = null;  //工作簿
+        String userId = "";
+        //工作表
+        workbook = new SXSSFWorkbook();
+        workbook.setCompressTempFiles(false);
+        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(6).setCellValue("欠费金额(元)");
+        row.createCell(7).setCellValue("优惠金额(元)");
+        row.createCell(8).setCellValue("减免金额(元)");
+        row.createCell(9).setCellValue("赠送金额(元)");
+        row.createCell(10).setCellValue("滞纳金(元)");
+        row.createCell(11).setCellValue("空置房打折(元)");
+        row.createCell(12).setCellValue("空置房减免(元)");
+        row.createCell(13).setCellValue("收费率");
+        JSONObject reqJson = exportDataDto.getReqJson();
+        ReportFeeMonthStatisticsPrepaymentDto reportFeeMonthStatisticsPrepaymentDto = BeanConvertUtil.covertBean(reqJson, ReportFeeMonthStatisticsPrepaymentDto.class);
+        if (reqJson.containsKey("roomName") && !StringUtil.isEmpty(reqJson.getString("roomName"))) {
+            String[] roomNameArray = reqJson.getString("roomName").split("-", 3);
+            reportFeeMonthStatisticsPrepaymentDto.setFloorNum(roomNameArray[0]);
+            reportFeeMonthStatisticsPrepaymentDto.setUnitNum(roomNameArray[1]);
+            reportFeeMonthStatisticsPrepaymentDto.setRoomNum(roomNameArray[2]);
+        }
+        //查询数据
+        getReportCollectFees(sheet, reportFeeMonthStatisticsPrepaymentDto);
+        return workbook;
+    }
+
+    private void getReportCollectFees(Sheet sheet, ReportFeeMonthStatisticsPrepaymentDto reportFeeMonthStatisticsPrepaymentDto) {
+        reportFeeMonthStatisticsPrepaymentDto.setPage(1);
+        reportFeeMonthStatisticsPrepaymentDto.setRow(MAX_ROW);
+        ResultVo resultVo = queryPayFeeDetailInnerServiceSMOImpl.queryReportCollectFees(reportFeeMonthStatisticsPrepaymentDto);
+        appendData(resultVo, sheet, 0);
+        if (resultVo.getRecords() < 2) {
+            return;
+        }
+        for (int page = 2; page <= resultVo.getRecords(); page++) {
+            reportFeeMonthStatisticsPrepaymentDto.setPage(page);
+            reportFeeMonthStatisticsPrepaymentDto.setRow(MAX_ROW);
+            resultVo = queryPayFeeDetailInnerServiceSMOImpl.queryReportCollectFees(reportFeeMonthStatisticsPrepaymentDto);
+            appendData(resultVo, sheet, (page - 1) * MAX_ROW);
+        }
+    }
+
+    private void appendData(ResultVo resultVo, Sheet sheet, int step) {
+        List<ReportFeeMonthStatisticsPrepaymentDto> reportFeeMonthStatisticsPrepayments = (List<ReportFeeMonthStatisticsPrepaymentDto>) resultVo.getData();
+        Row row = null;
+        JSONObject dataObj = null;
+        for (int roomIndex = 0; roomIndex < reportFeeMonthStatisticsPrepayments.size(); roomIndex++) {
+            row = sheet.createRow(roomIndex + step + 1);
+            dataObj = JSONObject.parseObject(JSONObject.toJSONString(reportFeeMonthStatisticsPrepayments.get(roomIndex)));
+            row.createCell(0).setCellValue(dataObj.getString("feeName"));
+            row.createCell(1).setCellValue(dataObj.getString("feeTypeCdName"));
+            row.createCell(2).setCellValue(dataObj.getString("allPayableAmount"));
+            row.createCell(3).setCellValue(dataObj.getString("allReceivableAmount"));
+            //应收金额
+            double allReceivableAmount = Double.parseDouble(dataObj.getString("allReceivableAmount"));
+            //实收金额
+            double allReceivedAmount = Double.parseDouble(dataObj.getString("allReceivedAmount"));
+            //优惠金额
+            double allPreferentialAmount = Double.parseDouble(dataObj.getString("allPreferentialAmount"));
+            //减免金额
+            double allDeductionAmount = Double.parseDouble(dataObj.getString("allDeductionAmount"));
+            //滞纳金
+            double allLateFee = Double.parseDouble(dataObj.getString("allLateFee"));
+            //空置房打折金额
+            double allVacantHousingDiscount = Double.parseDouble(dataObj.getString("allVacantHousingDiscount"));
+            //空置房减免金额
+            double allVacantHousingReduction = Double.parseDouble(dataObj.getString("allVacantHousingReduction"));
+            //计算未收金额,未收金额 = 应收金额 - 实收金额 - 优惠金额 - 减免金额 + 滞纳金 - 空置房打折金额 - 空置房减免金额
+            double outstandingAmount = allReceivableAmount - allReceivedAmount - allPreferentialAmount - allDeductionAmount + allLateFee
+                    - allVacantHousingDiscount - allVacantHousingReduction;
+            row.createCell(4).setCellValue(String.valueOf(outstandingAmount));
+            row.createCell(5).setCellValue(dataObj.getString("allReceivedAmount"));
+            row.createCell(6).setCellValue(dataObj.getString("allOweAmount"));
+            row.createCell(7).setCellValue(dataObj.getString("allPreferentialAmount"));
+            row.createCell(8).setCellValue(dataObj.getString("allDeductionAmount"));
+            row.createCell(9).setCellValue(dataObj.getString("allGiftAmount"));
+            row.createCell(10).setCellValue(dataObj.getString("allLateFee"));
+            row.createCell(11).setCellValue(dataObj.getString("allVacantHousingDiscount"));
+            row.createCell(12).setCellValue(dataObj.getDouble("allVacantHousingReduction"));
+            //计算收费率,收费率:(应收金额 - 未收金额)/应收金额
+            double chargeRate = ((allReceivableAmount - outstandingAmount) / allReceivableAmount) * 100;
+            BigDecimal bigDecimal = new BigDecimal(chargeRate);
+            double newChargeRate = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+            row.createCell(13).setCellValue(newChargeRate + "%");
+        }
+    }
+}

+ 13 - 24
service-job/src/main/java/com/java110/job/export/adapt/ReportPayFeeDetailAdapt.java

@@ -21,23 +21,20 @@ import java.util.List;
  * 缴费明细导出
  */
 @Service("reportPayFeeDetail")
-public class ReportPayFeeDetailAdapt implements IExportDataAdapt{
+public class ReportPayFeeDetailAdapt implements IExportDataAdapt {
 
     @Autowired
     private IQueryPayFeeDetailInnerServiceSMO queryPayFeeDetailInnerServiceSMOImpl;
 
     private static final int MAX_ROW = 200;
 
-
     @Override
     public SXSSFWorkbook exportData(ExportDataDto exportDataDto) {
-
         SXSSFWorkbook workbook = null;  //工作簿
         String userId = "";
         //工作表
         workbook = new SXSSFWorkbook();
         workbook.setCompressTempFiles(false);
-
         Sheet sheet = workbook.createSheet("缴费明细表");
         Row row = sheet.createRow(0);
         row.createCell(0).setCellValue("订单号");
@@ -62,48 +59,41 @@ public class ReportPayFeeDetailAdapt implements IExportDataAdapt{
         row.createCell(19).setCellValue("车位");
         row.createCell(20).setCellValue("账户抵扣");
         row.createCell(21).setCellValue("收银员");
-
         JSONObject reqJson = exportDataDto.getReqJson();
-        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = BeanConvertUtil.covertBean(reqJson,ReportFeeMonthStatisticsDto.class);
-        if(reqJson.containsKey("roomName") && !StringUtil.isEmpty(reqJson.getString("roomName"))){
-            String[] roomNameArray = reqJson.getString("roomName").split("-",3);
+        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = BeanConvertUtil.covertBean(reqJson, ReportFeeMonthStatisticsDto.class);
+        if (reqJson.containsKey("roomName") && !StringUtil.isEmpty(reqJson.getString("roomName"))) {
+            String[] roomNameArray = reqJson.getString("roomName").split("-", 3);
             reportFeeMonthStatisticsDto.setFloorNum(roomNameArray[0]);
             reportFeeMonthStatisticsDto.setUnitNum(roomNameArray[1]);
             reportFeeMonthStatisticsDto.setRoomNum(roomNameArray[2]);
         }
-
         //查询数据
         getRepairPayFeeDetail(sheet, reportFeeMonthStatisticsDto);
-
         return workbook;
-
     }
 
     private void getRepairPayFeeDetail(Sheet sheet, ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
         reportFeeMonthStatisticsDto.setPage(1);
         reportFeeMonthStatisticsDto.setRow(MAX_ROW);
         ResultVo resultVo = queryPayFeeDetailInnerServiceSMOImpl.query(reportFeeMonthStatisticsDto);
-        appendData(resultVo,sheet,0);
-
-        if(resultVo.getRecords() < 2){
-            return ;
+        appendData(resultVo, sheet, 0);
+        if (resultVo.getRecords() < 2) {
+            return;
         }
-
-        for(int page = 2;page <= resultVo.getRecords(); page++){
+        for (int page = 2; page <= resultVo.getRecords(); page++) {
             reportFeeMonthStatisticsDto.setPage(page);
             reportFeeMonthStatisticsDto.setRow(MAX_ROW);
             resultVo = queryPayFeeDetailInnerServiceSMOImpl.query(reportFeeMonthStatisticsDto);
-            appendData(resultVo,sheet,(page-1)*MAX_ROW);
+            appendData(resultVo, sheet, (page - 1) * MAX_ROW);
         }
     }
 
-    private void appendData(ResultVo resultVo,Sheet sheet,int step) {
-
-        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = (List<ReportFeeMonthStatisticsDto>)resultVo.getData();
+    private void appendData(ResultVo resultVo, Sheet sheet, int step) {
+        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = (List<ReportFeeMonthStatisticsDto>) resultVo.getData();
         Row row = null;
         JSONObject dataObj = null;
         for (int roomIndex = 0; roomIndex < reportFeeMonthStatisticsDtos.size(); roomIndex++) {
-            row = sheet.createRow(roomIndex +step + 1);
+            row = sheet.createRow(roomIndex + step + 1);
             dataObj = JSONObject.parseObject(JSONObject.toJSONString(reportFeeMonthStatisticsDtos.get(roomIndex)));
             row.createCell(0).setCellValue(dataObj.getString("oId"));
             if (!StringUtil.isEmpty(dataObj.getString("payerObjType")) && dataObj.getString("payerObjType").equals("3333")) { //房屋
@@ -118,7 +108,7 @@ public class ReportPayFeeDetailAdapt implements IExportDataAdapt{
             row.createCell(6).setCellValue(dataObj.getString("primeRate"));
             row.createCell(7).setCellValue(dataObj.getString("startTime"));
             row.createCell(8).setCellValue(dataObj.getString("endTime"));
-            row.createCell(9).setCellValue(DateUtil.getFormatTimeString(dataObj.getDate("createTime"),DateUtil.DATE_FORMATE_STRING_A));
+            row.createCell(9).setCellValue(DateUtil.getFormatTimeString(dataObj.getDate("createTime"), DateUtil.DATE_FORMATE_STRING_A));
             row.createCell(10).setCellValue(dataObj.getDouble("receivableAmount"));
             row.createCell(11).setCellValue(dataObj.getDouble("receivedAmount"));
             row.createCell(12).setCellValue(dataObj.getDouble("preferentialAmount"));
@@ -131,7 +121,6 @@ public class ReportPayFeeDetailAdapt implements IExportDataAdapt{
             row.createCell(19).setCellValue(dataObj.getString("psName"));
             row.createCell(20).setCellValue(dataObj.getString("withholdAmount"));
             row.createCell(21).setCellValue(dataObj.getString("cashierName"));
-
         }
     }
 }

+ 129 - 0
service-job/src/main/java/com/java110/job/export/adapt/ReportPrePaymentDetailAdapt.java

@@ -0,0 +1,129 @@
+package com.java110.job.export.adapt;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.ReportFeeMonthStatisticsPrepaymentDto.ReportFeeMonthStatisticsPrepaymentDto;
+import com.java110.dto.data.ExportDataDto;
+import com.java110.intf.report.IQueryPayFeeDetailInnerServiceSMO;
+import com.java110.job.export.IExportDataAdapt;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 账单明细表导出
+ */
+@Service("reportPrePaymentDetail")
+public class ReportPrePaymentDetailAdapt implements IExportDataAdapt {
+
+    @Autowired
+    private IQueryPayFeeDetailInnerServiceSMO queryPayFeeDetailInnerServiceSMOImpl;
+
+    private static final int MAX_ROW = 200;
+
+    @Override
+    public SXSSFWorkbook exportData(ExportDataDto exportDataDto) {
+        SXSSFWorkbook workbook = null;  //工作簿
+        String userId = "";
+        //工作表
+        workbook = new SXSSFWorkbook();
+        workbook.setCompressTempFiles(false);
+        Sheet sheet = workbook.createSheet("账单明细表");
+        Row row = sheet.createRow(0);
+        row.createCell(0).setCellValue("报表ID");
+        row.createCell(1).setCellValue("付费对象");
+        row.createCell(2).setCellValue("业主");
+        row.createCell(3).setCellValue("费用项");
+        row.createCell(4).setCellValue("费用类型");
+        row.createCell(5).setCellValue("费用状态");
+        row.createCell(6).setCellValue("账单状态");
+        row.createCell(7).setCellValue("支付方式");
+        row.createCell(8).setCellValue("费用开始时间");
+        row.createCell(9).setCellValue("费用结束时间");
+        row.createCell(10).setCellValue("缴费时间");
+        row.createCell(11).setCellValue("应缴金额(元)");
+        row.createCell(12).setCellValue("应收金额(元)");
+        row.createCell(13).setCellValue("实收金额(元)");
+        row.createCell(14).setCellValue("欠费金额(元)");
+        row.createCell(15).setCellValue("优惠金额(元)");
+        row.createCell(16).setCellValue("减免金额(元)");
+        row.createCell(17).setCellValue("赠送金额(元)");
+        row.createCell(18).setCellValue("滞纳金(元)");
+        row.createCell(19).setCellValue("空置房打折金额(元)");
+        row.createCell(20).setCellValue("空置房减免金额(元)");
+        row.createCell(21).setCellValue("面积(平方米)");
+        JSONObject reqJson = exportDataDto.getReqJson();
+        ReportFeeMonthStatisticsPrepaymentDto reportFeeMonthStatisticsPrepaymentDto = BeanConvertUtil.covertBean(reqJson, ReportFeeMonthStatisticsPrepaymentDto.class);
+        if (reqJson.containsKey("roomName") && !StringUtil.isEmpty(reqJson.getString("roomName"))) {
+            String[] roomNameArray = reqJson.getString("roomName").split("-", 3);
+            reportFeeMonthStatisticsPrepaymentDto.setFloorNum(roomNameArray[0]);
+            reportFeeMonthStatisticsPrepaymentDto.setUnitNum(roomNameArray[1]);
+            reportFeeMonthStatisticsPrepaymentDto.setRoomNum(roomNameArray[2]);
+        }
+        //查询数据
+        getReportPrePaymentDetail(sheet, reportFeeMonthStatisticsPrepaymentDto);
+        return workbook;
+    }
+
+    private void getReportPrePaymentDetail(Sheet sheet, ReportFeeMonthStatisticsPrepaymentDto reportFeeMonthStatisticsPrepaymentDto) {
+        reportFeeMonthStatisticsPrepaymentDto.setPage(1);
+        reportFeeMonthStatisticsPrepaymentDto.setRow(MAX_ROW);
+        ResultVo resultVo = queryPayFeeDetailInnerServiceSMOImpl.queryPrepayment(reportFeeMonthStatisticsPrepaymentDto);
+        appendData(resultVo, sheet, 0);
+        if (resultVo.getRecords() < 2) {
+            return;
+        }
+        for (int page = 2; page <= resultVo.getRecords(); page++) {
+            reportFeeMonthStatisticsPrepaymentDto.setPage(page);
+            reportFeeMonthStatisticsPrepaymentDto.setRow(MAX_ROW);
+            resultVo = queryPayFeeDetailInnerServiceSMOImpl.queryPrepayment(reportFeeMonthStatisticsPrepaymentDto);
+            appendData(resultVo, sheet, (page - 1) * MAX_ROW);
+        }
+    }
+
+    private void appendData(ResultVo resultVo, Sheet sheet, int step) {
+        List<ReportFeeMonthStatisticsPrepaymentDto> reportFeeMonthStatisticsPrepayments = (List<ReportFeeMonthStatisticsPrepaymentDto>) resultVo.getData();
+        Row row = null;
+        JSONObject dataObj = null;
+        for (int roomIndex = 0; roomIndex < reportFeeMonthStatisticsPrepayments.size(); roomIndex++) {
+            row = sheet.createRow(roomIndex + step + 1);
+            dataObj = JSONObject.parseObject(JSONObject.toJSONString(reportFeeMonthStatisticsPrepayments.get(roomIndex)));
+            row.createCell(0).setCellValue(dataObj.getString("prepaymentId"));
+            row.createCell(1).setCellValue(dataObj.getString("objName"));
+            row.createCell(2).setCellValue(dataObj.getString("ownerName"));
+            row.createCell(3).setCellValue(dataObj.getString("feeName"));
+            row.createCell(4).setCellValue(dataObj.getString("feeTypeCdName"));
+            row.createCell(5).setCellValue(dataObj.getString("prepaymentStateName"));
+            row.createCell(6).setCellValue(dataObj.getString("billStateName"));
+            if(!StringUtil.isEmpty(dataObj.getString("primeRate"))) {
+                row.createCell(7).setCellValue(dataObj.getString("primeRate"));
+            } else {
+                row.createCell(7).setCellValue("--");
+            }
+            row.createCell(8).setCellValue(dataObj.getString("feeBeginTime"));
+            row.createCell(9).setCellValue(dataObj.getString("feeFinishTime"));
+            if(!StringUtil.isEmpty(dataObj.getString("payTime"))) {
+                row.createCell(10).setCellValue(dataObj.getString("payTime"));
+            } else {
+                row.createCell(10).setCellValue("--");
+            }
+            row.createCell(11).setCellValue(dataObj.getString("payableAmount"));
+            row.createCell(12).setCellValue(dataObj.getDouble("prepaymentReceivableAmount"));
+            row.createCell(13).setCellValue(dataObj.getDouble("prepaymentReceivedAmount"));
+            row.createCell(14).setCellValue(dataObj.getDouble("oweAmount"));
+            row.createCell(15).setCellValue(dataObj.getDouble("preferentialAmount"));
+            row.createCell(16).setCellValue(dataObj.getDouble("deductionAmount"));
+            row.createCell(17).setCellValue(dataObj.getDouble("giftAmount"));
+            row.createCell(18).setCellValue(dataObj.getString("lateFee"));
+            row.createCell(19).setCellValue(dataObj.getString("vacantHousingDiscount"));
+            row.createCell(20).setCellValue(dataObj.getString("vacantHousingReduction"));
+            row.createCell(21).setCellValue(dataObj.getString("builtUpArea"));
+        }
+    }
+}

+ 133 - 0
service-job/src/main/java/com/java110/job/export/adapt/ReportProficientAdapt.java

@@ -0,0 +1,133 @@
+package com.java110.job.export.adapt;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.data.ExportDataDto;
+import com.java110.dto.reportFeeYearCollection.ReportFeeYearCollectionDto;
+import com.java110.dto.reportFeeYearCollectionDetail.ReportFeeYearCollectionDetailDto;
+import com.java110.intf.report.IReportFeeYearCollectionDetailInnerServiceSMO;
+import com.java110.intf.report.IReportFeeYearCollectionInnerServiceSMO;
+import com.java110.job.export.IExportDataAdapt;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.StringUtil;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 报表专家导出
+ */
+@Service("reportProficient")
+public class ReportProficientAdapt implements IExportDataAdapt {
+
+    @Autowired
+    private IReportFeeYearCollectionInnerServiceSMO reportFeeYearCollectionInnerServiceSMOImpl;
+
+    @Autowired
+    private IReportFeeYearCollectionDetailInnerServiceSMO reportFeeYearCollectionDetailInnerServiceSMOImpl;
+
+    private static final int MAX_ROW = 200;
+
+    @Override
+    public SXSSFWorkbook exportData(ExportDataDto exportDataDto) {
+        SXSSFWorkbook workbook = null;  //工作簿
+        String userId = "";
+        //工作表
+        workbook = new SXSSFWorkbook();
+        workbook.setCompressTempFiles(false);
+        JSONObject reqJson = exportDataDto.getReqJson();
+        //获取付费对象类型
+        String objType = reqJson.getString("objType");
+        if (!StringUtil.isEmpty(objType) && objType.equals("3333")) { //房屋
+            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("费用名称");
+            ReportFeeYearCollectionDto reportFeeYearCollectionDto = BeanConvertUtil.covertBean(reqJson, ReportFeeYearCollectionDto.class);
+            reportFeeYearCollectionDto.setPage(1);
+            reportFeeYearCollectionDto.setRow(MAX_ROW);
+            List<ReportFeeYearCollectionDto> reportFeeYearCollections = reportFeeYearCollectionInnerServiceSMOImpl.queryReportFeeYearCollections(reportFeeYearCollectionDto);
+            JSONObject dataObj = null;
+            for (int index = 0; index < reportFeeYearCollections.size(); index++) {
+                dataObj = JSONObject.parseObject(JSONObject.toJSONString(reportFeeYearCollections.get(index)));
+                ReportFeeYearCollectionDetailDto reportFeeYearCollectionDetailDto = new ReportFeeYearCollectionDetailDto();
+                reportFeeYearCollectionDetailDto.setCollectionId(dataObj.getString("collectionId"));
+                List<ReportFeeYearCollectionDetailDto> reportFeeYearCollectionDetails =
+                        reportFeeYearCollectionDetailInnerServiceSMOImpl.queryReportFeeYearCollectionDetails(reportFeeYearCollectionDetailDto);
+                for (int detailIndex = 0; detailIndex < reportFeeYearCollectionDetails.size(); detailIndex++) {
+                    row.createCell(6 + detailIndex).setCellValue(reportFeeYearCollectionDetails.get(detailIndex).getCollectionYear() + "年");
+                }
+                appendRoomData(dataObj, sheet, 0, index);
+            }
+        } else if (!StringUtil.isEmpty(objType) && objType.equals("6666")) { //车辆
+            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("费用名称");
+            ReportFeeYearCollectionDto reportFeeYearCollectionDto = BeanConvertUtil.covertBean(reqJson, ReportFeeYearCollectionDto.class);
+            reportFeeYearCollectionDto.setPage(1);
+            reportFeeYearCollectionDto.setRow(MAX_ROW);
+            List<ReportFeeYearCollectionDto> reportFeeYearCollections = reportFeeYearCollectionInnerServiceSMOImpl.queryReportFeeYearCollections(reportFeeYearCollectionDto);
+            JSONObject dataObj = null;
+            for (int index = 0; index < reportFeeYearCollections.size(); index++) {
+                dataObj = JSONObject.parseObject(JSONObject.toJSONString(reportFeeYearCollections.get(index)));
+                ReportFeeYearCollectionDetailDto reportFeeYearCollectionDetailDto = new ReportFeeYearCollectionDetailDto();
+                reportFeeYearCollectionDetailDto.setCollectionId(dataObj.getString("collectionId"));
+                List<ReportFeeYearCollectionDetailDto> reportFeeYearCollectionDetails =
+                        reportFeeYearCollectionDetailInnerServiceSMOImpl.queryReportFeeYearCollectionDetails(reportFeeYearCollectionDetailDto);
+                for (int detailIndex = 0; detailIndex < reportFeeYearCollectionDetails.size(); detailIndex++) {
+                    row.createCell(6 + detailIndex).setCellValue(reportFeeYearCollectionDetails.get(detailIndex).getCollectionYear() + "年");
+                }
+                appendCarData(dataObj, sheet, 0, index);
+            }
+        }
+        return workbook;
+    }
+
+    //房屋费台账
+    private void appendRoomData(JSONObject dataObj, Sheet sheet, int step, int index) {
+        Row row = null;
+        row = sheet.createRow(index + step + 1);
+        ReportFeeYearCollectionDetailDto reportFeeYearCollectionDetailDto = new ReportFeeYearCollectionDetailDto();
+        reportFeeYearCollectionDetailDto.setCollectionId(dataObj.getString("collectionId"));
+        List<ReportFeeYearCollectionDetailDto> reportFeeYearCollectionDetails =
+                reportFeeYearCollectionDetailInnerServiceSMOImpl.queryReportFeeYearCollectionDetails(reportFeeYearCollectionDetailDto);
+        row.createCell(0).setCellValue(dataObj.getString("ownerName"));
+        row.createCell(1).setCellValue(dataObj.getString("objName"));
+        row.createCell(2).setCellValue(dataObj.getString("ownerLink"));
+        row.createCell(3).setCellValue(dataObj.getString("builtUpArea"));
+        row.createCell(4).setCellValue(dataObj.getString("feeTypeCdName"));
+        row.createCell(5).setCellValue(dataObj.getString("feeName"));
+        for (int detailIndex = 0; detailIndex < reportFeeYearCollectionDetails.size(); detailIndex++) {
+            row.createCell(6 + detailIndex).setCellValue(reportFeeYearCollectionDetails.get(detailIndex).getReceivedAmount());
+        }
+    }
+
+    //车辆费台账
+    private void appendCarData(JSONObject dataObj, Sheet sheet, int step, int index) {
+        Row row = null;
+        row = sheet.createRow(index + step + 1);
+        ReportFeeYearCollectionDetailDto reportFeeYearCollectionDetailDto = new ReportFeeYearCollectionDetailDto();
+        reportFeeYearCollectionDetailDto.setCollectionId(dataObj.getString("collectionId"));
+        List<ReportFeeYearCollectionDetailDto> reportFeeYearCollectionDetails =
+                reportFeeYearCollectionDetailInnerServiceSMOImpl.queryReportFeeYearCollectionDetails(reportFeeYearCollectionDetailDto);
+        row.createCell(0).setCellValue(dataObj.getString("ownerName"));
+        row.createCell(1).setCellValue(dataObj.getString("objName"));
+        row.createCell(2).setCellValue(dataObj.getString("ownerLink"));
+        row.createCell(3).setCellValue(dataObj.getString("feeTypeCdName"));
+        row.createCell(4).setCellValue(dataObj.getString("feeName"));
+        for (int detailIndex = 0; detailIndex < reportFeeYearCollectionDetails.size(); detailIndex++) {
+            row.createCell(5 + detailIndex).setCellValue(reportFeeYearCollectionDetails.get(detailIndex).getReceivedAmount());
+        }
+    }
+}