Commit 86a18cdd authored by 赵啸非's avatar 赵啸非

修复部分sqlXml生成缺陷

parent 52c20b14
...@@ -211,6 +211,12 @@ ...@@ -211,6 +211,12 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
<executions> <executions>
<execution> <execution>
<id>copy-bin</id> <id>copy-bin</id>
......
...@@ -38,10 +38,7 @@ import org.springframework.stereotype.Service; ...@@ -38,10 +38,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayOutputStream; import java.io.*;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -648,8 +645,10 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge ...@@ -648,8 +645,10 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
XWPFTemplate template = null; XWPFTemplate template = null;
ByteArrayOutputStream byteArrayOutputStream = null; ByteArrayOutputStream byteArrayOutputStream = null;
try { try {
ClassPathResource classPathResource = new ClassPathResource("template/doc/base.docx");
template = XWPFTemplate.compile(classPathResource.getInputStream(), config).render(data); InputStream in = this.getClass().getResourceAsStream("/template/doc/base.docx");
// ClassPathResource classPathResource = new ClassPathResource("template/doc/base.docx");
template = XWPFTemplate.compile(in, config).render(data);
byteArrayOutputStream = new ByteArrayOutputStream(); byteArrayOutputStream = new ByteArrayOutputStream();
template.write(byteArrayOutputStream); template.write(byteArrayOutputStream);
return byteArrayOutputStream.toByteArray(); return byteArrayOutputStream.toByteArray();
......
...@@ -72,6 +72,10 @@ ...@@ -72,6 +72,10 @@
<configuration> <configuration>
<delimiters>@</delimiters> <delimiters>@</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters> <useDefaultDelimiters>false</useDefaultDelimiters>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration> </configuration>
</plugin> </plugin>
<!-- 用于编译的plugin --> <!-- 用于编译的plugin -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment