liusheng
6 天以前 9104573730e4d34625cd4a671cc42ded9ebb37af
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));
            // 确保模板是Word XML格式
            Template t = configuration.getTemplate("知情同意运动试验.ftl");
@@ -96,7 +96,7 @@
    }
    @Operation(summary = "食管心脏电生理知情同意书")
    @GetMapping(value = "/downloadEsophagus/{id}")
    @GetMapping(value = "/downloadesophagus/{id}")
    public Map<String, Object> downloadEsophagusInfo(@PathVariable("id") Long id) {
        log.info("食管心脏电生理知情同意书:{}", id);
@@ -105,8 +105,6 @@
            AppointmentDO appointment = appointmentService.getAppointment(id);
            getData(dataMap, appointment);
            String filePath = getClass().getResource("/template/").getPath();
            configuration.setDirectoryForTemplateLoading(new File(filePath));
            // 确保模板是Word XML格式
            Template t = configuration.getTemplate("食管心脏电生理知情同意书.ftl");