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

修复部分sqlXml生成缺陷

parent 52c20b14
......@@ -211,6 +211,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
<executions>
<execution>
<id>copy-bin</id>
......
......@@ -38,10 +38,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.io.*;
import java.util.*;
import java.util.List;
import java.util.regex.Pattern;
......@@ -648,8 +645,10 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
XWPFTemplate template = null;
ByteArrayOutputStream byteArrayOutputStream = null;
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();
template.write(byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
......
......@@ -72,6 +72,10 @@
<configuration>
<delimiters>@</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</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