This commit is contained in:
zhuyy 2023-07-21 08:58:01 +08:00
parent 63ab58093b
commit 0cefd9e67f
1 changed files with 4 additions and 13 deletions

View File

@ -146,16 +146,11 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
File tf = null; File tf = null;
try { try {
// 本地获取模板路径 // 本地获取模板路径
// URL url = ResourceUtils.getURL("classpath:doc/象山县国有企业人员招聘报备表.docx");
// 获取线上模板路径
URL url = ResourceUtils.getURL("/mnt/demo26.ydool.net/doc/象山县国有企业人员招聘报备表.docx"); URL url = ResourceUtils.getURL("/mnt/demo26.ydool.net/doc/象山县国有企业人员招聘报备表.docx");
String filePath = URLDecoder.decode(url.getPath(), "UTF-8"); tf = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
tf = new File(filePath); } catch (UnsupportedEncodingException | FileNotFoundException e) {
System.out.println("tf.getPath() = " + tf.getPath());
// } catch (UnsupportedEncodingException e) {
// throw new RuntimeException(e);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
} catch (FileNotFoundException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
String wordDir = UploadUtils.getWebRoot(); String wordDir = UploadUtils.getWebRoot();
@ -223,9 +218,6 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
e.printStackTrace(); e.printStackTrace();
} }
} }
// 下载
// UploadUtils.download(response, wordDir, pdfFileName);
} }
/** /**
@ -248,7 +240,6 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
dir.mkdirs(); dir.mkdirs();
} }
String savePath = saveDir + fileName; String savePath = saveDir + fileName;
try { try {
XWPFDocument doc = WordExportUtil.exportWord07(templatePath, params); XWPFDocument doc = WordExportUtil.exportWord07(templatePath, params);
FileOutputStream fos = new FileOutputStream(savePath); FileOutputStream fos = new FileOutputStream(savePath);