Browse Source

fix:[模板管理]bug

master
15881625488@163.com 1 month ago
parent
commit
ec906405a4
2 changed files with 34 additions and 30 deletions
  1. +30
    -28
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java
  2. +4
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java

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

@ -64,6 +64,7 @@ public class StudyFormFillController extends BaseController {
/** /**
* 开始配置 * 开始配置
*
* @return * @return
*/ */
@PostMapping("/startConfiguration") @PostMapping("/startConfiguration")
@ -77,6 +78,7 @@ public class StudyFormFillController extends BaseController {
/** /**
* 配置完成 * 配置完成
*
* @param form * @param form
* @return * @return
*/ */
@ -91,6 +93,7 @@ public class StudyFormFillController extends BaseController {
/** /**
* 分装 * 分装
*
* @param form * @param form
* @return * @return
*/ */
@ -141,26 +144,26 @@ public class StudyFormFillController extends BaseController {
*/ */
@GetMapping("/jcgjqmxxList") @GetMapping("/jcgjqmxxList")
@RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR) @RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR)
public AjaxResult jcgjqmxxList(Integer jcgjlx,Long id) {
HashMap<String,Object> map=new HashMap<String,Object>(2);
public AjaxResult jcgjqmxxList(Integer jcgjlx, Long id) {
HashMap<String, Object> map = new HashMap<String, Object>(2);
//稽查轨迹 //稽查轨迹
QueryWrapper<StudyFormFillJcgj> studyFormFillJcgjQueryWrapper = Wrappers.query(); QueryWrapper<StudyFormFillJcgj> studyFormFillJcgjQueryWrapper = Wrappers.query();
studyFormFillJcgjQueryWrapper.eq("form_id",id);
if(jcgjlx!=null&&jcgjlx.intValue()>0){
Integer jcgjlxExport=999;
if(jcgjlx.intValue()==jcgjlxExport){
studyFormFillJcgjQueryWrapper.eq("form_id", id);
if (jcgjlx != null && jcgjlx.intValue() > 0) {
Integer jcgjlxExport = 999;
if (jcgjlx.intValue() == jcgjlxExport) {
studyFormFillJcgjQueryWrapper.notIn("jcgjlx", JcgjlxEnum.xg.getValue()); studyFormFillJcgjQueryWrapper.notIn("jcgjlx", JcgjlxEnum.xg.getValue());
}else{
studyFormFillJcgjQueryWrapper.eq("jcgjlx",jcgjlx);
} else {
studyFormFillJcgjQueryWrapper.eq("jcgjlx", jcgjlx);
} }
} }
studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); studyFormFillJcgjQueryWrapper.orderByDesc("create_time");
map.put("jcgj",studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper));
map.put("jcgj", studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper));
//签名信息 //签名信息
QueryWrapper<StudyFormFillQmxx> studyFormFillQmxxQueryWrapper = Wrappers.query(); QueryWrapper<StudyFormFillQmxx> studyFormFillQmxxQueryWrapper = Wrappers.query();
studyFormFillQmxxQueryWrapper.eq("form_id",id);
studyFormFillQmxxQueryWrapper.eq("form_id", id);
studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); studyFormFillQmxxQueryWrapper.orderByDesc("create_time");
map.put("qmxx",studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper));
map.put("qmxx", studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper));
return AjaxResult.success(map); return AjaxResult.success(map);
} }
@ -198,31 +201,30 @@ public class StudyFormFillController extends BaseController {
StudyFormFill studyFormFill = studyFormFillService.queryInfo(form.getStudyFormFillId()); StudyFormFill studyFormFill = studyFormFillService.queryInfo(form.getStudyFormFillId());
Study study = studyService.getById(studyFormFill.getStudyId()); 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());
}
List<StudyFormFillJcgj> jcgjList = new ArrayList<>();
Integer noExport=999;
Boolean jcgj=false;
if (form.getJcgjlx() != null && form.getJcgjlx().intValue() > 0&&!form.getJcgjlx().equals(noExport)) {
QueryWrapper<StudyFormFillJcgj> studyFormFillJcgjQueryWrapper = Wrappers.query();
studyFormFillJcgjQueryWrapper.eq("form_id", studyFormFill.getId());
studyFormFillJcgjQueryWrapper.eq("jcgjlx", form.getJcgjlx());
studyFormFillJcgjQueryWrapper.orderByDesc("create_time");
jcgjList = studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper);
jcgj=true;
} }
studyFormFillJcgjQueryWrapper.orderByDesc("create_time");
List<StudyFormFillJcgj> jcgjList=studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper);
//签名信息 //签名信息
QueryWrapper<StudyFormFillQmxx> studyFormFillQmxxQueryWrapper = Wrappers.query(); QueryWrapper<StudyFormFillQmxx> studyFormFillQmxxQueryWrapper = Wrappers.query();
studyFormFillQmxxQueryWrapper.eq("form_id",studyFormFill.getId());
studyFormFillQmxxQueryWrapper.eq("form_id", studyFormFill.getId());
studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); studyFormFillQmxxQueryWrapper.orderByDesc("create_time");
List<StudyFormFillQmxx> qmxxList=studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper);
List<StudyFormFillQmxx> qmxxList = studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper);
String fileUrl =form.getUrl();
String fileUrl = form.getUrl();
fileUrl = fileUrl.replaceFirst(localFilePrefix, ""); fileUrl = fileUrl.replaceFirst(localFilePrefix, "");
int indexOf = fileUrl.lastIndexOf("/"); int indexOf = fileUrl.lastIndexOf("/");
String path = fileUrl.substring(0, indexOf); 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);
String exportFileName = StudyFormFillUtil.export(form.getVersion(), form.getLang(), study.getName() + "(" + study.getSn() + ") " + studyFormFill.getBdmc(),
localFilePath + fileUrl, localFilePath + File.separator + path, jcgjList, qmxxList,jcgj);
return AjaxResult.success(localFilePrefix + path + File.separator + exportFileName); return AjaxResult.success(localFilePrefix + path + File.separator + exportFileName);

+ 4
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java View File

@ -78,7 +78,7 @@ public class StudyFormFillUtil {
* @param fileDir * @param fileDir
* @return * @return
*/ */
public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List<StudyFormFillJcgj> jcgjList, List<StudyFormFillQmxx> qmxxList) {
public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List<StudyFormFillJcgj> jcgjList, List<StudyFormFillQmxx> qmxxList,Boolean jcgj) {
language = lang; language = lang;
Document document = null; Document document = null;
FileOutputStream fos = null; FileOutputStream fos = null;
@ -122,7 +122,9 @@ public class StudyFormFillUtil {
// 7. 表格设置到新的一页 // 7. 表格设置到新的一页
document.newPage(); document.newPage();
addQmxx(document, qmxxList, lang); addQmxx(document, qmxxList, lang);
addJcgj(document, jcgjList, lang);
if(jcgj){
addJcgj(document, jcgjList, lang);
}
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("生成失败: " + e.getMessage()); throw new RuntimeException("生成失败: " + e.getMessage());
} finally { } finally {

Loading…
Cancel
Save