|
@ -132,14 +132,20 @@ public class ExcelUtils { |
|
|
return response.getOutputStream(); |
|
|
return response.getOutputStream(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* desc:easypoi导出多个sheet |
|
|
|
|
|
* @param fileName |
|
|
|
|
|
* @param list |
|
|
|
|
|
* @param response |
|
|
|
|
|
* @throws Exception |
|
|
|
|
|
*/ |
|
|
public static void exportMultiSheetExcel(String fileName, List<ExportMultiView> list, HttpServletResponse response) throws Exception { |
|
|
public static void exportMultiSheetExcel(String fileName, List<ExportMultiView> list, HttpServletResponse response) throws Exception { |
|
|
List<Map<String,Object>> excel = new ArrayList<>(); |
|
|
List<Map<String,Object>> excel = new ArrayList<>(); |
|
|
for(ExportMultiView view :list){ |
|
|
for(ExportMultiView view :list){ |
|
|
Map<String,Object> sheet = new HashMap<>(); |
|
|
Map<String,Object> sheet = new HashMap<>(); |
|
|
sheet.put("title",view.getExportParams()); |
|
|
sheet.put("title",view.getExportParams()); |
|
|
sheet.put("entity",view.getCls()); |
|
|
sheet.put("entity",view.getCls()); |
|
|
List<?> dataList = view.getDataList(); |
|
|
sheet.put("data", view.getDataList()); |
|
|
sheet.put("data", dataList); |
|
|
|
|
|
excel.add(sheet); |
|
|
excel.add(sheet); |
|
|
} |
|
|
} |
|
|
Workbook workbook = ExcelExportUtil.exportExcel(excel, ExcelType.XSSF); |
|
|
Workbook workbook = ExcelExportUtil.exportExcel(excel, ExcelType.XSSF); |
|
|