From 064b88a86aa3db022f733e88b277b2b7ad889bf3 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Mon, 29 Apr 2024 09:59:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=81=E8=BE=BE=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AdjudicationServiceImpl.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 2dd4e37..7706308 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -163,7 +163,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error("未找到该模板"); } - // todo 部署放开 + // 部署放开 if (templatePath != null) { templatePath = "/home/ruoyi/" + templatePath; } @@ -764,9 +764,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error("未查询到相关案件"); } List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); + Boolean isExistPdf = false; if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { + isExistPdf = true; String annexName = caseAttach.getAnnexName(); String prefix = "/profile/upload/"; int startIndex = prefix.length(); @@ -774,8 +776,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { File file = new File(path); //判断文件是否存在 if (!file.exists()) { -// return AjaxResult.error("未生成裁决书"); - //若不存在则从e签宝下载PDF文件 + isExistPdf = false; + //若不存在裁决书则从e签宝下载PDF文件 try { SealSignRecord sealSignRecord = new SealSignRecord(); sealSignRecord.setCaseAppliId(caseApplication.getId()); @@ -789,18 +791,26 @@ public class AdjudicationServiceImpl implements IAdjudicationService { List caseAttachList1 = caseAttachMapper.queryCaseAttachList(caseApplication1); for (CaseAttach caseAttach1 : caseAttachList1) { if (caseAttach1.getAnnexType() == 3) { - annexName = caseAttach.getAnnexName(); + isExistPdf = true; + annexName = caseAttach1.getAnnexName(); prefix = "/profile/upload/"; startIndex = prefix.length(); - path = caseAttach.getAnnexPath() + annexName.substring(startIndex); + path = caseAttach1.getAnnexPath() + annexName.substring(startIndex); File file1 = new File(path); if (!file1.exists()) { - return AjaxResult.error("未生成裁决书"); + isExistPdf = false; } + annexName = null; + prefix = null; + path = null; caseAttachList = caseAttachList1; break; } } + //若附件中没有裁决书PDF文件则终止 + if (!isExistPdf) { + return AjaxResult.error("未找到签名后的裁决书"); + } } } catch (Exception e) { e.printStackTrace(); @@ -811,6 +821,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } } + if (!isExistPdf) { + return AjaxResult.error("未找到签名后的裁决书"); + } //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); caseApplicationMapper.submitCaseApplication(caseApplication1); -- 2.54.0