Просмотр исходного кода

优化送达签收文件下载功能

wangqiong 2 лет назад
Родитель
Сommit
374841e417

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Просмотреть файл

227
     private List<Integer> caseStatusList;
227
     private List<Integer> caseStatusList;
228
 
228
 
229
     private List<Integer> annexTypeList;
229
     private List<Integer> annexTypeList;
230
-
230
+    /**
231
+     * 立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)
232
+     * 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11)
233
+     */
231
     private Integer annexType;
234
     private Integer annexType;
232
     /**
235
     /**
233
      * 案件附件列表
236
      * 案件附件列表

+ 107
- 126
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Просмотреть файл

10
 import com.google.gson.JsonObject;
10
 import com.google.gson.JsonObject;
11
 import com.ruoyi.common.constant.CaseApplicationConstants;
11
 import com.ruoyi.common.constant.CaseApplicationConstants;
12
 import com.ruoyi.common.constant.FileTransformation;
12
 import com.ruoyi.common.constant.FileTransformation;
13
-import com.ruoyi.common.core.controller.BaseController;
14
 import com.ruoyi.common.core.domain.AjaxResult;
13
 import com.ruoyi.common.core.domain.AjaxResult;
15
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
14
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
16
 import com.ruoyi.common.core.domain.entity.SysDictData;
15
 import com.ruoyi.common.core.domain.entity.SysDictData;
17
 import com.ruoyi.common.core.redis.RedisCache;
16
 import com.ruoyi.common.core.redis.RedisCache;
18
 import com.ruoyi.common.exception.EsignDemoException;
17
 import com.ruoyi.common.exception.EsignDemoException;
19
 import com.ruoyi.common.exception.ServiceException;
18
 import com.ruoyi.common.exception.ServiceException;
20
-import com.ruoyi.common.utils.*;
19
+import com.ruoyi.common.utils.EmailOutUtil;
20
+import com.ruoyi.common.utils.ObjectFieldUtils;
21
+import com.ruoyi.common.utils.SmsUtils;
22
+import com.ruoyi.common.utils.WordUtil;
21
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
23
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
22
 import com.ruoyi.common.utils.thread.MultipleThreadListParam;
24
 import com.ruoyi.common.utils.thread.MultipleThreadListParam;
23
-import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
24
 import com.ruoyi.system.mapper.SysDictDataMapper;
25
 import com.ruoyi.system.mapper.SysDictDataMapper;
25
 import com.ruoyi.wisdomarbitrate.StringIdsReq;
26
 import com.ruoyi.wisdomarbitrate.StringIdsReq;
26
-import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
27
-import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
28
-import com.ruoyi.wisdomarbitrate.mapper.*;
29
-import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
30
 import com.ruoyi.wisdomarbitrate.domain.*;
27
 import com.ruoyi.wisdomarbitrate.domain.*;
31
 import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO;
28
 import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO;
29
+import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
30
+import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
32
 import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
31
 import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
32
+import com.ruoyi.wisdomarbitrate.mapper.*;
33
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
33
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
34
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
34
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
35
 import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
35
 import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
36
+import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
36
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
37
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
37
 import lombok.extern.slf4j.Slf4j;
38
 import lombok.extern.slf4j.Slf4j;
38
-import org.apache.poi.ss.usermodel.Sheet;
39
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
40
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
39
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
41
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
40
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
42
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark;
43
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
44
 import org.springframework.beans.factory.annotation.Autowired;
41
 import org.springframework.beans.factory.annotation.Autowired;
45
 import org.springframework.mail.MailSendException;
42
 import org.springframework.mail.MailSendException;
46
 import org.springframework.mail.javamail.JavaMailSender;
43
 import org.springframework.mail.javamail.JavaMailSender;
47
 import org.springframework.stereotype.Service;
44
 import org.springframework.stereotype.Service;
48
 import org.springframework.transaction.annotation.Transactional;
45
 import org.springframework.transaction.annotation.Transactional;
49
-import org.w3c.dom.Node;
50
-import org.w3c.dom.NodeList;
51
 
46
 
52
 import java.io.*;
47
 import java.io.*;
53
-import java.math.BigDecimal;
54
 import java.net.HttpURLConnection;
48
 import java.net.HttpURLConnection;
55
 import java.net.URL;
49
 import java.net.URL;
56
 import java.net.URLEncoder;
50
 import java.net.URLEncoder;
57
 import java.nio.file.Files;
51
 import java.nio.file.Files;
58
 import java.nio.file.Path;
52
 import java.nio.file.Path;
59
 import java.nio.file.StandardCopyOption;
53
 import java.nio.file.StandardCopyOption;
60
-import java.text.NumberFormat;
61
 import java.text.SimpleDateFormat;
54
 import java.text.SimpleDateFormat;
62
 import java.time.LocalDate;
55
 import java.time.LocalDate;
63
 import java.util.*;
56
 import java.util.*;
64
-import java.util.concurrent.CountDownLatch;
65
 import java.util.function.Function;
57
 import java.util.function.Function;
66
 import java.util.regex.Matcher;
58
 import java.util.regex.Matcher;
67
 import java.util.regex.Pattern;
59
 import java.util.regex.Pattern;
68
 import java.util.stream.Collectors;
60
 import java.util.stream.Collectors;
69
 
61
 
70
-import static com.ruoyi.common.utils.PageUtils.startPage;
71
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
62
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
72
 
63
 
73
 @Service
64
 @Service
110
 
101
 
111
 
102
 
112
     // 仲裁反请求模板内容
103
     // 仲裁反请求模板内容
113
-    private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
114
-            "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
115
-            "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
104
+    private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
116
     // 财产保全内容
105
     // 财产保全内容
117
-    String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
118
-            "第二十八条之规定,将该申请提交至法院。";
106
+    String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + "第二十八条之规定,将该申请提交至法院。";
119
     // 管辖权异议
107
     // 管辖权异议
120
-    String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" +
121
-            ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
108
+    String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
122
     // 线上开庭时+线上仲裁
109
     // 线上开庭时+线上仲裁
123
     String onLineDate = "{{onLineDate}}";
110
     String onLineDate = "{{onLineDate}}";
124
     String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。";
111
     String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。";
129
     String writtenDate = "{{writtenDate}}";
116
     String writtenDate = "{{writtenDate}}";
130
     String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 ";
117
     String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 ";
131
     //开庭+缺席审理
118
     //开庭+缺席审理
132
-    String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
133
-            "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" +
134
-            "            \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
135
-            "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
119
+    String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + "            \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
136
     // 开庭+出席
120
     // 开庭+出席
137
     String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 ";
121
     String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 ";
138
     // 开庭+出席+被申提供证据
122
     // 开庭+出席+被申提供证据
140
     // 开庭+出席+被申未提供证据
124
     // 开庭+出席+被申未提供证据
141
     String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
125
     String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
142
     // 被申请人出席答辩意见
126
     // 被申请人出席答辩意见
143
-    String resAttendOpinion = "\n(二)被申请人的答辩意见  \n(三)当事人提供的证据材料及对方的质证意见\n" +
144
-            "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n";
127
+    String resAttendOpinion = "\n(二)被申请人的答辩意见  \n(三)当事人提供的证据材料及对方的质证意见\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n";
145
     // 被申请人出席+被申请人提供了资料
128
     // 被申请人出席+被申请人提供了资料
146
-    String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" +
147
-            "申请人对上述材料的质证意见为:{{applicantOpinion}}";
129
+    String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + "申请人对上述材料的质证意见为:{{applicantOpinion}}";
148
     // 被申请人缺席
130
     // 被申请人缺席
149
-    String resAbsent = "(二)当事人提供的证据材料\n" +
150
-            "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}";
131
+    String resAbsent = "(二)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}";
151
     // 日期格式化年月日
132
     // 日期格式化年月日
152
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
133
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
153
 
134
 
528
                             default:
509
                             default:
529
                                 break;
510
                                 break;
530
                         }
511
                         }
531
-                    } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
532
-                            || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位")
533
-                            || dictData.getDictLabel().contains("代理人")) {
512
+                    } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位") || dictData.getDictLabel().contains("代理人")) {
534
                         CaseAffiliate affiliate = affiliateMap.get(1);
513
                         CaseAffiliate affiliate = affiliateMap.get(1);
535
                         if (affiliate == null) {
514
                         if (affiliate == null) {
536
                             continue;
515
                             continue;
588
      * @param arbitrateRecordSelect 出裁决书生成记录
567
      * @param arbitrateRecordSelect 出裁决书生成记录
589
      */
