700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 导出压缩包zip 导出文件

导出压缩包zip 导出文件

时间:2021-03-15 01:37:07

相关推荐

导出压缩包zip 导出文件

/*** 导出报告*/@GetMapping("/report")@ApiOperationSupport(order = 17)@ApiOperation(value = "导出报告", notes = "传入ids")public void exportReport(@RequestParam String ids, HttpServletResponse response) {List<FlangeJoint> joints = flangeJointService.listByIds(Func.toLongList(ids));String uuid = UUID.randomUUID().toString();ClassPathResource classPathResource = new ClassPathResource("templates/report-tpl.xlsx");Path zipPath = Paths.get(pathProperties.getReport(), uuid+".zip");File zipFile = zipPath.toFile();if(zipFile.exists()){zipFile.delete();//如果文件存在则先删除旧的文件}List<File> files = null;try{if(!zipFile.getParentFile().exists()){Files.createDirectories(zipPath.getParent());}//if(!zipFile.exists()){//Files.createFile(zipPath);//}files = joints.stream().filter(j -> j.getStat

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。