From c8cda38da41ce7b36db8adcda8284b148adf91e0 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Mon, 19 Jan 2026 12:51:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A[=E8=AF=95=E9=AA=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StudyFormFillController.java | 10 +---- .../com/hxhq/business/domain/StudyFormFill.java | 48 ++++++++++++++++++++++ .../java/com/hxhq/business/domain/Template.java | 33 +++++++++++++++ .../hxhq/business/utils/pdf/template/SP001.java | 4 +- .../mapper/business/StudyFormFillMapper.xml | 4 +- 5 files changed, 87 insertions(+), 12 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java index 400bc97..e41e938 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java @@ -101,20 +101,14 @@ public class StudyFormFillController extends BaseController { studyFormFillQmxx.setFormId(form.getFormId()); List studyFormFillQmxxList = studyFormFillQmxxService.queryList(studyFormFillQmxx); StudyFormFill studyFormFill=studyFormFillService.queryInfo(form.getFormId()); - Template template=templateService.getById(studyFormFill.getTemplateId()); - if(template!=null){ return AjaxResult.success(localFilePrefix + PdfExportUtil.export( - "com.hxhq.business.utils.pdf.template."+template.getSn(), - "exportDetail", + studyFormFill.getTemplateExportClass(), + studyFormFill.getTemplateExportMethod(), studyFormFill, - template, studyFormFillQmxxList, studyFormFillJcgjList, form.getLang(), localFilePath)); - }else{ - return AjaxResult.error("模板不存在或已删除"); - } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java index 157c6da..fe7e0e8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java @@ -109,10 +109,26 @@ public class StudyFormFill extends MpBaseEntity @Compare(name = "模板名称") private String templateMc; + /** 模板名称-英文 */ + @TableField(exist = false) + private String templateMcEn; + /** 模板编号 */ @TableField(exist = false) private String templateSn; + /** 模板编号 */ + @TableField(exist = false) + private String templateShowSn; + + /** 模板导出类 */ + @TableField(exist = false) + private String templateExportClass; + + /** 模板导出方法 */ + @TableField(exist = false) + private String templateExportMethod; + /** 模板所属部门/学科 */ @TableField(exist = false) private Long templateDeptId; @@ -125,6 +141,38 @@ public class StudyFormFill extends MpBaseEntity @TableField(exist = false) private String studyMc; + public String getTemplateShowSn() { + return templateShowSn; + } + + public void setTemplateShowSn(String templateShowSn) { + this.templateShowSn = templateShowSn; + } + + public String getTemplateExportClass() { + return templateExportClass; + } + + public void setTemplateExportClass(String templateExportClass) { + this.templateExportClass = templateExportClass; + } + + public String getTemplateExportMethod() { + return templateExportMethod; + } + + public void setTemplateExportMethod(String templateExportMethod) { + this.templateExportMethod = templateExportMethod; + } + + public String getTemplateMcEn() { + return templateMcEn; + } + + public void setTemplateMcEn(String templateMcEn) { + this.templateMcEn = templateMcEn; + } + public String getUserMcEn() { return userMcEn; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java index 0825fb7..28001e1 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java @@ -22,6 +22,15 @@ public class Template extends MpBaseEntity /** 模板名称 */ private String name; + /** 模板名称-英文 */ + private String nameEn; + + /** 导出类 */ + private String exportClass; + + /** 导出方法 */ + private String exportMethod; + /** 所属部门/学科 */ private Long deptId; @@ -47,6 +56,30 @@ public class Template extends MpBaseEntity @TableField(exist = false) private String deptName; + public String getExportMethod() { + return exportMethod; + } + + public void setExportMethod(String exportMethod) { + this.exportMethod = exportMethod; + } + + public String getNameEn() { + return nameEn; + } + + public void setNameEn(String nameEn) { + this.nameEn = nameEn; + } + + public String getExportClass() { + return exportClass; + } + + public void setExportClass(String exportClass) { + this.exportClass = exportClass; + } + public Integer getProduct() { return product; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/SP001.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/SP001.java index 499ce0e..0f09f07 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/SP001.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/SP001.java @@ -31,7 +31,7 @@ public class SP001 { * @param studyFormFill * @return */ - public String exportDetail(StudyFormFill studyFormFill,Template template, List studyFormFillQmxxList, List studyFormFillJcgjList, String lang, String localFilePath) { + public String exportDetail(StudyFormFill studyFormFill, List studyFormFillQmxxList, List studyFormFillJcgjList, String lang, String localFilePath) { language = lang; Document document = null; FileOutputStream fos = null; @@ -42,7 +42,7 @@ public class SP001 { if (loginUser != null) { sign = loginUser.getSysUser().getNickName(); } - document = PdfBaseUtil.init(document, fos, filePath, sign +PdfExportUtil.parseDateToStr(new Date()), "en".equals(language)?template.getShowSn():template.getName(),false); + document = PdfBaseUtil.init(document, fos, filePath, sign +PdfExportUtil.parseDateToStr(new Date()), "en".equals(language)?studyFormFill.getTemplateMcEn():studyFormFill.getTemplateMc(),false); // 基本信息 JSONObject bdnr = JSONObject.parseObject(studyFormFill.getBdnr()); diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml index 325caaa..40c7fec 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml @@ -17,8 +17,8 @@