Browse Source

fix:[试验管理]导出

master
15881625488@163.com 3 months ago
parent
commit
c8cda38da4
5 changed files with 87 additions and 12 deletions
  1. +2
    -8
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java
  2. +48
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java
  3. +33
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java
  4. +2
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/SP001.java
  5. +2
    -2
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml

+ 2
- 8
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java View File

@ -101,20 +101,14 @@ public class StudyFormFillController extends BaseController {
studyFormFillQmxx.setFormId(form.getFormId()); studyFormFillQmxx.setFormId(form.getFormId());
List<StudyFormFillQmxx> studyFormFillQmxxList = studyFormFillQmxxService.queryList(studyFormFillQmxx); List<StudyFormFillQmxx> studyFormFillQmxxList = studyFormFillQmxxService.queryList(studyFormFillQmxx);
StudyFormFill studyFormFill=studyFormFillService.queryInfo(form.getFormId()); StudyFormFill studyFormFill=studyFormFillService.queryInfo(form.getFormId());
Template template=templateService.getById(studyFormFill.getTemplateId());
if(template!=null){
return AjaxResult.success(localFilePrefix + PdfExportUtil.export( return AjaxResult.success(localFilePrefix + PdfExportUtil.export(
"com.hxhq.business.utils.pdf.template."+template.getSn(),
"exportDetail",
studyFormFill.getTemplateExportClass(),
studyFormFill.getTemplateExportMethod(),
studyFormFill, studyFormFill,
template,
studyFormFillQmxxList, studyFormFillQmxxList,
studyFormFillJcgjList, studyFormFillJcgjList,
form.getLang(), form.getLang(),
localFilePath)); localFilePath));
}else{
return AjaxResult.error("模板不存在或已删除");
}
} }

+ 48
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java View File

@ -109,10 +109,26 @@ public class StudyFormFill extends MpBaseEntity
@Compare(name = "模板名称") @Compare(name = "模板名称")
private String templateMc; private String templateMc;
/** 模板名称-英文 */
@TableField(exist = false)
private String templateMcEn;
/** 模板编号 */ /** 模板编号 */
@TableField(exist = false) @TableField(exist = false)
private String templateSn; private String templateSn;
/** 模板编号 */
@TableField(exist = false)
private String templateShowSn;
/** 模板导出类 */
@TableField(exist = false)
private String templateExportClass;
/** 模板导出方法 */
@TableField(exist = false)
private String templateExportMethod;
/** 模板所属部门/学科 */ /** 模板所属部门/学科 */
@TableField(exist = false) @TableField(exist = false)
private Long templateDeptId; private Long templateDeptId;
@ -125,6 +141,38 @@ public class StudyFormFill extends MpBaseEntity
@TableField(exist = false) @TableField(exist = false)
private String studyMc; 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() { public String getUserMcEn() {
return userMcEn; return userMcEn;
} }

+ 33
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java View File

@ -22,6 +22,15 @@ public class Template extends MpBaseEntity
/** 模板名称 */ /** 模板名称 */
private String name; private String name;
/** 模板名称-英文 */
private String nameEn;
/** 导出类 */
private String exportClass;
/** 导出方法 */
private String exportMethod;
/** 所属部门/学科 */ /** 所属部门/学科 */
private Long deptId; private Long deptId;
@ -47,6 +56,30 @@ public class Template extends MpBaseEntity
@TableField(exist = false) @TableField(exist = false)
private String deptName; 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() { public Integer getProduct() {
return product; return product;
} }

+ 2
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/SP001.java View File

@ -31,7 +31,7 @@ public class SP001 {
* @param studyFormFill * @param studyFormFill
* @return * @return
*/ */
public String exportDetail(StudyFormFill studyFormFill,Template template, List<StudyFormFillQmxx> studyFormFillQmxxList, List<StudyFormFillJcgj> studyFormFillJcgjList, String lang, String localFilePath) {
public String exportDetail(StudyFormFill studyFormFill, List<StudyFormFillQmxx> studyFormFillQmxxList, List<StudyFormFillJcgj> studyFormFillJcgjList, String lang, String localFilePath) {
language = lang; language = lang;
Document document = null; Document document = null;
FileOutputStream fos = null; FileOutputStream fos = null;
@ -42,7 +42,7 @@ public class SP001 {
if (loginUser != null) { if (loginUser != null) {
sign = loginUser.getSysUser().getNickName(); 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()); JSONObject bdnr = JSONObject.parseObject(studyFormFill.getBdnr());

+ 2
- 2
hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyFormFillMapper.xml View File

@ -17,8 +17,8 @@
</select> </select>
<select id="queryInfo" resultType="com.hxhq.business.domain.StudyFormFill"> <select id="queryInfo" resultType="com.hxhq.business.domain.StudyFormFill">
select t.*,tm.name as templateMc,tm.sn as templateSn,tm.dept_id as templateDeptId
,ts.sn as studySn,ts.name as studyMc
select t.*,tm.name as templateMc,tm.name_en as templateMcEn,tm.sn as templateSn,tm.show_sn as templateShowSn,tm.dept_id as templateDeptId
,ts.sn as studySn,ts.name as studyMc,tm.export_class as templateExportClass,tm.export_method as templateExportMethod
FROM `t_study_form_fill` t FROM `t_study_form_fill` t
join t_template tm on tm.id=t.template_id join t_template tm on tm.id=t.template_id
join t_study ts on ts.id=t.study_id join t_study ts on ts.id=t.study_id

Loading…
Cancel
Save