在这里就上关键代码了,如果有不明白的可以看我之前的文章(https://mp.youkuaiyun.com/console/editor/html/107430199)
/** * 多sheet导出 * @param response 流 * @param list 导出的数据 * @param fileName 表头标题名称 */ public static void exportMoreSheet(HttpServletResponse response,List<Map<String, Object>> list, String fileName) throws IOException { Workbook workbook = null; workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF); if (workbook != null) { downLoadExcel(fileName, response, workbook); } }
业务层
@PostMapping("/export") @ApiOperation(value = "导出物流信息") public void export(@RequestBody SelectDeliveryLogisticsListParamVo param, HttpServletResponse response) { try{ List<Map<String, Object>> sheetsList = new ArrayList<>(); // 获取物流单 List<LogisticsExp