| | |
| | | import org.springblade.common.cache.DictCache; |
| | | import org.springblade.common.config.FtpConfig; |
| | | import org.springblade.common.enums.DictEnum; |
| | | import org.springblade.common.excel.CustomCellWriteHeightConfig; |
| | | import org.springblade.common.excel.CustomCellWriteWeightConfig; |
| | | import org.springblade.common.excel.RowWriteHandler; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.*; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.exam.excel.ExportExamScoreExcel; |
| | | import org.springblade.modules.experience.entity.Experience; |
| | | import org.springblade.modules.experience.service.IExperienceService; |
| | | import org.springblade.modules.jurisdiction.entity.Jurisdiction; |
| | |
| | | // } |
| | | |
| | | /** |
| | | * 导出保安员证信息 |
| | | */ |
| | | @GetMapping("export-security-paper") |
| | | public void exportSecurityPaper(UserVO user, HttpServletResponse response) throws IOException { |
| | | //按条件查询成绩数据 |
| | | List<ExportSecurityPaperExcel> excels = userService.exportSecurityPaperList(user); |
| | | String fileName = null; |
| | | try { |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name()); |
| | | fileName = URLEncoder.encode("保安员证数据", Charsets.UTF_8.name()); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | //修改单元格格式为文本格式 |
| | | EasyExcel.write(response.getOutputStream(), ExportSecurityPaperExcel.class) |
| | | .sheet("保安员证数据表") |
| | | //自定义行高 |
| | | // .registerWriteHandler(new CustomCellWriteHeightConfig()) |
| | | //自定义宽度 |
| | | // .registerWriteHandler(new CustomCellWriteWeightConfig()) |
| | | //写入 |
| | | .doWrite(excels); |
| | | } catch (Throwable var6) { |
| | | throw var6; |
| | | } |
| | | // ExcelUtil.export(response, "保安员证数据" + DateUtil.time(), "保安员证数据表", excels, ExportSecurityPaperExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("export-template") |