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

加入批量导出缴费通知单

java110 лет назад: 5
Родитель
Сommit
cc6fef254e
29 измененных файлов с 382 добавлено и 24 удалено
  1. 12 0
      java110-bean/src/main/java/com/java110/dto/RoomDto.java
  2. 127 0
      java110-utils/src/main/java/com/java110/utils/util/Money2ChineseUtil.java
  3. 19 0
      service-fee/src/main/java/com/java110/fee/api/FeeApi.java
  4. 7 0
      service-fee/src/main/java/com/java110/fee/bmo/IQueryOweFee.java
  5. 43 3
      service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
  6. 11 0
      service-front/src/main/java/com/java110/front/components/assetImport/FeeManualCollectionComponent.java
  7. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionPlan/AddInspectionPlanComponent.java
  8. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/AddInspectionRouteComponent.java
  9. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/AddInspectionRoutePointComponent.java
  10. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionPlan/ChooseInspectionPlanComponent.java
  11. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/ChooseInspectionRouteComponent.java
  12. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionPlan/DeleteInspectionPlanComponent.java
  13. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/DeleteInspectionRouteComponent.java
  14. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/DeleteInspectionRoutePointComponent.java
  15. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionPlan/EditInspectionPlanComponent.java
  16. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/EditInspectionRouteComponent.java
  17. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionPlan/InspectionPlanManageComponent.java
  18. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/InspectionRouteManageComponent.java
  19. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionRoute/InspectionRoutePointManageComponent.java
  20. 1 1
      service-front/src/main/java/com/java110/front/components/inspectionPlan/UpdateInspectionPlanStateComponent.java
  21. 1 1
      service-front/src/main/java/com/java110/front/components/machineTranslate/AddMachineTranslateComponent.java
  22. 1 1
      service-front/src/main/java/com/java110/front/components/machineTranslate/ChooseMachineTranslateComponent.java
  23. 1 1
      service-front/src/main/java/com/java110/front/components/machineTranslate/DeleteMachineTranslateComponent.java
  24. 1 1
      service-front/src/main/java/com/java110/front/components/machineTranslate/EditMachineTranslateComponent.java
  25. 1 1
      service-front/src/main/java/com/java110/front/components/machineRecord/MachineRecordManageComponent.java
  26. 1 1
      service-front/src/main/java/com/java110/front/components/machineTranslate/MachineTranslateManageComponent.java
  27. 1 1
      service-front/src/main/java/com/java110/front/components/machineRecord/MachineVistorPhotoManageComponent.java
  28. 7 0
      service-front/src/main/java/com/java110/front/smo/assetExport/IExportFeeManualCollectionSMO.java
  29. 135 0
      service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java

+ 12 - 0
java110-bean/src/main/java/com/java110/dto/RoomDto.java

@@ -1,5 +1,7 @@
 package com.java110.dto;
 
+import com.java110.dto.fee.FeeDto;
+
 import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
