From de02e2ab7f6b63ce92f712bf81de829c97289ca8 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期三, 15 十一月 2023 15:50:23 +0800
Subject: [PATCH] Changes
---
core/src/main/java/com/zt/life/export/service/WordFileService.java | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/com/zt/life/export/service/WordFileService.java b/core/src/main/java/com/zt/life/export/service/WordFileService.java
index d1b3f77..006db00 100644
--- a/core/src/main/java/com/zt/life/export/service/WordFileService.java
+++ b/core/src/main/java/com/zt/life/export/service/WordFileService.java
@@ -8,6 +8,7 @@
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import com.zt.life.export.dto.WordFile;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -19,16 +20,19 @@
@Service
public class WordFileService {
+ @Value("${zt.oss.local-path}")
+ private String localPath;
+
public void exportWordFile(HttpServletRequest request, Object dataObj, WordFile wordFile, HttpServletResponse response) throws UnsupportedEncodingException, FileNotFoundException {
// 鏁版嵁map闆嗗悎
Map<String, Object> wordData = new HashMap<>();
//HackLoopTableRenderPolicy hackLoopTableRenderPolicy = new HackLoopTableRenderPolicy();
Configure config = null;
ConfigureBuilder builder = Configure.newBuilder();
- this.formatWordData(wordFile, wordData, builder);
+ this.formatWordData(dataObj, wordData, builder);
config = builder.build();
- File fl = new File(wordFile.getModulePath());
+ File fl = new File(localPath+"/template/"+wordFile.getModulePath());
FileInputStream fs = new FileInputStream(fl);
XWPFTemplate template;
if (config != null) {
--
Gitblit v1.9.1