|
@@ -905,28 +905,28 @@ public class SubInfoExportController extends BaseController {
|
|
|
ExportParams exportParams = new ExportParams("“四个一批”工业项目表(在建项目库)","在建项目库",ExcelType.XSSF);
|
|
|
exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
exportDetail(response, exportParams, SubInfoZjVO.class, list, hyDictMap, groupMap);
|
|
|
- }else if(SubInfoStatusEnum.TC.getCode().equals(queryVO.getStatus())) {
|
|
|
+ } else if (SubInfoStatusEnum.TC.getCode().equals(queryVO.getStatus())) {
|
|
|
List<SubInfoTcVO> exportList = new ArrayList<>();
|
|
|
// 合计行
|
|
|
SubInfoTcVO hjCount = new SubInfoTcVO();
|
|
|
- hjCount.setIndex(String.format("合计(%s个)",list.size()));
|
|
|
+ hjCount.setIndex(String.format("合计(%s个)", list.size()));
|
|
|
exportList.add(hjCount);
|
|
|
|
|
|
int index = 1;
|
|
|
List<Integer> allSize = new ArrayList<>();
|
|
|
- for (Map.Entry<String, List<SubInfoGxj>> entry : groupMap.entrySet()){
|
|
|
+ for (Map.Entry<String, List<SubInfoGxj>> entry : groupMap.entrySet()) {
|
|
|
String key = entry.getKey();
|
|
|
List<SubInfoGxj> value = entry.getValue();
|
|
|
List<SubInfoTcVO> hyList = new ArrayList<>();
|
|
|
// 行业合计行
|
|
|
SubInfoTcVO hyCount = new SubInfoTcVO();
|
|
|
- hyCount.setIndex(String.format("%s、%s( %s个 )",toChineseNumber(index), hyDictMap.getOrDefault(key, key), value.size()));
|
|
|
+ hyCount.setIndex(String.format("%s、%s( %s个 )", toChineseNumber(index), hyDictMap.getOrDefault(key, key), value.size()));
|
|
|
// 每条数据行
|
|
|
hyList.add(hyCount);
|
|
|
for (int i = 0; i < value.size(); i++) {
|
|
|
SubInfoGxj subInfoGxj = value.get(i);
|
|
|
SubInfoTcVO vo = new SubInfoTcVO();
|
|
|
- BeanUtils.copyProperties(subInfoGxj,vo);
|
|
|
+ BeanUtils.copyProperties(subInfoGxj, vo);
|
|
|
// BigDecimal divide = subInfoGxj.getAmtTotal() != null ? subInfoGxj.getAmtTotal().divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP) : BigDecimal.ZERO;
|
|
|
// vo.setAmtTotal(divide);
|
|
|
vo.setIndex(i + 1 + "");
|
|
@@ -937,33 +937,33 @@ public class SubInfoExportController extends BaseController {
|
|
|
exportList.addAll(hyList);
|
|
|
index++;
|
|
|
}
|
|
|
- ExportParams exportParams = new ExportParams("“四个一批”工业项目表(投产项目库)","投产项目库",ExcelType.XSSF);
|
|
|
+ ExportParams exportParams = new ExportParams("“四个一批”工业项目表(投产项目库)", "投产项目库", ExcelType.XSSF);
|
|
|
exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
// 设置默认样式(这里设置所有单元格都有边框)
|
|
|
workbook = ExcelExportUtil.exportExcel(exportParams, SubInfoTcVO.class, exportList);
|
|
|
extracted(response, list, workbook, allSize);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<SubInfoZkVO> exportList = new ArrayList<>();
|
|
|
// 合计行
|
|
|
SubInfoZkVO hjCount = new SubInfoZkVO();
|
|
|
- hjCount.setIndex(String.format("合计(%s个)",list.size()));
|
|
|
+ hjCount.setIndex(String.format("合计(%s个)", list.size()));
|
|
|
exportList.add(hjCount);
|
|
|
|
|
|
int index = 1;
|
|
|
List<Integer> allSize = new ArrayList<>();
|
|
|
- for (Map.Entry<String, List<SubInfoGxj>> entry : groupMap.entrySet()){
|
|
|
+ for (Map.Entry<String, List<SubInfoGxj>> entry : groupMap.entrySet()) {
|
|
|
String key = entry.getKey();
|
|
|
List<SubInfoGxj> value = entry.getValue();
|
|
|
List<SubInfoZkVO> hyList = new ArrayList<>();
|
|
|
// 行业合计行
|
|
|
SubInfoZkVO hyCount = new SubInfoZkVO();
|
|
|
- hyCount.setIndex(String.format("%s、%s( %s个 )",toChineseNumber(index), hyDictMap.getOrDefault(key, key), value.size()));
|
|
|
+ hyCount.setIndex(String.format("%s、%s( %s个 )", toChineseNumber(index), hyDictMap.getOrDefault(key, key), value.size()));
|
|
|
// 每条数据行
|
|
|
hyList.add(hyCount);
|
|
|
for (int i = 0; i < value.size(); i++) {
|
|
|
SubInfoGxj subInfoGxj = value.get(i);
|
|
|
SubInfoZkVO vo = new SubInfoZkVO();
|
|
|
- BeanUtils.copyProperties(subInfoGxj,vo);
|
|
|
+ BeanUtils.copyProperties(subInfoGxj, vo);
|
|
|
vo.setAmtTotal(convertAmount(subInfoGxj.getAmtTotal()));
|
|
|
vo.setIndex(i + 1 + "");
|
|
|
hyList.add(vo);
|
|
@@ -975,7 +975,7 @@ public class SubInfoExportController extends BaseController {
|
|
|
}
|
|
|
ExportParams exportParams = new ExportParams("“四个一批”工业项目表(项目总库)", "项目总库", ExcelType.XSSF);
|
|
|
exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
- // exportParams.setHeight((short)-1);
|
|
|
+ // exportParams.setHeight((short) -1);
|
|
|
workbook = ExcelExportUtil.exportExcel(exportParams, SubInfoZkVO.class, exportList);
|
|
|
// workbook = ExcelExportUtil.exportBigExcel(exportParams, SubInfoZkVO.class, new IExcelExportServer() {
|
|
|
// /**
|
|
@@ -1066,8 +1066,8 @@ public class SubInfoExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
// 设置自适应行高,i为需要自适应行高的起始行号, 起始行号为3 但是因为下标从0开始3需要减一,因为表格是循环生成,需要一行一行设置自适应高度
|
|
|
- for (int i = 4; i <= list.size() + 3; i++) {
|
|
|
- sheet.getRow(i).setHeight((short) -1);
|
|
|
+ for (int i = 4; i <= list.size() + allSize.size() + 3; i++) {
|
|
|
+ Optional.ofNullable(sheet.getRow(i)).ifPresent(row -> row.setHeight((short) -1));
|
|
|
}
|
|
|
list.clear();
|
|
|
try (OutputStream outputStream = response.getOutputStream()) {
|