Browse Source

fix:[模板管理]导出

master
15881625488@163.com 1 month ago
parent
commit
8bc1fa471b
7 changed files with 60 additions and 0 deletions
  1. +46
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java
  2. +3
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java
  3. +2
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java
  4. +3
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java
  5. +2
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java
  6. +2
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java
  7. +2
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java

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

@ -1,5 +1,6 @@
package com.hxhq.business.controller; package com.hxhq.business.controller;
import java.io.File;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -16,7 +17,10 @@ import com.hxhq.business.form.sj.SjSubpackageForm;
import com.hxhq.business.form.study.*; import com.hxhq.business.form.study.*;
import com.hxhq.business.service.*; import com.hxhq.business.service.*;
import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.JctUtil;
import com.hxhq.business.utils.StudyFormFillUtil;
import com.hxhq.business.utils.pdf.PdfExportUtil; import com.hxhq.business.utils.pdf.PdfExportUtil;
import com.hxhq.business.utils.pdf.template.TemplateBaseUtil;
import com.hxhq.common.core.utils.DateUtils;
import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.Logical;
import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.annotation.RequiresPermissions;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
@ -40,6 +44,8 @@ public class StudyFormFillController extends BaseController {
@Autowired @Autowired
private IStudyFormFillService studyFormFillService; private IStudyFormFillService studyFormFillService;
@Autowired @Autowired
private IStudyService studyService;
@Autowired
private IStudyFormFillJcgjService studyFormFillJcgjService; private IStudyFormFillJcgjService studyFormFillJcgjService;
@Autowired @Autowired
private IStudyFormFillQmxxService studyFormFillQmxxService; private IStudyFormFillQmxxService studyFormFillQmxxService;
@ -182,6 +188,46 @@ public class StudyFormFillController extends BaseController {
return AjaxResult.success(localFilePrefix + PdfExportUtil.export(studyFormFill.getTemplateExportClass(), studyFormFill.getTemplateExportMethod(), studyFormFill, studyFormFillQmxxList, studyFormFillJcgjList, form.getLang(), form.getJcgjlx(), localFilePath)); return AjaxResult.success(localFilePrefix + PdfExportUtil.export(studyFormFill.getTemplateExportClass(), studyFormFill.getTemplateExportMethod(), studyFormFill, studyFormFillQmxxList, studyFormFillJcgjList, form.getLang(), form.getJcgjlx(), localFilePath));
} }
/**
* 导出
*/
@RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR)
@GetMapping(value = "/exportByFileUrl")
public AjaxResult exportByFileUrl(StudyFormFillExportForm form) {
StudyFormFill studyFormFill = studyFormFillService.queryInfo(form.getStudyFormFillId());
Study study = studyService.getById(studyFormFill.getStudyId());
//稽查轨迹
QueryWrapper<StudyFormFillJcgj> studyFormFillJcgjQueryWrapper = Wrappers.query();
studyFormFillJcgjQueryWrapper.eq("form_id",studyFormFill.getId());
if(form.getJcgjlx()!=null&&form.getJcgjlx().intValue()>0){
Integer jcgjlxExport=999;
if(form.getJcgjlx().intValue()==jcgjlxExport){
studyFormFillJcgjQueryWrapper.notIn("jcgjlx", JcgjlxEnum.xg.getValue());
}else{
studyFormFillJcgjQueryWrapper.eq("jcgjlx",form.getJcgjlx());
}
}
studyFormFillJcgjQueryWrapper.orderByDesc("create_time");
List<StudyFormFillJcgj> jcgjList=studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper);
//签名信息
QueryWrapper<StudyFormFillQmxx> studyFormFillQmxxQueryWrapper = Wrappers.query();
studyFormFillQmxxQueryWrapper.eq("form_id",studyFormFill.getId());
studyFormFillQmxxQueryWrapper.orderByDesc("create_time");
List<StudyFormFillQmxx> qmxxList=studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper);
String fileUrl =form.getUrl();
fileUrl = fileUrl.replaceFirst(localFilePrefix, "");
int indexOf = fileUrl.lastIndexOf("/");
String path = fileUrl.substring(0, indexOf);
String exportFileName = StudyFormFillUtil.export(form.getVersion(),form.getLang(),study.getName() + "("+study.getSn()+")"+studyFormFill.getBdmc(),
localFilePath + fileUrl, localFilePath + File.separator + path,jcgjList,qmxxList);
return AjaxResult.success(localFilePrefix + path + File.separator + exportFileName);
}
/** /**
* 加签 * 加签
*/ */

