소스 검색

【CHG】修改加载模板方法

zhaomn 3 년 전
부모
커밋
d3245c4211
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      railway-common/src/main/java/com/railway/common/utils/poi/EasyExcelUtil.java

+ 1 - 2
railway-common/src/main/java/com/railway/common/utils/poi/EasyExcelUtil.java

@@ -22,8 +22,7 @@ public class EasyExcelUtil {
   public String getExcel(Map<String, Object> params, List<?> list,
       String template, String wordName) {
     String filePath = FileUploadUtils.getAbsoluteFileEncoding(wordName);
-    try (InputStream is = Thread.currentThread().getContextClassLoader()
-        .getResourceAsStream(template);
+    try (InputStream is = new FileInputStream(template);
         OutputStream os = new FileOutputStream(filePath)) {
       WriteSheet writeSheet = EasyExcel.writerSheet().build();
       ExcelWriter excelWriter = EasyExcel.write(os).withTemplate(is)