568
      */
590
     private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) {
569
     private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) {
591
-        CaseAttach caseAttach = CaseAttach.builder()
592
-                .caseAppliId(id)
593
-                .annexName(saveName)
594
-                .annexPath(savePath)
595
-                .annexType(3)
596
-                .build();
570
+        CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build();
597
         //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
571
         //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
598
         List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
572
         List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
599
         if (caseAttachList != null && caseAttachList.size() > 0) {
573
         if (caseAttachList != null && caseAttachList.size() > 0) {
614
         //修改案件状态
588
         //修改案件状态
615
         caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
589
         caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
616
         Integer arbitratMethod = caseApplicationById.getArbitratMethod();
590
         Integer arbitratMethod = caseApplicationById.getArbitratMethod();
617
-        if(arbitratMethod==1){
591
+        if (arbitratMethod == 1) {
618
             caseApplicationById.setLockStatus(1);
592
             caseApplicationById.setLockStatus(1);
619
         }
593
         }
620
         caseApplicationMapper.submitCaseApplication(caseApplicationById);
594
         caseApplicationMapper.submitCaseApplication(caseApplicationById);
657
             //电子邮件送达
631
             //电子邮件送达
658
             JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
632
             JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
659
             if (appEmail != null) {
633
             if (appEmail != null) {
660
-                emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
661
-                        , "hjbjava@163.com", javaMailSender);
634
+                emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file, "hjbjava@163.com", javaMailSender);
662
             }
635
             }
663
             if (resEmail != null) {
636
             if (resEmail != null) {
664
-                emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
665
-                        , "hjbjava@163.com", javaMailSender);
637
+                emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file, "hjbjava@163.com", javaMailSender);
666
 
638
 
667
             }
