From 6d493697ae4bf63c0ce72034e1f1b703081b436f Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期三, 25 十二月 2024 12:08:36 +0800 Subject: [PATCH] 完成截止12.25测试出来的问题 --- cnas-manage/src/main/java/com/yuanchu/mom/service/impl/ManageRecordAuditServiceImpl.java | 18 ++---------------- 1 files changed, 2 insertions(+), 16 deletions(-) diff --git a/cnas-manage/src/main/java/com/yuanchu/mom/service/impl/ManageRecordAuditServiceImpl.java b/cnas-manage/src/main/java/com/yuanchu/mom/service/impl/ManageRecordAuditServiceImpl.java index 78432bf..2a93c4f 100644 --- a/cnas-manage/src/main/java/com/yuanchu/mom/service/impl/ManageRecordAuditServiceImpl.java +++ b/cnas-manage/src/main/java/com/yuanchu/mom/service/impl/ManageRecordAuditServiceImpl.java @@ -150,18 +150,7 @@ record.setCreateUserDepart(limsName); } //鐢熸垚妫�楠屾姤鍛婂彂鏀剧櫥璁拌〃 - String url; - try { - InputStream inputStream = this.getClass().getResourceAsStream("/static/audit-deal.docx"); - File file = File.createTempFile("temp", ".tmp"); - OutputStream outputStream = new FileOutputStream(file); - IOUtils.copy(inputStream, outputStream); - url = file.getAbsolutePath(); - } catch (FileNotFoundException e) { - throw new ErrorException("鎵句笉鍒版ā鏉挎枃浠�"); - } catch (IOException e) { - throw new RuntimeException(e); - } + InputStream inputStream = this.getClass().getResourceAsStream("/static/audit-deal.docx"); ConfigureBuilder builder = Configure.builder(); builder.useSpringEL(true); @@ -530,15 +519,12 @@ tableRenderData.setTableStyle(tableStyle); Map<String, Object> table = new HashMap<>(); table.put("audit", tableRenderData); - table.put("index1", index1); auditList.add(table); index1++; } } - Integer finalIndex = index1; - XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( + XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( new HashMap<String, Object>() {{ - put("size", finalIndex); put("cancelList", auditList); }}); String name = UUID.randomUUID() + "_鏂囦欢淇琛�" + ".docx"; -- Gitblit v1.9.3