提案导出修复:导出上会提案表汇总表时替换特殊字符(避免因为/拼接path异常);
This commit is contained in:
+7
-3
@@ -387,9 +387,13 @@ public class proposalExportNotCaseController {
|
||||
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/proposal/proposalSH.docx");
|
||||
|
||||
String docxName = info.getString("proposalCode") + "-" + info.getString("proposalName") + ".docx";
|
||||
|
||||
Path docFile = Files.createFile(proposalSHPath.resolve(docxName));
|
||||
String docxBaseName = (info.getString("proposalCode") + "-" + info.getString("proposalName"))
|
||||
.replaceAll("[/\\\\:*?\"<>|]", "_");
|
||||
Path docFile = proposalSHPath.resolve(docxBaseName + ".docx");
|
||||
if (Files.exists(docFile)) {
|
||||
docFile = proposalSHPath.resolve(docxBaseName + "-" + info.getString("id") + ".docx");
|
||||
}
|
||||
Files.createFile(docFile);
|
||||
|
||||
XWPFTemplate.compile(inputStream, config).render(info).writeToFile(docFile.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user