639
             }
668
             //修改案件状态
640
             //修改案件状态
709
                     String trackNum = affiliate.getTrackNum();
681
                     String trackNum = affiliate.getTrackNum();
710
                     if (trackNum != null) {
682
                     if (trackNum != null) {
711
                         // 构造查询字符串参数
683
                         // 构造查询字符串参数
712
-                        String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d",
713
-                                URLEncoder.encode(key, "UTF-8"),
714
-                                URLEncoder.encode(com, "UTF-8"),
715
-                                URLEncoder.encode(trackNum, "UTF-8"), null);
684
+                        String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", URLEncoder.encode(key, "UTF-8"), URLEncoder.encode(com, "UTF-8"), URLEncoder.encode(trackNum, "UTF-8"), null);
716
                         // 拼接到API URL中
685
                         // 拼接到API URL中
717
                         String fullUrl = apiUrl + "?" + queryParameters;
686
                         String fullUrl = apiUrl + "?" + queryParameters;
718
                         URL url = new URL(fullUrl);
687
                         URL url = new URL(fullUrl);
782
         return AjaxResult.success("归档成功,案件状态已改为已归档");
751
         return AjaxResult.success("归档成功,案件状态已改为已归档");
783
     }
752
     }
784
 
753
 
754
+    @Autowired
755
+    DownFileService downFileService;
756
+
785
     @Override
757
     @Override
786
     @Transactional
758
     @Transactional
787
     public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) {
759
     public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) {
800
                     int startIndex = prefix.length();
772
                     int startIndex = prefix.length();
801
                     String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
773
                     String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
802
                     File file = new File(path);
774
                     File file = new File(path);
803
-                    // todo 部署放开
775
+                    //判断文件是否存在
804
                     if (!file.exists()) {
776
                     if (!file.exists()) {
805
-                        return AjaxResult.error("未生成裁决书");
777
+//                        return AjaxResult.error("未生成裁决书");
778
+                        //若不存在则从e签宝下载PDF文件
779
+                        try {
780
+                            SealSignRecord sealSignRecord = new SealSignRecord();
781
+                            sealSignRecord.setCaseAppliId(caseApplication.getId());
782
+                            //3为"签署用印记录表"的状态为签署完成
783
+                            sealSignRecord.setSignFlowStatus(3);
784
+                            List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord);
785
+                            if (sealSignRecords != null && sealSignRecords.size() > 0) {
786
+                                SealSignRecord sealSignRecord1 = sealSignRecords.get(0);
787
+                                downFileService.downPdfFileFormEsign(sealSignRecord1.getSignFlowid(), caseAttach.getCaseAppliId());
788
+                                //下载成功后重新查询
789
+                                List<CaseAttach> caseAttachList1 = caseAttachMapper.queryCaseAttachList(caseApplication1);
790
+                                for (CaseAttach caseAttach1 : caseAttachList1) {
791
+                                    if (caseAttach1.getAnnexType() == 3) {
792
+                                        annexName = caseAttach.getAnnexName();
793
+                                        prefix = "/profile/upload/";
794
+                                        startIndex = prefix.length();
795
+                                        path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
796
+                                        File file1 = new File(path);
797
+                                        if (!file1.exists()) {
798
+                                            return AjaxResult.error("未生成裁决书");
799
+                                        }
800
+                                        caseAttachList = caseAttachList1;
801
+                                        break;
802
+                                    }
803
+                                }
804
+                            }
805
+                        } catch (Exception e) {
806
+                            e.printStackTrace();
807
+                        }
806
                     }
808
                     }
