xiaogang
2021-08-10 c27bd6651e69cdee684a0b85338512de02a56350
service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
old mode 100644 new mode 100755
@@ -141,10 +141,12 @@
     * @param workbook
     */
    private void getRoomOweFees(IPageData pd, ComponentValidateResult result, Workbook workbook) {
        Sheet sheet = workbook.createSheet("催缴单");
        Drawing patriarch = sheet.createDrawingPatriarch();
        String apiUrl = "";
        ResponseEntity<String> responseEntity = null;
        apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeApi/listAllRoomOweFees?communityId=" + result.getCommunityId();
        JSONObject reqJson = JSONObject.parseObject(pd.getReqData());
        apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeApi/listAllRoomOweFees" + mapToUrlParam(reqJson);
        responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET);
        if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
@@ -180,12 +182,11 @@
        }
        Sheet sheet = workbook.createSheet("催缴单");
        Drawing patriarch = sheet.createDrawingPatriarch();
        int line = 0;
        double totalPageHeight = 0;
        for (int roomIndex = 0; roomIndex < rooms.size(); roomIndex++) {
            Map info = generatorRoomOweFee(sheet, workbook, rooms.getJSONObject(roomIndex), line, totalPageHeight, patriarch, feePrint);
            Map<String, Object> info = generatorRoomOweFee(sheet, workbook, rooms.getJSONObject(roomIndex), line, totalPageHeight, patriarch, feePrint);
            line = Integer.parseInt(info.get("line").toString()) + 1;
            totalPageHeight = Double.parseDouble(info.get("totalPageHeight").toString());
        }
@@ -196,11 +197,13 @@
        String[] feePrintRemarks = null;
        if (feePrint != null) {
            feePrintRemarks = feePrint.getString("content").toLowerCase().replace("</br>", "").split("\n");
        } else {
            feePrintRemarks = new String[]{""};
        }
        int defaultRowHeight = 280;
        //计算当前单子的高度
        int titleHeight = defaultRowHeight * 3;
        int subTitleHeight = defaultRowHeight * 4;
        int subTitleHeight = defaultRowHeight * 5;
        int totalHeight = titleHeight + subTitleHeight + defaultRowHeight * 3 + fees.size() * defaultRowHeight;
        //备注,加上打印配置内容
        if (feePrintRemarks != null && feePrintRemarks.length > 0) {
@@ -241,7 +244,11 @@
        Row row = sheet.createRow(0 + line);
        Cell cell0 = row.createCell(0);
        //cell0.setCellValue("缴费通知单totalHeight:" + totalHeight + "-totalPageHeight:" + totalPageHeight + "-curPageHeight:" + curPageHeight + "-freePageHeight:" + freePageHeight + "-line:" + line);
        cell0.setCellValue("缴费通知单");
        if (feePrint != null) {
            cell0.setCellValue(feePrint.getString("printName") + "缴费通知单");
        } else {
            cell0.setCellValue("缴费通知单");
        }
        //标题设置字体
        Font font = workbook.createFont();
        font.setFontName("黑体");
@@ -274,14 +281,20 @@
        subTitleCellStyle.setAlignment(HorizontalAlignment.CENTER);
        subTitleCellStyle.setVerticalAlignment(VerticalAlignment.BOTTOM);
        row = sheet.createRow(1 + line);
        Cell cell1 = row.createCell(1);
        cell1.setCellValue("房号:" + room.getString("floorNum")
                + "-" + room.getString("unitNum")
                + "-" + room.getString("roomNum"));
        if (fees != null && fees.size() > 0) {
            cell1.setCellValue("业主:" + fees.getJSONObject(0).getString("ownerName"));
        } else {
            cell1.setCellValue("业主:无");
        }
        cell1.setCellStyle(subTitleCellStyle);
        row.createCell(2).setCellValue("");
        Cell cell2 = row.createCell(2);
        cell2.setCellValue("房号:" + room.getString("floorNum")
                + "-" + room.getString("unitNum")
                + "-" + room.getString("roomNum"));
        cell2.setCellStyle(subTitleCellStyle);
        row.createCell(3).setCellValue("");
        row.createCell(4).setCellValue("");
        Cell cell5 = row.createCell(5);
@@ -292,7 +305,7 @@
        row.setRowStyle(rowCellStyle);
        //设置表头之上
        region = new CellRangeAddress(1 + line, 1 + line, 1, 3);
        region = new CellRangeAddress(1 + line, 1 + line, 2, 3);
        sheet.addMergedRegion(region);
        region = new CellRangeAddress(1 + line, 1 + line, 5, 6);
        sheet.addMergedRegion(region);
@@ -307,7 +320,7 @@
        cell1 = row.createCell(1);
        cell1.setCellValue("收费标准");
        cell1.setCellStyle(cellStyle);
        Cell cell2 = row.createCell(2);
        cell2 = row.createCell(2);
        cell2.setCellValue("数量/面积");
        cell2.setCellStyle(cellStyle);
        Cell cell3 = row.createCell(3);
@@ -344,7 +357,11 @@
            cell2.setCellValue(room.getString("builtUpArea"));
            cell2.setCellStyle(cellStyle);
            cell3 = row.createCell(3);
            cell3.setCellValue(startTime + "至" + endTime);
            if (feeObj.containsKey("curDegrees")) {
                cell3.setCellValue(startTime + "至" + endTime + " " + feeObj.getString("preDegrees") + "至" + feeObj.getString("curDegrees"));
            } else {
                cell3.setCellValue(startTime + "至" + endTime);
            }
            cell3.setCellStyle(cellStyle);
            cell4 = row.createCell(4);
            cell4.setCellValue(feeObj.getString("feePrice"));
@@ -390,7 +407,7 @@
        sheet.addMergedRegion(region);
        if (feePrintRemarks != null && feePrintRemarks.length > 0) {
            for(int remarkIndex = 0 ;remarkIndex < feePrintRemarks.length; remarkIndex++) {
            for (int remarkIndex = 0; remarkIndex < feePrintRemarks.length; remarkIndex++) {
                row = sheet.createRow(line + fees.size() + 4 + remarkIndex);
                row.createCell(0).setCellValue(feePrintRemarks[remarkIndex]);
                row.setHeight((short) (defaultRowHeight));