浏览代码

Merge branch 'bgy' of SH-Arbitrate/Arbitrate-Backend into dev

bgy 2 年前
父节点
当前提交
4a807869aa

+ 19
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java 查看文件

163
                 return AjaxResult.error("未找到该模板");
163
                 return AjaxResult.error("未找到该模板");
164
             }
164
             }
165
 
165
 
166
-            // todo 部署放开
166
+            // 部署放开
167
             if (templatePath != null) {
167
             if (templatePath != null) {
168
                 templatePath = "/home/ruoyi/" + templatePath;
168
                 templatePath = "/home/ruoyi/" + templatePath;
169
             }
169
             }
764
             return AjaxResult.error("未查询到相关案件");
764
             return AjaxResult.error("未查询到相关案件");
765
         }
765
         }
766
         List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
766
         List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
767
+        Boolean isExistPdf = false;
767
         if (caseAttachList != null && caseAttachList.size() > 0) {
768
         if (caseAttachList != null && caseAttachList.size() > 0) {
768
             for (CaseAttach caseAttach : caseAttachList) {
769
             for (CaseAttach caseAttach : caseAttachList) {
769
                 if (caseAttach.getAnnexType() == 3) {
770
                 if (caseAttach.getAnnexType() == 3) {
771
+                    isExistPdf = true;
770
                     String annexName = caseAttach.getAnnexName();
772
                     String annexName = caseAttach.getAnnexName();
771
                     String prefix = "/profile/upload/";
773
                     String prefix = "/profile/upload/";
772
                     int startIndex = prefix.length();
774
                     int startIndex = prefix.length();
774
                     File file = new File(path);
776
                     File file = new File(path);
775
                     //判断文件是否存在
777
                     //判断文件是否存在
776
                     if (!file.exists()) {
778
                     if (!file.exists()) {
777
-//                        return AjaxResult.error("未生成裁决书");
778
-                        //若不存在则从e签宝下载PDF文件
779
+                        isExistPdf = false;
780
+                        //若不存在裁决书则从e签宝下载PDF文件
779
                         try {
781
                         try {
780
                             SealSignRecord sealSignRecord = new SealSignRecord();
782
                             SealSignRecord sealSignRecord = new SealSignRecord();
781
                             sealSignRecord.setCaseAppliId(caseApplication.getId());
783
                             sealSignRecord.setCaseAppliId(caseApplication.getId());
789
                                 List<CaseAttach> caseAttachList1 = caseAttachMapper.queryCaseAttachList(caseApplication1);
791
                                 List<CaseAttach> caseAttachList1 = caseAttachMapper.queryCaseAttachList(caseApplication1);
790
                                 for (CaseAttach caseAttach1 : caseAttachList1) {
792
                                 for (CaseAttach caseAttach1 : caseAttachList1) {
791
                                     if (caseAttach1.getAnnexType() == 3) {
793
                                     if (caseAttach1.getAnnexType() == 3) {
792
-                                        annexName = caseAttach.getAnnexName();
794
+                                        isExistPdf = true;
795
+                                        annexName = caseAttach1.getAnnexName();
793
                                         prefix = "/profile/upload/";
796
                                         prefix = "/profile/upload/";
794
                                         startIndex = prefix.length();
797
                                         startIndex = prefix.length();
795
-                                        path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
798
+                                        path = caseAttach1.getAnnexPath() + annexName.substring(startIndex);
796
                                         File file1 = new File(path);
799
                                         File file1 = new File(path);
797
                                         if (!file1.exists()) {
800
                                         if (!file1.exists()) {
798
-                                            return AjaxResult.error("未生成裁决书");
801
+                                            isExistPdf = false;
799
                                         }
802
                                         }
803
+                                        annexName = null;
804
+                                        prefix = null;
805
+                                        path = null;
800
                                         caseAttachList = caseAttachList1;
806
                                         caseAttachList = caseAttachList1;
801
                                         break;
807
                                         break;
802
                                     }
808
                                     }
803
                                 }
809
                                 }
810
+                                //若附件中没有裁决书PDF文件则终止
811
+                                if (!isExistPdf) {
812
+                                    return AjaxResult.error("未找到签名后的裁决书");
813
+                                }
804
                             }
814
                             }
805
                         } catch (Exception e) {
815
                         } catch (Exception e) {
806
                             e.printStackTrace();
816
                             e.printStackTrace();
811
                 }
821
                 }
812
             }
822
             }
813
         }
823
         }
824
+        if (!isExistPdf) {
825
+            return AjaxResult.error("未找到签名后的裁决书");
826
+        }
814
         //修改案件状态
827
         //修改案件状态
815
         caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
828
         caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
816
         caseApplicationMapper.submitCaseApplication(caseApplication1);
829
         caseApplicationMapper.submitCaseApplication(caseApplication1);