|
|
@@ -3,6 +3,7 @@ package com.railway.common.utils.poi;
|
|
|
import com.railway.common.constant.Constants;
|
|
|
import com.railway.common.utils.file.FileUploadUtils;
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
+import java.io.FileInputStream;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
@@ -74,8 +75,7 @@ public class WordUtils {
|
|
|
String template, String wordName) {
|
|
|
String fileName = encodingFilename(wordName);
|
|
|
String filePath = FileUploadUtils.getAbsoluteFile(fileName);
|
|
|
- try (InputStream is = Thread.currentThread().getContextClassLoader()
|
|
|
- .getResourceAsStream(template);
|
|
|
+ try (InputStream is = new FileInputStream(template);
|
|
|
CustomXWPFDocument doc = new CustomXWPFDocument(is);
|
|
|
OutputStream os = new FileOutputStream(filePath)) {
|
|
|
//替换文本里面的变量
|