| | |
| | | package cn.gistack.sm.sjztmd.word.util; |
| | | |
| | | import ch.qos.logback.core.pattern.FormatInfo; |
| | | import cn.gistack.sm.sjztmd.vo.StationExport; |
| | | import cn.gistack.sm.sjztmd.word.vo.DzkInfo; |
| | | import cn.gistack.sm.sjztmd.word.vo.OverDetail; |
| | | import cn.gistack.sm.sjztmd.word.vo.TotalInfo; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void createStationExcel(HttpServletResponse response,String title, String fileName, List<StationExport> list ,String templatePath) throws Exception { |
| | | |
| | | HashMap<String,String> map = new HashMap<>(); |
| | | map.put("title",title); |
| | | |
| | | InputStream inputStream = ExcelUtil.class.getClassLoader().getResourceAsStream(templatePath); |
| | | ExcelWriter excelWriter = EasyExcel.write(getOutputStream(fileName, response)).withTemplate(inputStream).excelType(ExcelTypeEnum.XLSX).build(); |
| | | WriteSheet writeSheet1 = EasyExcel.writerSheet().build(); |
| | | |
| | | // 这个传进去的 map 就是非表格数据, |
| | | excelWriter.fill(map, writeSheet1); |
| | | excelWriter.fill(new FillWrapper("data", list), writeSheet1); |
| | | |
| | | excelWriter.finish(); |
| | | } |
| | | } |