From 5d6e29cd47762c4dacad7708cbef232414f5b95e Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 29 八月 2023 14:49:02 +0800 Subject: [PATCH] 1 --- src/main/java/com/yssh/service/XlsReportService.java | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yssh/service/XlsReportService.java b/src/main/java/com/yssh/service/XlsReportService.java index 366503e..7af4899 100644 --- a/src/main/java/com/yssh/service/XlsReportService.java +++ b/src/main/java/com/yssh/service/XlsReportService.java @@ -57,6 +57,12 @@ private double bjz; /** + * 鎶ヨ鍊� + */ + @Value("${report.templates}") + private String templates; + + /** * 鑾峰彇瀵煎嚭璺緞 */ private String getExpPath(String type) { @@ -74,9 +80,10 @@ * 鑾峰彇Excel妯℃澘 */ private String getXslTemplate(String type) throws IOException { - ClassPathResource resource = new ClassPathResource(String.format("templates/%s.xlsx", type)); + //ClassPathResource resource = new ClassPathResource(String.format("templates/%s.xlsx", type)); + //return resource.exists() ? resource.getFile().getPath() : null; - return resource.exists() ? resource.getFile().getPath() : null; + return String.format(templates + File.separator + type + ".xlsx"); } /** -- Gitblit v1.9.3