|
|
@@ -2,6 +2,7 @@ package com.jpsoft.employment.modules.base.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.employment.config.OSSConfig;
|
|
|
+import com.jpsoft.employment.modules.base.dto.AddRowDTO;
|
|
|
import com.jpsoft.employment.modules.base.entity.DepartmentInfo;
|
|
|
import com.jpsoft.employment.modules.base.entity.TemplateInfo;
|
|
|
import com.jpsoft.employment.modules.base.entity.TemplateOption;
|
|
|
@@ -784,7 +785,9 @@ public class FundIncomeInfoController {
|
|
|
String curMonth = "";
|
|
|
String startDate = "";
|
|
|
String endDate = "";
|
|
|
+ String startYearDate = "";
|
|
|
if (StringUtils.isNotEmpty(yearMonth)) {
|
|
|
+ startYearDate = yearMonth.substring(0, 4) + "-01-01";
|
|
|
startDate = yearMonth + "-01";
|
|
|
endDate = yearMonth + "-31";
|
|
|
|
|
|
@@ -795,15 +798,18 @@ public class FundIncomeInfoController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(name)) {
|
|
|
- searchParams.put("name", "%" + name + "%");
|
|
|
+ searchParams.put("title", "%" + name + "%");
|
|
|
}
|
|
|
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
|
|
|
BigDecimal curBudgetRevenueTotal = BigDecimal.ZERO;
|
|
|
BigDecimal accumulatedArrearsTotal = BigDecimal.ZERO;
|
|
|
+ BigDecimal actualTotalRevenueTotal = BigDecimal.ZERO;
|
|
|
+ BigDecimal curMonthReceivedTotal = BigDecimal.ZERO;
|
|
|
+
|
|
|
|
|
|
- List<TemplateInfo> templateInfoList1 = templateInfoService.list();
|
|
|
+ List<TemplateInfo> templateInfoList1 = templateInfoService.list(searchParams, sortList);
|
|
|
|
|
|
for (TemplateInfo templateInfo : templateInfoList1) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
@@ -815,6 +821,10 @@ public class FundIncomeInfoController {
|
|
|
|
|
|
BigDecimal totalSum = BigDecimal.ZERO;
|
|
|
|
|
|
+ BigDecimal totalCurMonthReceived = BigDecimal.ZERO;
|
|
|
+
|
|
|
+ BigDecimal totalActualTotalRevenue = BigDecimal.ZERO;
|
|
|
+
|
|
|
searchParams.put("templateId", templateInfo.getId());
|
|
|
|
|
|
List<TemplateOption> templateOptionList = templateOptionService.findByTemplateIdAndLen(templateInfo.getId(), 1);
|
|
|
@@ -834,79 +844,56 @@ public class FundIncomeInfoController {
|
|
|
|
|
|
Map<String, BigDecimal> mapSum = fundIncomeInfoService.sumBudgetRevenue(templateOption.getSerialNum() + ".%", startDate, endDate, templateInfo.getId());
|
|
|
|
|
|
- String sumCurBudgetRevenue = mapSum.get("sumCurBudgetRevenue").toString();
|
|
|
+ BigDecimal sumCurBudgetRevenue = BigDecimal.ZERO;
|
|
|
+ if (mapSum.get("sumCurBudgetRevenue") != null) {
|
|
|
+ sumCurBudgetRevenue = new BigDecimal(mapSum.get("sumCurBudgetRevenue").toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal sumCurMonthReceived = BigDecimal.ZERO;
|
|
|
+ if (mapSum.get("sumCurMonthReceived") != null) {
|
|
|
+ sumCurMonthReceived = new BigDecimal(mapSum.get("sumCurMonthReceived").toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ map1.put("curMonthReceived", sumCurMonthReceived);
|
|
|
|
|
|
map1.put("curBudgetRevenue", sumCurBudgetRevenue);
|
|
|
|
|
|
+ Map<String, BigDecimal> accSumMap = fundIncomeInfoService.sumBudgetRevenue(templateOption.getSerialNum() + "%", startYearDate, endDate, templateOption.getTemplateId());
|
|
|
+
|
|
|
+ BigDecimal actualTotalRevenue = BigDecimal.ZERO;
|
|
|
+ if (accSumMap.get("sumCurMonthReceived") != null) {
|
|
|
+ actualTotalRevenue = new BigDecimal(accSumMap.get("sumCurMonthReceived").toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ map1.put("actualTotalRevenue", actualTotalRevenue);
|
|
|
+
|
|
|
+
|
|
|
//总体汇总金额
|
|
|
- BigDecimal totalSum1 = new BigDecimal(sumCurBudgetRevenue);
|
|
|
- totalSum = totalSum.add(totalSum1);
|
|
|
-
|
|
|
- List<Map> mapList2 = new ArrayList<>();
|
|
|
-
|
|
|
-// searchParams.put("serialNum", templateOption.getSerialNum() + ".%");
|
|
|
-//
|
|
|
-// Page<FundIncomeInfo> page = fundIncomeInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
-// for (FundIncomeInfo fundIncomeInfo : page.getResult()) {
|
|
|
-// if (!fundIncomeInfo.getIsSum()) {
|
|
|
-// Map map2 = new HashMap();
|
|
|
-// map2.put("id", fundIncomeInfo.getId());
|
|
|
-// map2.put("serialNum", fundIncomeInfo.getSerialNumber());
|
|
|
-// map2.put("name", fundIncomeInfo.getName());
|
|
|
-// BigDecimal curBudgetRevenue = fundIncomeInfo.getCurBudgetRevenue();
|
|
|
-//
|
|
|
-// map2.put("curBudgetRevenue", curBudgetRevenue);
|
|
|
-//
|
|
|
-// BigDecimal curMonthReceived = BigDecimal.ZERO;
|
|
|
-//
|
|
|
-// if (fundIncomeInfo.getCurMonthReceived() != null) {
|
|
|
-// curMonthReceived = fundIncomeInfo.getCurMonthReceived();
|
|
|
-// }
|
|
|
-//
|
|
|
-// map2.put("curMonthReceived", curMonthReceived);
|
|
|
-//
|
|
|
-// BigDecimal actualTotalRevenue = fundIncomeInfoService.sumBySerialNumber(fundIncomeInfo.getSerialNumber(), curMonth, templateInfo.getId());
|
|
|
-// map2.put("actualTotalRevenue", actualTotalRevenue);
|
|
|
-//
|
|
|
-// BigDecimal accumulatedArrears = fundIncomeInfo.getCurBudgetRevenue();
|
|
|
-// if (actualTotalRevenue != null && accumulatedArrears != null) {
|
|
|
-// accumulatedArrears = accumulatedArrears.subtract(actualTotalRevenue);
|
|
|
-// }
|
|
|
-//
|
|
|
-// //累计欠费
|
|
|
-// map2.put("accumulatedArrears", accumulatedArrears);
|
|
|
-//
|
|
|
-// //累计欠费合计
|
|
|
-// if (accumulatedArrears.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
-// accumulatedArrearsSum = accumulatedArrearsSum.add(accumulatedArrears);
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// BigDecimal percentage = BigDecimal.ZERO;
|
|
|
-//
|
|
|
-// if (actualTotalRevenue != null && curBudgetRevenue != null) {
|
|
|
-// if (actualTotalRevenue.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
-// if (actualTotalRevenue.compareTo(curBudgetRevenue) < 1) {
|
|
|
-// percentage = actualTotalRevenue.divide(curBudgetRevenue, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
-// } else {
|
|
|
-// percentage = BigDecimal.valueOf(100);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// map2.put("percentage", percentage);
|
|
|
-//
|
|
|
-// mapList2.add(map2);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
- map1.put("accumulatedArrears", accumulatedArrearsSum);
|
|
|
+ totalCurMonthReceived = totalCurMonthReceived.add(sumCurMonthReceived);
|
|
|
+ totalSum = totalSum.add(sumCurBudgetRevenue);
|
|
|
+ totalActualTotalRevenue = totalActualTotalRevenue.add(actualTotalRevenue);
|
|
|
+
|
|
|
+ BigDecimal accumulatedArrears = BigDecimal.ZERO;
|
|
|
+ if (sumCurBudgetRevenue != null && actualTotalRevenue != null) {
|
|
|
+ accumulatedArrears = sumCurBudgetRevenue.subtract(actualTotalRevenue);
|
|
|
+ }
|
|
|
+ map1.put("accumulatedArrears", accumulatedArrears);
|
|
|
|
|
|
accumulatedArrearsTotalSum = accumulatedArrearsTotalSum.add(accumulatedArrearsSum);
|
|
|
|
|
|
- mapList2 = getChildTemplateOption(templateOption.getTemplateId(), templateOption.getSerialNum(), curMonth, startDate, endDate);
|
|
|
+ BigDecimal percentage = BigDecimal.ZERO;
|
|
|
+
|
|
|
+ if (sumCurBudgetRevenue != null && actualTotalRevenue != null) {
|
|
|
+ if (sumCurBudgetRevenue.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ percentage = actualTotalRevenue.divide(sumCurBudgetRevenue, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map1.put("percentage", percentage);
|
|
|
|
|
|
|
|
|
+ List<Map> mapList2 = getChildTemplateOption(templateOption.getTemplateId(), templateOption.getSerialNum(), curMonth, startDate, endDate, startYearDate);
|
|
|
+
|
|
|
map1.put("children", mapList2);
|
|
|
|
|
|
mapList1.add(map1);
|
|
|
@@ -914,23 +901,37 @@ public class FundIncomeInfoController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- map.put("accumulatedArrears", accumulatedArrearsTotalSum);
|
|
|
+ //map.put("accumulatedArrears", accumulatedArrearsTotalSum);
|
|
|
map.put("curBudgetRevenue", totalSum);
|
|
|
|
|
|
+ map.put("curMonthReceived", totalCurMonthReceived);
|
|
|
+
|
|
|
+ map.put("actualTotalRevenue", totalActualTotalRevenue);
|
|
|
+
|
|
|
+ curMonthReceivedTotal = curMonthReceivedTotal.add(totalCurMonthReceived);
|
|
|
+
|
|
|
+ curBudgetRevenueTotal = curBudgetRevenueTotal.add(totalSum);
|
|
|
+
|
|
|
+ actualTotalRevenueTotal = actualTotalRevenueTotal.add(totalActualTotalRevenue);
|
|
|
+
|
|
|
BigDecimal percentage = BigDecimal.ZERO;
|
|
|
|
|
|
if (totalSum != null && accumulatedArrearsTotalSum != null) {
|
|
|
- BigDecimal tempDec = totalSum.subtract(accumulatedArrearsTotalSum);
|
|
|
-
|
|
|
- if (tempDec.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
- percentage = tempDec.divide(totalSum, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
+ if (totalSum.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ percentage = totalActualTotalRevenue.divide(totalSum, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
map.put("percentage", percentage);
|
|
|
|
|
|
- curBudgetRevenueTotal = curBudgetRevenueTotal.add(totalSum);
|
|
|
- accumulatedArrearsTotal = accumulatedArrearsTotal.add(accumulatedArrearsTotalSum);
|
|
|
+
|
|
|
+ BigDecimal accumulatedArrears = BigDecimal.ZERO;
|
|
|
+ if (totalSum != null && totalActualTotalRevenue != null) {
|
|
|
+ accumulatedArrears = totalSum.subtract(totalActualTotalRevenue);
|
|
|
+ }
|
|
|
+ map.put("accumulatedArrears", accumulatedArrears);
|
|
|
+
|
|
|
+ accumulatedArrearsTotal = accumulatedArrearsTotal.add(accumulatedArrears);
|
|
|
|
|
|
map.put("children", mapList1);
|
|
|
|
|
|
@@ -944,14 +945,14 @@ public class FundIncomeInfoController {
|
|
|
map.put("name", "总计");
|
|
|
map.put("curBudgetRevenue", curBudgetRevenueTotal);
|
|
|
map.put("accumulatedArrears", accumulatedArrearsTotal);
|
|
|
+ map.put("actualTotalRevenue", actualTotalRevenueTotal);
|
|
|
+ map.put("curMonthReceived", curMonthReceivedTotal);
|
|
|
|
|
|
BigDecimal percentage = BigDecimal.ZERO;
|
|
|
|
|
|
- if (curBudgetRevenueTotal != null && accumulatedArrearsTotal != null) {
|
|
|
- BigDecimal tempDec = curBudgetRevenueTotal.subtract(accumulatedArrearsTotal);
|
|
|
-
|
|
|
- if (tempDec.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
- percentage = tempDec.divide(curBudgetRevenueTotal, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
+ if (curBudgetRevenueTotal != null && actualTotalRevenueTotal != null) {
|
|
|
+ if (curBudgetRevenueTotal.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ percentage = actualTotalRevenueTotal.divide(curBudgetRevenueTotal, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -979,7 +980,8 @@ public class FundIncomeInfoController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private List<Map> getChildTemplateOption(String id, String serialNum, String curMonth, String startDate, String endDate) {
|
|
|
+ private List<Map> getChildTemplateOption(String id, String serialNum, String curMonth, String startDate, String endDate, String startYearDate) {
|
|
|
+
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
|
|
|
List<TemplateOption> templateOptionList = templateOptionService.findByTemplateIdAndNum(id, serialNum + "%", serialNum.length() + 2);
|
|
|
@@ -996,38 +998,111 @@ public class FundIncomeInfoController {
|
|
|
map.put("isSum2", item.getIsSum());
|
|
|
map.put("serialNum", item.getSerialNum());
|
|
|
|
|
|
+
|
|
|
if (item.getIsSum()) {
|
|
|
+ //为合计行数据
|
|
|
Map<String, BigDecimal> sumMap = fundIncomeInfoService.sumBudgetRevenue(item.getSerialNum() + "%", startDate, endDate, item.getTemplateId());
|
|
|
|
|
|
- String sumCurBudgetRevenue = sumMap.get("sumCurBudgetRevenue").toString();
|
|
|
+ BigDecimal sumCurBudgetRevenue = BigDecimal.ZERO;
|
|
|
+ if (sumMap.get("sumCurBudgetRevenue") != null) {
|
|
|
+ sumCurBudgetRevenue = new BigDecimal(sumMap.get("sumCurBudgetRevenue").toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal sumCurMonthReceived = BigDecimal.ZERO;
|
|
|
+ if (sumMap.get("sumCurMonthReceived") != null) {
|
|
|
+ sumCurMonthReceived = new BigDecimal(sumMap.get("sumCurMonthReceived").toString());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ map.put("curMonthReceived", sumCurMonthReceived);
|
|
|
|
|
|
map.put("curBudgetRevenue", sumCurBudgetRevenue);
|
|
|
|
|
|
- List<Map> mapChildList = getChildTemplateOption(item.getTemplateId(), item.getSerialNum(), curMonth, startDate, endDate);
|
|
|
- map.put("children", mapChildList);
|
|
|
+ Map<String, BigDecimal> accSumMap = fundIncomeInfoService.sumBudgetRevenue(item.getSerialNum() + "%", startYearDate, endDate, item.getTemplateId());
|
|
|
+
|
|
|
+ BigDecimal actualTotalRevenue = BigDecimal.ZERO;
|
|
|
+ if (accSumMap.get("sumCurMonthReceived") != null) {
|
|
|
+ actualTotalRevenue = new BigDecimal(accSumMap.get("sumCurMonthReceived").toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("actualTotalRevenue", actualTotalRevenue);
|
|
|
+
|
|
|
+ BigDecimal accumulatedArrears = BigDecimal.ZERO;
|
|
|
+ if (sumCurBudgetRevenue != null && actualTotalRevenue != null) {
|
|
|
+ accumulatedArrears = sumCurBudgetRevenue.subtract(actualTotalRevenue);
|
|
|
+ }
|
|
|
+ map.put("accumulatedArrears", accumulatedArrears);
|
|
|
+
|
|
|
+ BigDecimal percentage = BigDecimal.ZERO;
|
|
|
+
|
|
|
+ if (sumCurBudgetRevenue != null && accumulatedArrears != null) {
|
|
|
+ BigDecimal tempDec = sumCurBudgetRevenue.subtract(accumulatedArrears);
|
|
|
+
|
|
|
+ if (sumCurBudgetRevenue.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ percentage = tempDec.divide(sumCurBudgetRevenue, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("percentage", percentage);
|
|
|
+
|
|
|
+ List<Map> mapList2 = getChildTemplateOption(item.getTemplateId(), item.getSerialNum(), curMonth, startDate, endDate, startYearDate);
|
|
|
+
|
|
|
+ map.put("children", mapList2);
|
|
|
+
|
|
|
} else {
|
|
|
+ //为子项数据
|
|
|
|
|
|
Map<String, BigDecimal> sumMap = fundIncomeInfoService.sumBudgetRevenue(item.getSerialNum(), startDate, endDate, item.getTemplateId());
|
|
|
|
|
|
- BigDecimal curMonthReceived = fundIncomeInfoService.sumByTemplateOptionId(item.getId(),startDate,endDate);
|
|
|
+ BigDecimal curMonthReceived = fundIncomeInfoService.sumByTemplateOptionId(item.getId(), startDate, endDate);
|
|
|
|
|
|
//本月到账
|
|
|
map.put("curMonthReceived", curMonthReceived);
|
|
|
|
|
|
- String sumCurBudgetRevenue = sumMap.get("sumCurBudgetRevenue").toString();
|
|
|
-
|
|
|
//预算收入
|
|
|
+ BigDecimal sumCurBudgetRevenue = BigDecimal.ZERO;
|
|
|
+ if (sumMap.get("sumCurBudgetRevenue") != null) {
|
|
|
+ sumCurBudgetRevenue = new BigDecimal(sumMap.get("sumCurBudgetRevenue").toString());
|
|
|
+ }
|
|
|
map.put("curBudgetRevenue", sumCurBudgetRevenue);
|
|
|
|
|
|
BigDecimal actualTotalRevenue = fundIncomeInfoService.sumBySerialNumber(item.getSerialNum(), curMonth, item.getTemplateId());
|
|
|
|
|
|
//实际总收入
|
|
|
map.put("actualTotalRevenue", actualTotalRevenue);
|
|
|
+
|
|
|
+
|
|
|
+ BigDecimal accumulatedArrears = BigDecimal.ZERO;
|
|
|
+ if (sumCurBudgetRevenue != null) {
|
|
|
+ if (actualTotalRevenue != null) {
|
|
|
+ accumulatedArrears = sumCurBudgetRevenue.subtract(actualTotalRevenue);
|
|
|
+ } else {
|
|
|
+ accumulatedArrears = sumCurBudgetRevenue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //累计欠费
|
|
|
+ map.put("accumulatedArrears", accumulatedArrears);
|
|
|
+
|
|
|
+
|
|
|
+ BigDecimal percentage = BigDecimal.ZERO;
|
|
|
+ if (sumCurBudgetRevenue != null) {
|
|
|
+ if (sumCurBudgetRevenue.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ percentage = actualTotalRevenue.divide(sumCurBudgetRevenue, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //完成比例
|
|
|
+ if (percentage.compareTo(new BigDecimal(100)) == 1) {
|
|
|
+ percentage = new BigDecimal(100);
|
|
|
+ }
|
|
|
+ map.put("percentage", percentage);
|
|
|
}
|
|
|
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
return mapList;
|
|
|
}
|
|
|
|
|
|
@@ -1049,15 +1124,17 @@ public class FundIncomeInfoController {
|
|
|
Cell cell = rowTitle.createCell(i);
|
|
|
cell.setCellValue(titles[i]);
|
|
|
}
|
|
|
- int addRow = 1;
|
|
|
+
|
|
|
+ AddRowDTO addRow = new AddRowDTO();
|
|
|
+ addRow.setRows(1);
|
|
|
|
|
|
for (int i = 0; i < mapList.size(); i++) {
|
|
|
Map<String, Object> map = mapList.get(i);
|
|
|
|
|
|
- Row row = sheet.createRow(addRow);
|
|
|
+ Row row = sheet.createRow(addRow.getRows());
|
|
|
|
|
|
int colIndex = 0;
|
|
|
- row.createCell(colIndex++).setCellValue(addRow);
|
|
|
+ row.createCell(colIndex++).setCellValue(addRow.getRows());
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("serialNum"), ""));
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("name"), ""));
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("curBudgetRevenue"), ""));
|
|
|
@@ -1065,51 +1142,12 @@ public class FundIncomeInfoController {
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("actualTotalRevenue"), ""));
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("accumulatedArrears"), ""));
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("percentage"), ""));
|
|
|
- addRow++;
|
|
|
-
|
|
|
- if (map.get("children") != null) {
|
|
|
- List<Map> mapList1 = (List<Map>) map.get("children");
|
|
|
- for (int j = 0; j < mapList1.size(); j++) {
|
|
|
- Map<String, Object> map1 = mapList1.get(j);
|
|
|
- Row rowChild = sheet.createRow(addRow);
|
|
|
-
|
|
|
- int colIndexChild = 0;
|
|
|
-
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(addRow);
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map1.get("serialNum"), ""));
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map1.get("name"), ""));
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map1.get("curBudgetRevenue"), ""));
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map1.get("curMonthReceived"), ""));
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map1.get("actualTotalRevenue"), ""));
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map1.get("accumulatedArrears"), ""));
|
|
|
- rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map1.get("percentage"), ""));
|
|
|
- addRow++;
|
|
|
-
|
|
|
- if (map1.get("children") != null) {
|
|
|
- List<Map> mapList2 = (List<Map>) map1.get("children");
|
|
|
-
|
|
|
- for (int k = 0; k < mapList2.size(); k++) {
|
|
|
- Map<String, Object> map2 = mapList2.get(k);
|
|
|
- Row rowChild2 = sheet.createRow(addRow);
|
|
|
-
|
|
|
- int colIndexChild2 = 0;
|
|
|
-
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(addRow);
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("serialNum"), ""));
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("name"), ""));
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("curBudgetRevenue"), ""));
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("curMonthReceived"), ""));
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("actualTotalRevenue"), ""));
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("accumulatedArrears"), ""));
|
|
|
- rowChild2.createCell(colIndexChild2++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("percentage"), ""));
|
|
|
- addRow++;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
+ addRow.setRows(addRow.getRows() + 1);
|
|
|
|
|
|
+ if (map.get("children") != null) {
|
|
|
+ writeDataToExcel(sheet, map, addRow);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
@@ -1129,6 +1167,34 @@ public class FundIncomeInfoController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ private void writeDataToExcel(Sheet sheet, Map map, AddRowDTO addRow) {
|
|
|
+ List<Map> mapList = (List<Map>) map.get("children");
|
|
|
+
|
|
|
+ for (int k = 0; k < mapList.size(); k++) {
|
|
|
+ Map<String, Object> map2 = mapList.get(k);
|
|
|
+ Row rowChild = sheet.createRow(addRow.getRows());
|
|
|
+
|
|
|
+ int colIndexChild = 0;
|
|
|
+
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(addRow.getRows());
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("serialNum"), ""));
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("name"), ""));
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("curBudgetRevenue"), ""));
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("curMonthReceived"), ""));
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("actualTotalRevenue"), ""));
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("accumulatedArrears"), ""));
|
|
|
+ rowChild.createCell(colIndexChild++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map2.get("percentage"), ""));
|
|
|
+
|
|
|
+ addRow.setRows(addRow.getRows() + 1);
|
|
|
+
|
|
|
+ if (map2.get("children") != null) {
|
|
|
+ writeDataToExcel(sheet, map2, addRow);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private String dateFormate(String str) {
|
|
|
//String s="45292.0"; //举例日期为2024-01-01 / 45292.0
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|