List<TestEntity> exportList=new ArrayList<>();
/*取号人数*/
ExportParams takeExport = new ExportParams();
takeExport.setSheetName("取号人数");
Map<String, Object> takeExportMap = new HashMap<>();
takeExportMap.put("title",takeExport);
// 模版导出对应得实体类型
takeExportMap.put("entity", SenceFetchNumExport.class);
// sheet中要填充得数据
List<Map<String,Object>> takelistmap=analysisRecordMapper.takeNumberCount(start,end);
for(Map takemap:takelistmap){
String obid=(String) takemap.get("onlineBookingId");
if(StringUtils.isNotEmpty(obid)){
OnlineBookingApplyEntity obae= onlineBookingApplyService.getWsfwdtYuyueEntity(obid);
OnlineBookingApplyExport obaeobj=new OnlineBookingApplyExport();
BeanUtils.copyProperties(obae,obaeobj);
takemap.put("obae",obaeobj);
}
}
List<SenceFetchNumExport> sfne= ToolUtils.setList(takelistmap,SenceFetchNumExport.class);
takeExportMap.put("data", sfne);
/*预约人数*/
ExportParams appoExport = new ExportParams();
takeExport.setSheetName("预约人数");
Map<String, Object> appoExportMap = new HashMap<>();
appoExportMap.put("title",appoExport);
// 模版导出对应得实体类型
appoExportMap.put("entity", TestEntity.class);
// sheet中要填充得数据
appoExportMap.put("data", exportList);
/*借档数量*/
ExportParams borrowExport = new ExportParams();
takeExport.setSheetName("借档数量");
Map<String, Object> borrowExportMap = new HashMap<>();
borrowExportMap.put("title",borrowExport);
// 模版导出对应得实体类型
borrowExportMap.put("entity", TestEntity.class);
// sheet中要填充得数据
borrowExportMap.put("data", exportList);
/*还档数量*/
ExportParams repayExport = new ExportParams();
takeExport.setSheetName("还档数量");
Map<String, Object> repayExportMap = new HashMap<>();
repayExportMap.put("title",repayExport);
// 模版导出对应得实体类型
repayExportMap.put("entity", TestEntity.class);
// sheet中要填充得数据
repayExportMap.put("data", exportList);
List<Map<String, Object>> sheetsList=new ArrayList<>();
sheetsList.add(takeExportMap);
sheetsList.add(appoExportMap);
sheetsList.add(borrowExportMap);
sheetsList.add(repayExportMap);
Workbook workbook = ExcelExportUtil.exportExcel(sheetsList, ExcelType.HSSF);
记录
最新推荐文章于 2024-08-21 13:55:04 发布