807
-
809
+                    //找到签署后的PDF文件后调出该循环
810
+                    break;
808
                 }
811
                 }
809
             }
812
             }
810
         }
813
         }
857
         sendMailRecord1.setCreateBy(getUsername());
860
         sendMailRecord1.setCreateBy(getUsername());
858
         if (resEmailFlag) {
861
         if (resEmailFlag) {
859
             sendMailRecord1.setSendStatus(1);
862
             sendMailRecord1.setSendStatus(1);
860
-        }else {
863
+        } else {
861
             sendMailRecord1.setSendStatus(0);
864
             sendMailRecord1.setSendStatus(0);
862
         }
865
         }
863
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
866
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
864
-        if(!appEmailFlag&&!resEmailFlag){
867
+        if (!appEmailFlag && !resEmailFlag) {
865
             throw new ServiceException("裁决书发送失败");
868
             throw new ServiceException("裁决书发送失败");
866
         }
869
         }
867
-        if(!appEmailFlag){
870
+        if (!appEmailFlag) {
868
             throw new ServiceException("申请人裁决书发送失败");
871
             throw new ServiceException("申请人裁决书发送失败");
869
         }
872
         }
870
-        if(!resEmailFlag){
873
+        if (!resEmailFlag) {
871
             throw new ServiceException("被申请人裁决书发送失败");
874
             throw new ServiceException("被申请人裁决书发送失败");
872
         }
875
         }
873
         // 发送短信
876
         // 发送短信
