| | |
| | | } |
| | | |
| | | //获取模板路径 |
| | | String templatePath = fileService.getTemplateFilePath(); |
| | | String templatePath = fileService.getFileSavePath("TEMPLATE"); |
| | | File file = new File(templatePath + templateName); |
| | | if (!file.exists()) { |
| | | log.error("模板文件不存在,不执行导出!"); |
| | |
| | | } |
| | | |
| | | //获取文件保存路径,以库区分开 |
| | | String savePath = fileService.getWordPath(null); |
| | | String savePath = fileService.getFileSavePath(null); |
| | | |
| | | param.setTemplatePath(templatePath); |
| | | param.setTemplateName(templateName); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 渲染模板保存并下载 |
| | | * |
| | | * @param response |
| | | */ |
| | | public void downloadInoutExcel(HttpServletResponse response) { |
| | | try { |
| | | |
| | | String savePath = fileService.getFileSavePath("TEMPLATE"); |
| | | String templateName = "出入库数据模板.xlsx"; |
| | | |
| | | //下载文档 |
| | | WordUtil.download(savePath, templateName, response); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("下载文件失败", e); |
| | | } |
| | | } |
| | | |
| | | } |