| | |
| | | * @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) { //跳过 保存单元信息 |
| | |
| | | |
| | | } |
| | | |
| | | 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()); |
| | | } |
| | |
| | | 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) { |
| | |
| | | sheet.addMergedRegion(region); |
| | | |
| | | |
| | | //第一行 |
| | | //子标题 |
| | | if (feePrint != null) { |
| | | XSSFClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) 0, 1 + line, (short) 1, 1 + line + 1); |
| | | anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);//设置图片随单元移动调整大小 |
| | |
| | | subTitleCellStyle.setAlignment(HorizontalAlignment.CENTER); |
| | | subTitleCellStyle.setVerticalAlignment(VerticalAlignment.BOTTOM); |
| | | row = sheet.createRow(1 + line); |
| | | // cell0 = row.createCell(0); |
| | | // cell0.setCellValue("收费二维码"); |
| | | // cell0.setCellStyle(subTitleCellStyle); |
| | | |
| | | Cell cell1 = row.createCell(1); |
| | | cell1.setCellValue("房号:" + room.getString("floorNum") |
| | | + "-" + room.getString("unitNum") |
| | |
| | | Cell cell5 = row.createCell(5); |
| | | cell5.setCellValue(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B)); |
| | | cell5.setCellStyle(subTitleCellStyle); |
| | | row.setHeight((short) (subTitleHeight)); |
| | | CellStyle rowCellStyle = workbook.createCellStyle(); |
| | | rowCellStyle.setVerticalAlignment(VerticalAlignment.BOTTOM); |
| | | row.setRowStyle(rowCellStyle); |
| | |
| | | sheet.addMergedRegion(region); |
| | | region = new CellRangeAddress(1 + line, 1 + line, 5, 6); |
| | | sheet.addMergedRegion(region); |
| | | row.setHeight((short) (titleHeight)); |
| | | //子标题高度 |
| | | row.setHeight((short) (subTitleHeight)); |
| | | |
| | | |
| | | row = sheet.createRow(2 + line); |
| | |
| | | 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)); |