874
-        if (appEmailFlag||resEmailFlag) {
877
+        if (appEmailFlag || resEmailFlag) {
875
 
878
 
876
             if (CollectionUtil.isNotEmpty(caseAffiliates)) {
879
             if (CollectionUtil.isNotEmpty(caseAffiliates)) {
877
                 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
880
                 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
878
                 request.setTemplateId("1990362");
881
                 request.setTemplateId("1990362");
879
                 for (CaseAffiliate affiliate : caseAffiliates) {
882
                 for (CaseAffiliate affiliate : caseAffiliates) {
880
-                    String telphone=null;
881
-                    if(appEmailFlag&&affiliate.getIdentityType()==1){
882
-                         telphone = affiliate.getContactTelphone();
883
-                    }else if(resEmailFlag&&affiliate.getIdentityType()==2){
884
-                         telphone = affiliate.getContactTelphone();
883
+                    String telphone = null;
884
+                    if (appEmailFlag && affiliate.getIdentityType() == 1) {
885
+                        telphone = affiliate.getContactTelphone();
886
+                    } else if (resEmailFlag && affiliate.getIdentityType() == 2) {
887
+                        telphone = affiliate.getContactTelphone();
885
                     }
888
                     }
886
-                    if(StrUtil.isEmpty(telphone)){
889
+                    if (StrUtil.isEmpty(telphone)) {
887
                         continue;
890
                         continue;
888
                     }
891
                     }
889
 
892
 
966
 //                Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null);
969
 //                Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null);
967
 //           //     Thread.sleep(20);
970
 //           //     Thread.sleep(20);
968
                 // 收到退信的所有id,即发送失败的uuid
971
                 // 收到退信的所有id,即发送失败的uuid
969
-            //    emailOutUtil.receiverMail();
970
-          //      Thread.sleep(3);
971
-           //   List<String> messageIds = emailOutUtil.receiverMail();
972
+                //    emailOutUtil.receiverMail();
973
+                //      Thread.sleep(3);
974
+                //   List<String> messageIds = emailOutUtil.receiverMail();
972
 //                if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) {
975
 //                if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) {
973
 //                    return Boolean.TRUE;
976
 //                    return Boolean.TRUE;
974
 //                }
977
 //                }
1085
             datas.put("acceptDate", registerDateStr);
1088
             datas.put("acceptDate", registerDateStr);
1086
             //反请求
1089
             //反请求
1087
             Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
1090
             Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
1088
-            String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
1089
-                    "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
1090
-                    "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
1091
+            String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
1091
             if (adjudicaCounter == null) {
1092
             if (adjudicaCounter == null) {
1092
                 datas.put("counterclaim", null);
1093
                 datas.put("counterclaim", null);
1093
             } else if (adjudicaCounter == 1) {
1094
             } else if (adjudicaCounter == 1) {
1097
             }
1098
             }
1098
             //财产保全
1099
             //财产保全
1099
             Integer properPreser = caseApplication1.getProperPreser();
1100
             Integer properPreser = caseApplication1.getProperPreser();
1100
-            String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
1101
-                    "第二十八条之规定,将该申请提交至法院。";
1101
+            String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + "第二十八条之规定,将该申请提交至法院。";
1102
             if (properPreser == null) {
1102
             if (properPreser == null) {
1103
                 datas.put("preservation", null);
1103
                 datas.put("preservation", null);
1104
             } else if (properPreser == 1) {
1104
             } else if (properPreser == 1) {
1108
             }
1108
             }
1109
             //管辖权异议
1109
             //管辖权异议
1110
             Integer objectiJuris = caseApplication1.getObjectiJuris();
1110
             Integer objectiJuris = caseApplication1.getObjectiJuris();
1111
-            String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" +
1112
-                    ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
1111
+            String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
1113
             if (objectiJuris == null) {
1112
             if (objectiJuris == null) {
1114
                 datas.put("jurisdictionalObjection", null);
1113
                 datas.put("jurisdictionalObjection", null);
1115
             } else if (objectiJuris == 1) {
1114
             } else if (objectiJuris == 1) {
1160
             } else if (isAbsence == 1) {
1159
             } else if (isAbsence == 1) {
1161
                 //缺席审理
1160
                 //缺席审理
1162
                 String absent1 = "申请人的特别授权委托代理人";
1161
                 String absent1 = "申请人的特别授权委托代理人";
1163
-                String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
1164
-                        "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
1165
-                String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," +
1166
-                        "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
1167
-                String absent4 = "(二/三)当事人提供的证据材料\n" +
1168
-                        "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
1169
-                String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
1170
-                        "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
1162
+                String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
1163
+                String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
1164
+                String absent4 = "(二/三)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
1165
+                String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
1171
                 datas.put("absent1", absent1);
1166
                 datas.put("absent1", absent1);
1172
                 datas.put("absent2", absent2);
1167
                 datas.put("absent2", absent2);
1173
                 datas.put("absent3", absent3);
1168
                 datas.put("absent3", absent3);
1179
                 String attend1 = "申请人的特别授权委托代理人";
1174
                 String attend1 = "申请人的特别授权委托代理人";
1180
                 String attend2 = "和被申请人本人/的特别授权委托代理人";
1175
                 String attend2 = "和被申请人本人/的特别授权委托代理人";
1181
                 String attend3 = "出席了庭审。";
1176
                 String attend3 = "出席了庭审。";
1182
-                String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" +
1183
-                        "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," +
1184
-                        "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," +
1185
-                        "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
1177
+                String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
1186
                 String attend5 = "(二)被申请人的答辩意见";
1178
                 String attend5 = "(二)被申请人的答辩意见";
1187
-                String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" +
1188
-                        "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
1179
+                String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
1189
                 String attend7 = "被申请人对上述材料的质证意见为:";
1180
                 String attend7 = "被申请人对上述材料的质证意见为:";
1190
                 datas.put("attend1", attend1);
1181
                 datas.put("attend1", attend1);
1191
                 datas.put("attend2", attend2);
1182
                 datas.put("attend2", attend2);
1199
                 datas.put("resAgentName", nameAgentList.get(1));
1190
                 datas.put("resAgentName", nameAgentList.get(1));
1200
                 if (arbitratMethod == 1) {
1191
                 if (arbitratMethod == 1) {
1201
                     //被申出席+开庭
1192
                     //被申出席+开庭
1202
-                    String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
1203
-                            "第五十一条的规定,裁决如下:";
1193
+                    String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第五十一条的规定,裁决如下:";
1204
                     datas.put("attend8", attend8);
1194
                     datas.put("attend8", attend8);
1205
                 } else {
1195
                 } else {
1206
                     //被申出席+书面
1196
                     //被申出席+书面
1207
-                    String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
1208
-                            "第五十一条、第五十八条的规定,裁决如下:";
1197
+                    String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第五十一条、第五十八条的规定,裁决如下:";
1209
                     datas.put("attend9", attend9);
1198
                     datas.put("attend9", attend9);
1210
                 }
1199
                 }
1211
             }
1200
             }
1221
                         if (isImageFile) {
1210
                         if (isImageFile) {
1222
                             String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
1211
                             String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
1223
                             System.out.println("路径是===========" + annexPath);
1212
                             System.out.println("路径是===========" + annexPath);
1224
-                            PictureRenderData pictureRenderData = WordUtil
1225
-                                    .rebuildImageContent(100, 100, null, annexPath);
1213
+                            PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, annexPath);
1226
                             datas.put("resEvidenceMaterial", pictureRenderData);
1214
                             datas.put("resEvidenceMaterial", pictureRenderData);
1227
                         }
1215
                         }
1228
                     } else if (caseAttach.getAnnexType() == 2) {   //申请人证据材料
1216
                     } else if (caseAttach.getAnnexType() == 2) {   //申请人证据材料
1231
                         if (isImageFile) {
1219
                         if (isImageFile) {
1232
                             String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
1220
                             String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
1233
                             System.out.println("路径是===========" + annexPath);
1221
                             System.out.println("路径是===========" + annexPath);
1234
-                            PictureRenderData pictureRenderData = WordUtil
1235
-                                    .rebuildImageContent(100, 100, null, annexPath);
1222
+                            PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, annexPath);
1236
                             //申请人证据材料
1223
                             //申请人证据材料
1237
                             datas.put("appEvidenceMaterial", pictureRenderData);
1224
                             datas.put("appEvidenceMaterial", pictureRenderData);
1238
                         }
1225
                         }
1270
 
1257
 
1271
 
1258
 
1272
             //将裁决书更新到附件表里
1259
             //将裁决书更新到附件表里
1273
-            CaseAttach caseAttach = CaseAttach.builder()
1274
-                    .caseAppliId(id)
1275
-                    .annexName(saveName)
1276
-                    .annexPath(savePath)
1277
-                    .annexType(3)
1278
-                    .build();
1260
+            CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build();
1279
             int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1261
             int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1280
 
1262
 
1281
 
1263
 
1408
             Gson gson = new Gson();
1390
             Gson gson = new Gson();
1409
             if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1391
             if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1410
                 JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1392
                 JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1411
-                if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) {
1393
+                if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) {
1412
                     JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1394
                     JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1413
-                    if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) {
1395
+                    if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) {
1414
                         idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1396
                         idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1415
                     }
1397
                     }
1416
                 }
1398
                 }
