把模板放到resources中
This commit is contained in:
-1
@@ -231,7 +231,6 @@ public class DummyInventoryInfoEOEn implements Serializable {
|
||||
private String verifyDeliverableType;
|
||||
|
||||
/**验证符合性确认-交付物模板*/
|
||||
|
||||
@ApiModelProperty(value = "验证符合性确认-交付物模板")
|
||||
private String verifyDeliverableTemplate;
|
||||
|
||||
|
||||
+22
-2
@@ -5322,7 +5322,6 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
*/
|
||||
@Override
|
||||
public void downloadDocxReport(Map<String, Object> params, HttpServletRequest req, HttpServletResponse resp) {
|
||||
File templateFile = null;
|
||||
File exportFile = null;
|
||||
InputStream fin = null;
|
||||
ServletOutputStream out = null;
|
||||
@@ -5463,7 +5462,27 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
dataMap.put("REGULATION_ENG", StringUtils.isNotEmpty(regulationOwnerName) ? regulationOwnerName : "");
|
||||
log.debug("导出word报告,查询数据结束 =============================================================================");
|
||||
log.debug("导出word报告,获取模板开始 =============================================================================");
|
||||
templateFile = new File(exportPdfTempPath + "temp/ComplianceReportTemplate.docx");
|
||||
File templateFile = new File(exportPdfTempPath + "temp/ComplianceReportTemplate.docx");
|
||||
InputStream inputStream = ProjectLawsInventoryEOServiceImpl.class.getClassLoader().getResourceAsStream("exportPdfTemp/ComplianceReportTemplate.docx");
|
||||
try {
|
||||
FileUtils.copyInputStreamToFile(inputStream, templateFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//
|
||||
// try {
|
||||
// OutputStream os = new FileOutputStream(templateFile);
|
||||
// int bytesRead = 0;
|
||||
// byte[] buffer = new byte[8192];
|
||||
// while ((bytesRead = inputStream.read(buffer, 0, 8192)) != -1) {
|
||||
// os.write(buffer, 0, bytesRead);
|
||||
// }
|
||||
// os.close();
|
||||
// inputStream.close();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
log.debug("导出word报告,获取模板结束 =============================================================================");
|
||||
if(templateFile != null){
|
||||
try {
|
||||
@@ -5479,6 +5498,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
exportFile = new File(outFile);
|
||||
FileOutputStream os = new FileOutputStream(outFile);
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new FileInputStream(templateFile));
|
||||
// WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(inputStream);
|
||||
|
||||
//验证符合性流程实例id
|
||||
String verifyPId = projectTaskInventoryEO.getVerifyPId();
|
||||
|
||||
BIN
Binary file not shown.
@@ -355,6 +355,9 @@
|
||||
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
Reference in New Issue
Block a user