diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormPlanController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormPlanController.java index 8676281..f7e1ee5 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormPlanController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormPlanController.java @@ -1,16 +1,17 @@ package com.hxhq.business.controller; import java.util.List; -import com.hxhq.business.domain.StudyFormPlan; -import com.hxhq.business.domain.StudyFormPlanJcgj; -import com.hxhq.business.domain.StudyFormPlanQmxx; + +import com.hxhq.business.domain.*; import com.hxhq.business.dto.study.StudyFormPlanListDto; import com.hxhq.business.form.study.StudyFormPlanSearchForm; import com.hxhq.business.form.study.StudyFormUpdateForm; import com.hxhq.business.service.IStudyFormPlanJcgjService; import com.hxhq.business.service.IStudyFormPlanQmxxService; +import com.hxhq.business.utils.pdf.PdfExportUtil; import com.hxhq.common.security.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import com.hxhq.business.service.IStudyFormPlanService; import com.hxhq.common.core.web.controller.BaseController; @@ -34,6 +35,16 @@ public class StudyFormPlanController extends BaseController private IStudyFormPlanJcgjService studyFormPlanJcgjService; @Autowired private IStudyFormPlanQmxxService studyFormPlanQmxxService; + /** + * 上传文件存储在本地的根路径 + */ + @Value("${file.path}") + private String localFilePath; + /** + * 资源映射路径 前缀 + */ + @Value("${file.prefix}") + public String localFilePrefix; /** * 列表 @@ -77,6 +88,19 @@ public class StudyFormPlanController extends BaseController return AjaxResult.success(studyFormPlanService.queryInfo(id)); } + /** + * 导出 + */ + @RequiresPermissions({"business:studyFormPlan:xq"}) + @GetMapping(value = "/exportDetail") + public AjaxResult exportDetail(StudyFormPlanJcgj form) { + List studyFormPlanJcgjList = studyFormPlanJcgjService.queryList(form); + StudyFormPlanQmxx studyFormPlanQmxx = new StudyFormPlanQmxx(); + studyFormPlanQmxx.setFormId(form.getFormId()); + List studyFormPlanQmxxList = studyFormPlanQmxxService.queryList(studyFormPlanQmxx); + StudyFormPlan studyFormPlan=studyFormPlanService.queryInfo(form.getFormId()); + return AjaxResult.success(localFilePrefix + PdfExportUtil.export(studyFormPlan.getTemplateExportClass(), studyFormPlan.getTemplateExportMethod(),studyFormPlan,studyFormPlanQmxxList,studyFormPlanJcgjList,form.getLang(),form.getJcgjlx(),localFilePath)); + } /** * 更换归属人 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlan.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlan.java index d96cd11..2291107 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlan.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlan.java @@ -89,10 +89,26 @@ public class StudyFormPlan 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 String studySn; @@ -101,6 +117,38 @@ public class StudyFormPlan extends MpBaseEntity @TableField(exist = false) private String studyMc; + public String getTemplateMcEn() { + return templateMcEn; + } + + public void setTemplateMcEn(String templateMcEn) { + this.templateMcEn = templateMcEn; + } + + 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 getUserMcEn() { return userMcEn; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlanJcgj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlanJcgj.java index f05683e..6ba56c8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlanJcgj.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormPlanJcgj.java @@ -1,5 +1,6 @@ package com.hxhq.business.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.hxhq.common.core.domain.MpBaseEntity; @@ -45,6 +46,18 @@ public class StudyFormPlanJcgj extends MpBaseEntity /** 签名人名称-英文 */ private String qmrMcEn; + /** 语言 */ + @TableField(exist = false) + private String lang; + + public String getLang() { + return lang; + } + + public void setLang(String lang) { + this.lang = lang; + } + public String getJcmcEn() { return jcmcEn; } diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormPlanMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormPlanMapper.xml index 3380c8e..fdfec0e 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormPlanMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormPlanMapper.xml @@ -15,8 +15,8 @@