1423
                 JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1405
                 JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1424
                 if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1406
                 if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1425
                     JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1407
                     JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1426
-                    if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1408
+                    if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1427
                         // 免登录批量签链接(链接有效期2小时)
1409
                         // 免登录批量签链接(链接有效期2小时)
1428
                         String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1410
                         String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1429
                         // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1411
                         // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1459
             }
1441
             }
1460
             Integer batchNumber = idsReq.getBatchNumber();
1442
             Integer batchNumber = idsReq.getBatchNumber();
1461
             Integer caseStatus = CaseApplicationConstants.SIGN_ARBITRATION;
1443
             Integer caseStatus = CaseApplicationConstants.SIGN_ARBITRATION;
1462
-            List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
1444
+            List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber, caseStatus);
1463
             if (caseApplications != null && caseApplications.size() > 0) {
1445
             if (caseApplications != null && caseApplications.size() > 0) {
1464
                 List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
1446
                 List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
1465
                 idsReq.setIds(signFlowIds);
1447
                 idsReq.setIds(signFlowIds);
1478
                     }
1460
                     }
1479
                 }
1461
                 }
1480
 
1462
 
1481
-            }else{
1463
+            } else {
1482
                 throw new ServiceException("这个批号没有批量签名的案件");
1464
                 throw new ServiceException("这个批号没有批量签名的案件");
1483
             }
