|
|
@@ -45,6 +45,7 @@ public class ExportReportFeeSMOImpl extends BaseComponentSMO implements IExportR
|
|
|
public static final String REPORT_FEE_DETAIL = "reportFeeDetail";
|
|
|
public static final String REPORT_OWE_FEE_DETAIL = "reportOweFeeDetail";
|
|
|
public static final String REPORT_PAY_FEE_DETAIL = "reportPayFeeDetail";
|
|
|
+ public static final String REPORT_YEAR_COLLECTION = "reportYearCollection";
|
|
|
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
@@ -83,6 +84,10 @@ public class ExportReportFeeSMOImpl extends BaseComponentSMO implements IExportR
|
|
|
case REPORT_PAY_FEE_DETAIL:
|
|
|
reportPayFeeDetail(pd, result, workbook);
|
|
|
break;
|
|
|
+ case REPORT_YEAR_COLLECTION:
|
|
|
+ reportYearCollection(pd, result, workbook);
|
|
|
+ break;
|
|
|
+
|
|
|
}
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
MultiValueMap headers = new HttpHeaders();
|
|
|
@@ -150,6 +155,45 @@ public class ExportReportFeeSMOImpl extends BaseComponentSMO implements IExportR
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void reportYearCollection(IPageData pd, ComponentValidateResult result, Workbook workbook) {
|
|
|
+ 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("应收金额");
|
|
|
+
|
|
|
+ //查询楼栋信息
|
|
|
+ JSONArray rooms = this.getReportYearCollection(pd, result);
|
|
|
+ if (rooms == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONArray reportFeeYearCollectionDetailDtos = rooms.getJSONObject(0).getJSONArray("reportFeeYearCollectionDetailDtos");
|
|
|
+
|
|
|
+ for (int detailIndex = 0; detailIndex < reportFeeYearCollectionDetailDtos.size(); detailIndex++) {
|
|
|
+ row.createCell(6 + detailIndex).setCellValue(reportFeeYearCollectionDetailDtos.getJSONObject(detailIndex).getString("collectionYear") + "年");
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONObject dataObj = null;
|
|
|
+ for (int roomIndex = 0; roomIndex < rooms.size(); roomIndex++) {
|
|
|
+ row = sheet.createRow(roomIndex + 1);
|
|
|
+ dataObj = rooms.getJSONObject(roomIndex);
|
|
|
+ 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("feeName"));
|
|
|
+ row.createCell(5).setCellValue(dataObj.getString("receivableAmount"));
|
|
|
+
|
|
|
+ reportFeeYearCollectionDetailDtos = rooms.getJSONObject(roomIndex).getJSONArray("reportFeeYearCollectionDetailDtos");
|
|
|
+ for (int detailIndex = 0; detailIndex < reportFeeYearCollectionDetailDtos.size(); detailIndex++) {
|
|
|
+ row.createCell(6 + detailIndex).setCellValue(reportFeeYearCollectionDetailDtos.getJSONObject(detailIndex).getString("receivedAmount"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private JSONArray getReportPayFeeDetail(IPageData pd, ComponentValidateResult result) {
|
|
|
String apiUrl = "";
|
|
|
ResponseEntity<String> responseEntity = null;
|
|
|
@@ -168,6 +212,24 @@ public class ExportReportFeeSMOImpl extends BaseComponentSMO implements IExportR
|
|
|
return savedRoomInfoResults.getJSONArray("data");
|
|
|
}
|
|
|
|
|
|
+ private JSONArray getReportYearCollection(IPageData pd, ComponentValidateResult result) {
|
|
|
+ String apiUrl = "";
|
|
|
+ ResponseEntity<String> responseEntity = null;
|
|
|
+ JSONObject reqJson = JSONObject.parseObject(pd.getReqData());
|
|
|
+ reqJson.put("page", 1);
|
|
|
+ reqJson.put("row", 10001);
|
|
|
+ apiUrl = ServiceConstant.SERVICE_API_URL + "/api/reportFeeYearCollection/queryReportFeeYear" + mapToUrlParam(reqJson);
|
|
|
+ responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET);
|
|
|
+ if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ JSONObject savedRoomInfoResults = JSONObject.parseObject(responseEntity.getBody(), Feature.OrderedField);
|
|
|
+ if (!savedRoomInfoResults.containsKey("data")) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return savedRoomInfoResults.getJSONArray("data");
|
|
|
+ }
|
|
|
+
|
|
|
private void reportOweFeeDetail(IPageData pd, ComponentValidateResult result, Workbook workbook) {
|
|
|
Sheet sheet = workbook.createSheet("欠费明细表");
|
|
|
Row row = sheet.createRow(0);
|