This commit is contained in:
zhuyy 2023-07-20 15:53:41 +08:00
parent f1eaea8fe0
commit 6cf13d7c03
2 changed files with 9 additions and 6 deletions

View File

@ -261,6 +261,11 @@
<version>6.1.0</version>
</dependency>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.doc.free</artifactId>
<version>5.2.0</version>
</dependency>
</dependencies>
<build>

View File

@ -143,17 +143,15 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
if (StrUtil.isBlank(id)) {
throw new ResultException("id不能为空");
}
File uploadFile = new File(filepath);
String wordDir = "";
if (!uploadFile.exists()) {
uploadFile.mkdirs();
}
if (!filepath.endsWith("/")) {
wordDir = filepath + "/upload/word";
wordDir = "/upload/word";
}
File tf = null;
try {
tf = new File(URLDecoder.decode(Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResource("doc/象山县国有企业人员招聘报备表.docx")).getPath(), "UTF-8"));
// 获取模板路径
tf = new File(URLDecoder.decode(Objects.requireNonNull(
Thread.currentThread().getContextClassLoader().getResource("doc/象山县国有企业人员招聘报备表.docx")).getPath(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}