From 0fa1f4767affcd1879709ebea630016356836c75 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 18 九月 2026 15:07:20 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/ecg

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/freemark/TemplateCreateController.java |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 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..69b6d14 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");
@@ -153,7 +151,18 @@
         dataMap.put("age", appointment.getPatBirthday() == null ? "" : calculateAge(appointment.getPatBirthday()));
         dataMap.put("inhospno", StringUtils.isEmpty(appointment.getHospitalNo()) ? "" : appointment.getHospitalNo());
         dataMap.put("idNo", StringUtils.isEmpty(appointment.getPatId()) ? "" : appointment.getPatId());
-        dataMap.put("badNo", StringUtils.isEmpty(appointment.getPatBedNo()) ? "" : appointment.getPatBedNo());
+        String ward = StringUtils.isEmpty(appointment.getPatWardDesc()) ? "" : appointment.getPatWardDesc();
+        String bed = StringUtils.isEmpty(appointment.getPatBedNo()) ? "" : appointment.getPatBedNo();
+
+        // 濡傛灉涓や釜閮芥湁鍊硷紝涓棿鍔犵┖鏍硷紱濡傛灉鍙湁涓�涓湁鍊硷紝灏变笉鍔犵┖鏍�
+        String badNo = "";
+        if (!ward.isEmpty() && !bed.isEmpty()) {
+            badNo = ward + " " + bed;
+        } else {
+            badNo = ward + bed;
+        }
+        dataMap.put("badNo", badNo);
+
         dataMap.put("birthday", appointment.getPatBirthday() == null ? "" : appointment.getPatBirthday());
         dataMap.put("doctor", StringUtils.isEmpty(appointment.getDoctor()) ? "" : appointment.getDoctor());
         dataMap.put("deptName", StringUtils.isEmpty(appointment.getPatDeptDesc()) ? "" : appointment.getPatDeptDesc());

--
Gitblit v1.9.3