+ 3
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GspJcnrUtil.java View File

@ -15,6 +15,9 @@ public class GspJcnrUtil {
private static final Logger logger = LoggerFactory.getLogger(GspJcnrUtil.class.getName()); private static final Logger logger = LoggerFactory.getLogger(GspJcnrUtil.class.getName());
private static HashMap<String,String> mapLang=new HashMap<>(); private static HashMap<String,String> mapLang=new HashMap<>();
static { static {
mapLang.put("稽查轨迹","Track Record");
mapLang.put("签名信息","Signature information");
mapLang.put("入库","In Storage"); mapLang.put("入库","In Storage");
mapLang.put("未入库","Not in Storage"); mapLang.put("未入库","Not in Storage");
mapLang.put("已发放","In Use"); mapLang.put("已发放","In Use");

+ 2
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/GyzjJcnrUtil.java View File

@ -88,6 +88,8 @@ public class GyzjJcnrUtil {
mapLang.put("备注","Comment"); mapLang.put("备注","Comment");
mapLang.put("签名人","Signed By"); mapLang.put("签名人","Signed By");
mapLang.put("稽查轨迹","Track Record");
mapLang.put("签名信息","Signature information");
mapLang.put("申请解档","Apply for De-archiving"); mapLang.put("申请解档","Apply for De-archiving");
mapLang.put("申请借阅","Apply for Check-out"); mapLang.put("申请借阅","Apply for Check-out");
mapLang.put("申请归档","Apply for Archiving"); mapLang.put("申请归档","Apply for Archiving");

+ 3
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/MjyJcnrUtil.java View File

@ -15,6 +15,9 @@ public class MjyJcnrUtil {
private static final Logger logger = LoggerFactory.getLogger(MjyJcnrUtil.class.getName()); private static final Logger logger = LoggerFactory.getLogger(MjyJcnrUtil.class.getName());
private static HashMap<String,String> mapLang=new HashMap<>(); private static HashMap<String,String> mapLang=new HashMap<>();
static { static {
mapLang.put("稽查轨迹","Track Record");
mapLang.put("签名信息","Signature information");
mapLang.put("入库","In Storage"); mapLang.put("入库","In Storage");
mapLang.put("未入库","Not in Storage"); mapLang.put("未入库","Not in Storage");
mapLang.put("已发放","In Use"); mapLang.put("已发放","In Use");

+ 2
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/StudyFormUtil.java View File

@ -17,6 +17,8 @@ public class StudyFormUtil {
static { static {
mapLang.put("稽查轨迹","Track Record");
mapLang.put("签名信息","Signature information");
mapLang.put("存储","Storage"); mapLang.put("存储","Storage");
mapLang.put("存储条件","Storage Condition"); mapLang.put("存储条件","Storage Condition");
mapLang.put("存储位置","Storage Location"); mapLang.put("存储位置","Storage Location");

+ 2
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/TemplateUtil.java View File

@ -22,6 +22,8 @@ public class TemplateUtil {
mapLang.put("操作步骤","Operation Steps"); mapLang.put("操作步骤","Operation Steps");
mapLang.put("备注","Remarks"); mapLang.put("备注","Remarks");
mapLang.put("稽查轨迹","Track Record");
mapLang.put("签名信息","Signature information");
mapLang.put("试验名称","Study Name"); mapLang.put("试验名称","Study Name");
mapLang.put("试验编号","Study Number"); mapLang.put("试验编号","Study Number");
mapLang.put("方法编号","Method Code"); mapLang.put("方法编号","Method Code");

+ 2
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/lang/ZcgJcnrUtil.java View File

@ -26,6 +26,8 @@ public class ZcgJcnrUtil {
mapLang.put("钥匙1领取人","Key 1 Recipient"); mapLang.put("钥匙1领取人","Key 1 Recipient");
mapLang.put("钥匙2领取人","Key 2 Recipient"); mapLang.put("钥匙2领取人","Key 2 Recipient");
mapLang.put("稽查轨迹","Track Record");
mapLang.put("签名信息","Signature information");
} }
public static void main(String[] args) { public static void main(String[] args) {

Loading…
Cancel
Save