From 9104573730e4d34625cd4a671cc42ded9ebb37af Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 09 十二月 2025 17:27:01 +0800
Subject: [PATCH] 模板修改
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/freemark/TemplateCreateController.java | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/freemark/TemplateCreateController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/freemark/TemplateCreateController.java
index c899595..cf15cfb 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/freemark/TemplateCreateController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/freemark/TemplateCreateController.java
@@ -41,6 +41,8 @@
public TemplateCreateController() {
configuration = new Configuration();
configuration.setDefaultEncoding("utf-8");
+ // 浣跨敤classpath鍔犺浇妯℃澘锛岃�屼笉鏄枃浠剁郴缁�
+ configuration.setClassForTemplateLoading(this.getClass(), "/template");
}
@@ -54,8 +56,6 @@
AppointmentDO appointment = appointmentService.getAppointment(id);
getData(dataMap, appointment);
- String filePath = getClass().getResource("/template/").getPath();
- configuration.setDirectoryForTemplateLoading(new File(filePath));
// 纭繚妯℃澘鏄疻ord XML鏍煎紡
Template t = configuration.getTemplate("鐭ユ儏鍚屾剰杩愬姩璇曢獙.ftl");
@@ -105,8 +105,6 @@
AppointmentDO appointment = appointmentService.getAppointment(id);
getData(dataMap, appointment);
- String filePath = getClass().getResource("/template/").getPath();
- configuration.setDirectoryForTemplateLoading(new File(filePath));
// 纭繚妯℃澘鏄疻ord XML鏍煎紡
Template t = configuration.getTemplate("椋熺蹇冭剰鐢电敓鐞嗙煡鎯呭悓鎰忎功.ftl");
--
Gitblit v1.9.3