1465
             }
1484
 
1466
 
1498
             Gson gson = new Gson();
1480
             Gson gson = new Gson();
1499
             if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1481
             if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1500
                 JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1482
                 JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1501
-                if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) {
1483
+                if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) {
1502
                     JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1484
                     JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1503
-                    if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) {
1485
+                    if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) {
1504
                         idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1486
                         idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1505
                     }
1487
                     }
1506
                 }
1488
                 }
1510
             }
1492
             }
1511
             Integer batchNumber = idsReq.getBatchNumber();
1493
             Integer batchNumber = idsReq.getBatchNumber();
1512
             Integer caseStatus = CaseApplicationConstants.ARBITRATED_SEAL;
1494
             Integer caseStatus = CaseApplicationConstants.ARBITRATED_SEAL;
1513
-            List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
1495
+            List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber, caseStatus);
1514
             if (caseApplications != null && caseApplications.size() > 0) {
1496
             if (caseApplications != null && caseApplications.size() > 0) {
1515
                 List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
1497
                 List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
1516
                 idsReq.setIds(signFlowIds);
1498
                 idsReq.setIds(signFlowIds);
1520
                     JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1502
                     JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1521
                     if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1503
                     if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1522
                         JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1504
                         JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1523
-                        if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1505
+                        if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1524
                             // 免登录批量签链接(链接有效期2小时)
1506
                             // 免登录批量签链接(链接有效期2小时)
1525
                             String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1507
                             String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1526
                             // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1508
                             // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1529
                     }
1511
                     }
1530
                 }
1512
                 }
1531
 
1513
 
1532
-            }else{
1514
+            } else {
1533
                 throw new ServiceException("这个批号没有批量用印的案件");
1515
                 throw new ServiceException("这个批号没有批量用印的案件");
1534
             }
1516
             }
1535
         } catch (EsignDemoException e) {
1517
         } catch (EsignDemoException e) {
1561
                 return AjaxResult.error(e.getMessage());
1543
                 return AjaxResult.error(e.getMessage());
1562
             }
1544
             }
1563
 
1545
 
1564
-        }else{
1546
+        } else {
1565
             throw new ServiceException("这个批号没有批量归档的案件");
1547
             throw new ServiceException("这个批号没有批量归档的案件");
1566
         }
1548
         }
1567
 
1549
 
1698
                 sendMailRecord1.setCreateBy(getUsername());
1680
                 sendMailRecord1.setCreateBy(getUsername());
1699
                 if (resEmailFlag) {
1681
                 if (resEmailFlag) {
1700
                     sendMailRecord1.setSendStatus(1);
1682
                     sendMailRecord1.setSendStatus(1);
1701
-                }else {
1683
+                } else {
1702
                     sendMailRecord1.setSendStatus(0);
1684
                     sendMailRecord1.setSendStatus(0);
1703
                 }
1685
                 }
1704
                 sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
1686
                 sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
1705
-                if(!appEmailFlag&&!resEmailFlag){
1687
+                if (!appEmailFlag && !resEmailFlag) {
1706
                     throw new ServiceException("裁决书发送失败");
1688
                     throw new ServiceException("裁决书发送失败");
1707
                 }
1689
                 }
1708
-                if(!appEmailFlag){
1690
+                if (!appEmailFlag) {
1709
                     throw new ServiceException("申请人裁决书发送失败");
1691
                     throw new ServiceException("申请人裁决书发送失败");
1710
                 }
1692
                 }
1711
-                if(!resEmailFlag){
1693
+                if (!resEmailFlag) {
1712
                     throw new ServiceException("被申请人裁决书发送失败");
1694
                     throw new ServiceException("被申请人裁决书发送失败");
1713
                 }
1695
                 }
1714
                 // 发送短信
1696
                 // 发送短信