@@ -57,6 +59,8 @@ public class RoomDto extends PageDto implements Serializable {
 
     private List<RoomAttrDto> roomAttrDto;
 
+    private List<FeeDto> fees;
+
 
     private Date createTime;
 
@@ -305,4 +309,12 @@ public class RoomDto extends PageDto implements Serializable {
     public void setRoomType(String roomType) {
         this.roomType = roomType;
     }
+
+    public List<FeeDto> getFees() {
+        return fees;
+    }
+
+    public void setFees(List<FeeDto> fees) {
+        this.fees = fees;
+    }
 }

+ 127 - 0
java110-utils/src/main/java/com/java110/utils/util/Money2ChineseUtil.java

@@ -0,0 +1,127 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.utils.util;
+
+import java.math.BigDecimal;
+
+/**
+ * @desc add by 吴学文 17:14
+ */
+public class Money2ChineseUtil {
+    /*
+eg:640 409 329
+ 987 654 321  //对应的坐标
+
+ &&& &&& &&&  //替换成对应的字符 (如果是0加上标记)
+ --- --- ---  //每位修辞符常量
+      *       //每隔5位数字修辞符常量
+
+*/
+    //数字转中文常量
+    private final static String[] C_N = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
+    //每隔5位数字修辞符常量
+    private final static String[] C_F = {"", "万", "亿", "兆", "吉", "太", "拍", "艾"};
+    //对应的每位修辞符常量
+    private final static String[] C_S = {"", "拾", "佰", "仟"};
+    private final static String[] CNY = {"元", "角", "分", "毫", "厘"};
+    //"-"
+    private final static String negative = "负";
+    //"+"
+    private final static String positive = "";
+
+    /**
+     * 将整数转换成对应的中文字符串
+     *
+     * @param l
+     * @return StringBuffed
+     */
+    public static String toChineseChar(long l) {
+        //定义变量保存中文字符串
+        StringBuilder sb = new StringBuilder();
+        //将阿拉伯数字转换为无符号的字符串数组
+        char[] ch = (Math.abs(l) + "").toCharArray();
+        //加上符号
+        sb.append(l < 0 ? negative : positive);
+        //定义一个标记,判断该数位前面是否有'0'
+        boolean beforeHaveZore = false;
+        //遍历中文字符串
+        for (int i = 0, j = ch.length - 1; i < ch.length; i++, j--) {
+            //如果首位是1且是十位就不用加'壹'了:eg 15 拾伍   150213 拾伍万零贰佰壹叁  150013 拾伍万零壹拾叁 拾亿零壹拾万/拾亿零拾万
+            if (i == 0 && ch[i] - 48 == 1 && j % 4 == 1) {
+                sb.append(C_S[1]);
+                //判断这个数字是否为0且它前面没有0
+            } else if (ch[i] != 48 && !beforeHaveZore)
+                //中文常量 + 对应的每位修辞符常量 + 每隔4位数字修辞符常量
+                sb.append(C_N[ch[i] - 48] + C_S[j % 4] + C_F[j % 4 == 0 ? j / 4 : 0]);
+                //判断这个数字是否为0且它前面有0
+            else if (ch[i] != 48 && beforeHaveZore) {
+                //中文常量"零"+中文常量+对应的每位修辞符常量+每隔4位数字修辞符常量
+                sb.append(C_N[0] + C_N[ch[i] - 48] + C_S[j % 4] + C_F[j % 4 == 0 ? j / 4 : 0]);
+                //消出标记
+                beforeHaveZore = false;
+                //这个数字是0
+            } else {
+                //如果这个数的位置不是第5位?标记:不标记
+                beforeHaveZore = beforeHaveZore || j % 4 != 0;
+                //每隔5位数字修辞符常量 eg: 50000 伍万
+                sb.append(C_F[j % 4 == 0 ? j / 4 : 0]);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * To CNY
+     *
+     * @param d
+     * @return
+     */
+    public static String toChineseCNY(Double d) {
+        long l = d.longValue();
+        if (d - l == 0) {
+            return toChineseChar(l) + CNY[0] + "整";
+        }
+        String s = (d + "").split("\\.")[1];
+
+        StringBuffer sb = new StringBuffer(s.length() * 2);
+        int i = 1;
+        for (char c : s.toCharArray()) {
+            if (c - 48 == 0) {
+                i++;
+                continue;
+            }
+            sb.append(C_N[c - 48] + CNY[i++]);
+            if (CNY.length == i) {
+                break;
+            }
+        }
+        return toChineseChar(l) + CNY[0] + sb;
+    }
+
+    public static String toChineseChar(Double d) {
+        long l = d.longValue();
+        if (d - l == 0) {
+            return toChineseChar(l);
+        }
+        String s = (BigDecimal.valueOf(d).toPlainString()).split("\\.")[1];
+        StringBuffer sb = new StringBuffer(s.length());
+        sb.append("点");
+        for (char c : s.toCharArray()) {
+            sb.append(C_N[c - 48]);
+        }
+        return toChineseChar(l) + sb;
+    }
+}

+ 19 - 0
service-fee/src/main/java/com/java110/fee/api/FeeApi.java

@@ -180,6 +180,25 @@ public class FeeApi extends BaseController {
         feeDto.setCommunityId(communityId);
         return queryOweFeeImpl.query(feeDto);
     }
+    /**
+     * 查询欠费费用
+     *
+     * @param roomId    房屋ID
+     * @param communityId 小区ID
+     * @return
+     * @path /app/feeApi/listAllRoomOweFees
+     */
+    @RequestMapping(value = "/listAllRoomOweFees", method = RequestMethod.GET)
+    public ResponseEntity<String> listAllRoomOweFees(
+            @RequestParam(value = "roomId",required = false) String roomId,
+            @RequestParam(value = "payObjType") String payObjType,
+            @RequestParam(value = "communityId") String communityId) {
+        FeeDto feeDto = new FeeDto();
+        feeDto.setPayerObjId(roomId);
+        feeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
+        feeDto.setCommunityId(communityId);
+        return queryOweFeeImpl.querys(feeDto);
+    }
 
     /**
      * 查询欠费费用

+ 7 - 0
service-fee/src/main/java/com/java110/fee/bmo/IQueryOweFee.java

@@ -28,4 +28,11 @@ public interface IQueryOweFee {
      * @return
      */
     ResponseEntity<String> listFeeObj(FeeDto feeDto);
+
+    /**
+     * 查询所有房屋的欠费
+     * @param feeDto
+     * @return
+     */
+    ResponseEntity<String> querys(FeeDto feeDto);
 }

+ 43 - 3
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java

@@ -157,12 +157,52 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         String val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
         feeDto.setVal(val);
         String received_amount_switch = MappingCache.getValue(DOMAIN_COMMON, RECEIVED_AMOUNT_SWITCH);
-        if(StringUtil.isEmpty(received_amount_switch)){
+        if (StringUtil.isEmpty(received_amount_switch)) {
             feeDto.setReceivedAmountSwitch("1");//默认启用实收款输入框
-        }else {
+        } else {
             feeDto.setReceivedAmountSwitch(received_amount_switch);
         }
-         return ResultVo.createResponseEntity(feeDto);
+        return ResultVo.createResponseEntity(feeDto);
+    }
+
+    @Override
+    public ResponseEntity<String> querys(FeeDto feeDto) {
+        RoomDto roomDto = new RoomDto();
+        roomDto.setCommunityId(feeDto.getCommunityId());
+        roomDto.setRoomId(feeDto.getPayerObjId());
+        List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
+        //查询费用信息arrearsEndTime
+        FeeDto tmpFeeDto = null;
+        List<RoomDto> tmpRoomDtos = new ArrayList<>();
+        for (RoomDto tmpRoomDto : roomDtos) {
+            tmpFeeDto = new FeeDto();
+            tmpFeeDto.setArrearsEndTime(DateUtil.getCurrentDate());
+            tmpFeeDto.setState(FeeDto.STATE_DOING);
+            tmpFeeDto.setPayerObjId(tmpRoomDto.getRoomId());
+            tmpFeeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
+            List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
+
+            if (feeDtos == null || feeDtos.size() < 1) {
+                feeDtos = new ArrayList<>();
+                return ResultVo.createResponseEntity(feeDtos);
+            }
+            List<FeeDto> tmpFeeDtos = new ArrayList<>();
+            for (FeeDto tempFeeDto : feeDtos) {
+                computeFeeSMOImpl.computeEveryOweFee(tempFeeDto);//计算欠费金额
+                //如果金额为0 就排除
+                if (tempFeeDto.getFeePrice() > 0 && tempFeeDto.getEndTime().getTime() <= DateUtil.getCurrentDate().getTime()) {
+                    tmpFeeDtos.add(tmpFeeDto);
+                }
+            }
+
+            if (tmpFeeDtos.size() < 1) {
+                continue;
+            }
+            tmpRoomDto.setFees(tmpFeeDtos);
+            tmpRoomDtos.add(tmpRoomDto);
+        }
+
+        return ResultVo.createResponseEntity(tmpRoomDtos);
     }
 
     private boolean freshFeeDtoParam(FeeDto feeDto) {

+ 11 - 0
service-front/src/main/java/com/java110/front/components/assetImport/FeeManualCollectionComponent.java

@@ -34,5 +34,16 @@ public class FeeManualCollectionComponent {
         return exportFeeManualCollectionSMOImpl.exportExcelData(pd);
     }
 
+    /**
+     * 添加应用数据
+     *
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<Object> downloadCollectionLetterOrder(IPageData pd) throws Exception {
+
+        return exportFeeManualCollectionSMOImpl.downloadCollectionLetterOrder(pd);
+    }
+
 
 }

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionPlan/AddInspectionPlanComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionPlan;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IAddInspectionPlanSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/AddInspectionRouteComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IAddInspectionRouteSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/AddInspectionRoutePointComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IListInspectionPointsSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionPlan/ChooseInspectionPlanComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionPlan;
+package com.java110.front.components.inspectionPoint;
 
 
 import com.java110.core.context.IPageData;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/ChooseInspectionRouteComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IListInspectionRoutesSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionPlan/DeleteInspectionPlanComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionPlan;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IDeleteInspectionPlanSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/DeleteInspectionRouteComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IDeleteInspectionRouteSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/DeleteInspectionRoutePointComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IDeleteInspectionRoutePointSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionPlan/EditInspectionPlanComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionPlan;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IEditInspectionPlanSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/EditInspectionRouteComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IEditInspectionRouteSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionPlan/InspectionPlanManageComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionPlan;
+package com.java110.front.components.inspectionPoint;
 
 
 import com.java110.core.context.IPageData;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/InspectionRouteManageComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 
 import com.java110.core.context.IPageData;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionRoute/InspectionRoutePointManageComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionRoute;
+package com.java110.front.components.inspectionPoint;
 
 
 import com.java110.core.context.IPageData;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/inspectionPlan/UpdateInspectionPlanStateComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.inspectionPlan;
+package com.java110.front.components.inspectionPoint;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.inspection.IInspectionPlanStateSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/machineTranslate/AddMachineTranslateComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.machineTranslate;
+package com.java110.front.components.machine;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.machine.IAddMachineTranslateSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/machineTranslate/ChooseMachineTranslateComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.machineTranslate;
+package com.java110.front.components.machine;
 
 
 import com.java110.core.context.IPageData;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/machineTranslate/DeleteMachineTranslateComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.machineTranslate;
+package com.java110.front.components.machine;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.machine.IDeleteMachineTranslateSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/machineTranslate/EditMachineTranslateComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.machineTranslate;
+package com.java110.front.components.machine;
 
 import com.java110.core.context.IPageData;
 import com.java110.front.smo.machine.IEditMachineTranslateSMO;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/machineRecord/MachineRecordManageComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.machineRecord;
+package com.java110.front.components.machine;
 
 
 import com.alibaba.fastjson.JSONObject;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/machineTranslate/MachineTranslateManageComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.machineTranslate;
+package com.java110.front.components.machine;
 
 
 import com.java110.core.context.IPageData;

+ 1 - 1
service-front/src/main/java/com/java110/front/components/machineRecord/MachineVistorPhotoManageComponent.java

@@ -1,4 +1,4 @@
-package com.java110.front.components.machineRecord;
+package com.java110.front.components.machine;
 
 
 import com.alibaba.fastjson.JSONObject;

+ 7 - 0
service-front/src/main/java/com/java110/front/smo/assetExport/IExportFeeManualCollectionSMO.java

@@ -19,4 +19,11 @@ public interface IExportFeeManualCollectionSMO {
      * @return ResponseEntity
      */
     public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception;
+
+    /**
+     * 导出催缴单
+     * @param pd
+     * @return
+     */
+    ResponseEntity<Object> downloadCollectionLetterOrder(IPageData pd);
 }

+ 135 - 0
service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java

@@ -10,6 +10,7 @@ import com.java110.front.smo.assetExport.IExportFeeManualCollectionSMO;
 import com.java110.utils.constant.ServiceConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.DateUtil;
+import com.java110.utils.util.Money2ChineseUtil;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -26,6 +27,7 @@ import org.springframework.web.client.RestTemplate;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.math.BigDecimal;
 
 /**
  * @ClassName AssetImportSmoImpl
@@ -79,6 +81,139 @@ public class ExportFeeManualCollectionSMOImpl extends BaseComponentSMO implement
         return new ResponseEntity<Object>(context, headers, HttpStatus.OK);
     }
 
+    @Override
+    public ResponseEntity<Object> downloadCollectionLetterOrder(IPageData pd) {
+        ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        Assert.hasKeyAndValue(JSONObject.parseObject(pd.getReqData()), "communityId", "请求中未包含小区");
+
+        Workbook workbook = null;  //工作簿
+        //工作表
+        workbook = new XSSFWorkbook();
+        //获取楼信息
+        getRoomOweFees(pd, result, workbook);
+
+
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        MultiValueMap headers = new HttpHeaders();
+        headers.add("content-type", "application/octet-stream;charset=UTF-8");
+        headers.add("Content-Disposition", "attachment;filename=downloadCollectionLetterOrder_" + DateUtil.getyyyyMMddhhmmssDateString() + ".xlsx");
+        headers.add("Pargam", "no-cache");
+        headers.add("Cache-Control", "no-cache");
+        //headers.add("Content-Disposition", "attachment; filename=" + outParam.getString("fileName"));
+        headers.add("Accept-Ranges", "bytes");
+        byte[] context = null;
+        try {
+            workbook.write(os);
+            context = os.toByteArray();
+            os.close();
+            workbook.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+            // 保存数据
+            return new ResponseEntity<Object>("导出失败", HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+        // 保存数据
+        return new ResponseEntity<Object>(context, headers, HttpStatus.OK);
+    }
+
+    /**
+     * 查询房屋欠费
+     *
+     * @param pd
+     * @param result
+     * @param workbook
+     */
+    private void getRoomOweFees(IPageData pd, ComponentValidateResult result, Workbook workbook) {
+
+        String apiUrl = "";
+        ResponseEntity<String> responseEntity = null;
+        apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeApi/listAllRoomOweFees?communityId=" + result.getCommunityId();
+        responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET);
+
+        if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
+            return;
+        }
+
+        JSONObject savedRoomInfoResults = JSONObject.parseObject(responseEntity.getBody(), Feature.OrderedField);
+
+
+        if (!savedRoomInfoResults.containsKey("data")) {
+            return;
+        }
+
+
+        JSONArray rooms = savedRoomInfoResults.getJSONArray("data");
+
+        if (rooms == null || rooms.size() < 1) {
+            return;
+        }
+
+        Sheet sheet = workbook.createSheet("催缴单");
+        int line = 0;
+        for (int roomIndex = 0; roomIndex < rooms.size(); roomIndex++) {
+            line = generatorRoomOweFee(sheet, workbook, rooms.getJSONObject(roomIndex), line + 1);
+        }
+    }
+
+    private int generatorRoomOweFee(Sheet sheet, Workbook workbook, JSONObject room, int line) {
+        Row row = sheet.createRow(0 + line);
+        Cell cell0 = row.createCell(0);
+        cell0.setCellValue("缴费通知单");
+        CellStyle cs = workbook.createCellStyle();
+        cs.setWrapText(true);  //关键
+        cell0.setCellStyle(cs);
+        row.setHeight((short) (200 * 10));
+        //第一行
+        row = sheet.createRow(1 + line);
+        row.createCell(0).setCellValue("收费二维码");
+        row.createCell(1).setCellValue("房号:" + room.getString("floorNum")
+                + "-" + room.getString("unitNum")
+                + "-" + room.getString("roomNum"));
+        row.createCell(2).setCellValue("业主:" + room.getString("ownerName"));
+        row.createCell(3).setCellValue(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B));
+
+        row = sheet.createRow(2 + line);
+        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("备注");
+
+        JSONArray fees = room.getJSONArray("fees");
+        BigDecimal totalPrice = new BigDecimal(0);
+        for (int feeIndex = 0; feeIndex < fees.size(); feeIndex++) {
+            JSONObject feeObj = fees.getJSONObject(feeIndex);
+            row = sheet.createRow(line + feeIndex + 3);
+            row.createCell(0).setCellValue(feeObj.getString("feeName"));
+            row.createCell(1).setCellValue(feeObj.getString("squarePrice"));
+            row.createCell(2).setCellValue(room.getString("builtUpArea"));
+            row.createCell(3).setCellValue(feeObj.getString("endTime") + "至" + feeObj.getString("deadlineTime"));
+            row.createCell(4).setCellValue(room.getString("feePrice"));
+            row.createCell(5).setCellValue("0");
+            row.createCell(6).setCellValue("");
+            totalPrice.add(new BigDecimal(feeObj.getString("squarePrice")));
+        }
+
+        row = sheet.createRow(line + fees.size() + 3);
+        row.createCell(0).setCellValue("合计(大写):");
+        row.createCell(1).setCellValue(Money2ChineseUtil.toChineseChar(totalPrice.doubleValue()));
+        row.createCell(2).setCellValue("");
+        row.createCell(3).setCellValue("");
+        row.createCell(4).setCellValue(totalPrice.doubleValue());
+        row.createCell(5).setCellValue("");
+        row.createCell(6).setCellValue("");
+
+        row = sheet.createRow(line + fees.size() + 4);
+        row.createCell(0).setCellValue("1、请收到通知单5日内到物业处或微信支付");
+        row = sheet.createRow(fees.size() + 5);
+        row.createCell(0).setCellValue("2、逾期未缴,将按规定收取违约金,会给您照成不必要的损失");
+
+        return line + fees.size() + 4;
+    }
+
 
     /**
      * 查询存在的房屋信息