From ec906405a412cb5841ab024d6b5e2441384075b4 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Thu, 5 Mar 2026 09:14:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StudyFormFillController.java | 58 +++++++++++----------- .../com/hxhq/business/utils/StudyFormFillUtil.java | 6 ++- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java index 4727f70..2524bc8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java @@ -64,6 +64,7 @@ public class StudyFormFillController extends BaseController { /** * 开始配置 + * * @return */ @PostMapping("/startConfiguration") @@ -77,6 +78,7 @@ public class StudyFormFillController extends BaseController { /** * 配置完成 + * * @param form * @return */ @@ -91,6 +93,7 @@ public class StudyFormFillController extends BaseController { /** * 分装 + * * @param form * @return */ @@ -141,26 +144,26 @@ public class StudyFormFillController extends BaseController { */ @GetMapping("/jcgjqmxxList") @RequiresPermissions(value = {"business:studyFormFill:xq", "business:nonTrialFormFill:xq", "business:drugFormFill:xq"}, logical = Logical.OR) - public AjaxResult jcgjqmxxList(Integer jcgjlx,Long id) { - HashMap map=new HashMap(2); + public AjaxResult jcgjqmxxList(Integer jcgjlx, Long id) { + HashMap map = new HashMap(2); //稽查轨迹 QueryWrapper 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()); - }else{ - studyFormFillJcgjQueryWrapper.eq("jcgjlx",jcgjlx); + } else { + studyFormFillJcgjQueryWrapper.eq("jcgjlx", jcgjlx); } } studyFormFillJcgjQueryWrapper.orderByDesc("create_time"); - map.put("jcgj",studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper)); + map.put("jcgj", studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper)); //签名信息 QueryWrapper studyFormFillQmxxQueryWrapper = Wrappers.query(); - studyFormFillQmxxQueryWrapper.eq("form_id",id); + studyFormFillQmxxQueryWrapper.eq("form_id", id); studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); - map.put("qmxx",studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper)); + map.put("qmxx", studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper)); return AjaxResult.success(map); } @@ -198,31 +201,30 @@ public class StudyFormFillController extends BaseController { StudyFormFill studyFormFill = studyFormFillService.queryInfo(form.getStudyFormFillId()); Study study = studyService.getById(studyFormFill.getStudyId()); //稽查轨迹 - QueryWrapper 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 jcgjList = new ArrayList<>(); + Integer noExport=999; + Boolean jcgj=false; + if (form.getJcgjlx() != null && form.getJcgjlx().intValue() > 0&&!form.getJcgjlx().equals(noExport)) { + QueryWrapper 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 jcgjList=studyFormFillJcgjService.list(studyFormFillJcgjQueryWrapper); + //签名信息 QueryWrapper studyFormFillQmxxQueryWrapper = Wrappers.query(); - studyFormFillQmxxQueryWrapper.eq("form_id",studyFormFill.getId()); + studyFormFillQmxxQueryWrapper.eq("form_id", studyFormFill.getId()); studyFormFillQmxxQueryWrapper.orderByDesc("create_time"); - List qmxxList=studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper); + List qmxxList = studyFormFillQmxxService.list(studyFormFillQmxxQueryWrapper); - String fileUrl =form.getUrl(); + 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); - + 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); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java index 3401bea..44f4325 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/StudyFormFillUtil.java @@ -78,7 +78,7 @@ public class StudyFormFillUtil { * @param fileDir * @return */ - public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List jcgjList, List qmxxList) { + public static String export(String version,String lang, String headerText, String srcPdf, String fileDir, List jcgjList, List qmxxList,Boolean jcgj) { language = lang; Document document = null; FileOutputStream fos = null; @@ -122,7 +122,9 @@ public class StudyFormFillUtil { // 7. 表格设置到新的一页 document.newPage(); addQmxx(document, qmxxList, lang); - addJcgj(document, jcgjList, lang); + if(jcgj){ + addJcgj(document, jcgjList, lang); + } } catch (Exception e) { throw new RuntimeException("生成失败: " + e.getMessage()); } finally {