1715
-                if (appEmailFlag||resEmailFlag) {
1697
+                if (appEmailFlag || resEmailFlag) {
1716
 
1698
 
1717
                     if (CollectionUtil.isNotEmpty(caseAffiliates)) {
1699
                     if (CollectionUtil.isNotEmpty(caseAffiliates)) {
1718
                         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1700
                         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1719
                         request.setTemplateId("1990362");
1701
                         request.setTemplateId("1990362");
1720
                         for (CaseAffiliate affiliate : caseAffiliates) {
1702
                         for (CaseAffiliate affiliate : caseAffiliates) {
1721
-                            String telphone=null;
1722
-                            if(appEmailFlag&&affiliate.getIdentityType()==1){
1703
+                            String telphone = null;
1704
+                            if (appEmailFlag && affiliate.getIdentityType() == 1) {
1723
                                 telphone = affiliate.getContactTelphone();
1705
                                 telphone = affiliate.getContactTelphone();
1724
-                            }else if(resEmailFlag&&affiliate.getIdentityType()==2){
1706
+                            } else if (resEmailFlag && affiliate.getIdentityType() == 2) {
1725
                                 telphone = affiliate.getContactTelphone();
1707
                                 telphone = affiliate.getContactTelphone();
1726
                             }
1708
                             }
1727
-                            if(StrUtil.isEmpty(telphone)){
1709
+                            if (StrUtil.isEmpty(telphone)) {
1728
                                 continue;
1710
                                 continue;
1729
                             }
1711
                             }
1730
 
1712
 
1770
 
1752
 
1771
             }
1753
             }
1772
 
1754
 
1773
-        }else{
1755
+        } else {
1774
             throw new ServiceException("这个批号没有批量送达裁决书的案件");
1756
             throw new ServiceException("这个批号没有批量送达裁决书的案件");
1775
         }
1757
         }
1776
         return AjaxResult.success("仲裁文书送达成功");
1758
         return AjaxResult.success("仲裁文书送达成功");
1856
         return bookmarkList;
1838
         return bookmarkList;
1857
     }
1839
     }
1858
 
1840
 
1859
-
1860
 }
1841
 }

+ 76
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java Просмотреть файл

1
+package com.ruoyi.wisdomarbitrate.service.impl;
2
+
3
+import com.google.gson.Gson;
4
+import com.google.gson.JsonArray;
5
+import com.google.gson.JsonObject;
6
+import com.ruoyi.common.constant.FileTransformation;
7
+import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
8
+import com.ruoyi.common.exception.EsignDemoException;
9
+import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
10
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
11
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
12
+import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Service;
15
+
16
+import java.io.File;
17
+import java.io.IOException;
18
+import java.time.LocalDate;
19
+import java.util.UUID;
20
+
21
+/**
22
+ * 下载文件
23
+ */
24
+@Service
25
+public class DownFileService {
26
+    @Autowired
27
+    CaseAttachMapper caseAttachMapper;
28
+
29
+    /**
30
+     * 从E签宝下载签署完成后的PDF文件
31
+     */
32
+    public void downPdfFileFormEsign(String signFlowId, Long caseAppliId) throws EsignDemoException, IOException {
33
+        Gson gson = new Gson();
34
+        EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
35
+        JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
36
+        JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
37
+        JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
38
+        if (filesArray != null && filesArray.size() > 0) {
39
+            JsonObject fileObject = (JsonObject) filesArray.get(0);
40
+            String fileDownloadUrl = fileObject.get("downloadUrl").toString();
41
+            LocalDate now = LocalDate.now();
42
+            String year = Integer.toString(now.getYear());
43
+            String month = String.format("%02d", now.getMonthValue());
44
+            String day = String.format("%02d", now.getDayOfMonth());
45
+            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
46
+            String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
47
+            String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
48
+            String savePath = "/home/ruoyi/uploadPath/upload/";
49
+            // 创建日期目录
50
+            File saveFolder = new File(saveFolderPath);
51
+            if (!saveFolder.exists()) {
52
+                saveFolder.mkdirs();
53
+            }
54
+            String resultFilePath = saveFolderPath + "/" + fileName;
55
+            File resultFilePathFile = new File(resultFilePath);
56
+            if (!resultFilePathFile.exists()) {
57
+                resultFilePathFile.createNewFile();
58
+            }
59
+            String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
60
+            boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
61
+            if (downLoadFile) {
62
+                //立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、
63
+                // 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11)
64
+                caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3);
65
+                CaseAttach caseAttach = new CaseAttach();
66
+                caseAttach.setCaseAppliId(caseAppliId);
67
+                caseAttach.setAnnexType(3);
68
+                caseAttach.setAnnexPath(savePath);
69
+                caseAttach.setAnnexName(saveName);
70
+                caseAttachMapper.save(caseAttach);
71
+            }
72
+
73
+        }
74
+    }
75
+
76
+}