|
|
@ -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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 加签 |
|
|
* 加签 |
|
|
*/ |
|
|
*/ |
|
|
|