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

Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

wangqiong123 2 лет назад
Родитель
Сommit
e2c5fbf77d

+ 6
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java Просмотреть файл

@@ -84,10 +84,15 @@ public class MsVideoConferenceController extends BaseController {
84 84
                          caseAttach = MsCaseAttach.builder()
85 85
                                 .caseAppliId(caseId)
86 86
                                 .annexName(jsonObject.getString("fileName"))
87
-                                .annexPath(jsonObject.getString("filePath"))
88 87
                                 .annexType(annexType)
89 88
                                 .onlyOfficeFileId(jsonObject.getString("fileId"))
90 89
                                 .build();
90
+                         if(jsonObject.get("filePath")!=null){
91
+                             String officePath = jsonObject.getString("filePath");
92
+                             String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
93
+                                 caseAttach.setAnnexPath(replace);
94
+
95
+                         }
91 96
                         msCaseAttachMapper.save(caseAttach);
92 97
                     }
93 98
                     if(caseAttach==null){

+ 1
- 1
ruoyi-admin/src/main/resources/application.yml Просмотреть файл

@@ -120,7 +120,7 @@ token:
120 120
   header: Authorization
121 121
   # 令牌密钥
122 122
   secret: abcdefghijklmnopqrstuvwxyz
123
-  # 令牌有效期(默认120分钟)
123
+  # 令牌有效期(默认30分钟)
124 124
   expireTime: 120
125 125
 
126 126
 # MyBatis配置

+ 5
- 0
ruoyi-common/pom.xml Просмотреть файл

@@ -283,6 +283,11 @@
283 283
             <groupId>org.apache.httpcomponents</groupId>
284 284
             <artifactId>httpclient</artifactId>
285 285
         </dependency>
286
+        <dependency>
287
+            <groupId>org.thymeleaf</groupId>
288
+            <artifactId>thymeleaf</artifactId>
289
+            <version>3.0.12.RELEASE</version>
290
+        </dependency>
286 291
 
287 292
 
288 293
     </dependencies>

+ 21
- 44
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java Просмотреть файл

@@ -1,20 +1,13 @@
1 1
 package com.ruoyi.common.utils.file;
2 2
 
3
-import cn.hutool.json.JSONObject;
4
-import com.google.gson.Gson;
5
-import com.google.gson.JsonArray;
6
-import com.google.gson.JsonObject;
7 3
 import com.ruoyi.common.config.EsignDemoConfig;
8 4
 import com.ruoyi.common.constant.EsignHeaderConstant;
9
-import com.ruoyi.common.constant.FileTransformation;
10 5
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
11 6
 import com.ruoyi.common.enums.EsignRequestType;
12 7
 import com.ruoyi.common.exception.EsignDemoException;
13 8
 import com.ruoyi.common.utils.EsignHttpHelper;
14 9
 import com.ruoyi.common.utils.bean.EsignFileBean;
15
-import com.ruoyi.common.utils.uuid.IdUtils;
16 10
 
17
-import java.time.LocalDate;
18 11
 import java.util.Map;
19 12
 
20 13
 public class SaaSAPIFileUtils {
@@ -88,43 +81,27 @@ public class SaaSAPIFileUtils {
88 81
 
89 82
 
90 83
   public static void main(String[] args) throws EsignDemoException {
91
-        String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
92
-
93
-        EsignHttpResponse uploadUrl = getUploadUrl(filePath);
94
-        String body = uploadUrl.getBody();
95
-        JSONObject jsonObject = new JSONObject(body);
96
-        JSONObject dataObj = jsonObject.getJSONObject("data");
97
-        String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
98
-        System.out.println("这是fileUploadUrl:"+fileUploadUrl);
99
-        String fileId = dataObj.get("fileId").toString();
100
-        System.out.println("这是fileId:"+fileId);
101
-      //String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
102
-        EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
103
-        System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
104
-        EsignHttpResponse fileStatus = getFileStatus(fileId);
105
-        System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
106
-//        getFileStatus("a808f1f39a744357a2f018e4ab34c55d");
107
-//     fileDownloadUrl("");
108
-
109
-
110
-//      Gson gson = new Gson();
111
-//      EsignHttpResponse fileDownload = fileDownloadUrl(signFlowId);
112
-//      JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
113
-//      JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
114
-//      JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
115
-//      if(filesArray!=null&&filesArray.size()>0){
116
-//          JsonObject fileObject = (JsonObject)filesArray.get(0);
117
-//          String fileDownloadUrl = fileObject.get("downloadUrl").toString();
118
-//          String fileName = java.util.UUID.randomUUID().toString().replace("-", "") + ".pdf";
119
-//          String savePath = "/home/ruoyi/uploadPath/upload";
120
-//          LocalDate now = LocalDate.now();
121
-//          String year = Integer.toString(now.getYear());
122
-//          String month = String.format("%02d", now.getMonthValue());
123
-//          String day = String.format("%02d", now.getDayOfMonth());
124
-//          String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
125
-//          String fileDownloadUrlnew  = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
126
-//          FileTransformation.downLoadFileByUrl(fileDownloadUrlnew,dir);
127
-//      }
84
+      fileDownloadUrl("8425b244bf4b417dbb22fd39a1c2d65f");
85
+
86
+
87
+
88
+
89
+//        String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
90
+//
91
+//        EsignHttpResponse uploadUrl = getUploadUrl(filePath);
92
+//        String body = uploadUrl.getBody();
93
+//        JSONObject jsonObject = new JSONObject(body);
94
+//        JSONObject dataObj = jsonObject.getJSONObject("data");
95
+//        String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
96
+//        System.out.println("这是fileUploadUrl:"+fileUploadUrl);
97
+//        String fileId = dataObj.get("fileId").toString();
98
+//        System.out.println("这是fileId:"+fileId);
99
+//      //String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
100
+//        EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
101
+//        System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
102
+//        EsignHttpResponse fileStatus = getFileStatus(fileId);
103
+//        System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
104
+
128 105
 
129 106
 
130 107
 

+ 15
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java Просмотреть файл

@@ -324,6 +324,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
324 324
         if (identifyName == null) {
325 325
             AjaxResult.error("请检查参数是否完整");
326 326
         }
327
+        // 查询是否存在机构
328
+        SysDept sysDept = sysDeptMapper.selectDeptByName(identifyName);
327 329
         Integer identifyType = deptIdentify.getIdentifyType();
328 330
         if (identifyType == null) {
329 331
             deptIdentify.setIdentifyType(1); // 设置机构默认为仲裁机构
@@ -331,11 +333,19 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
331 333
         deptIdentify.setIdentifyStatus(0); //设置认证状态默认为未认证
332 334
         deptIdentify.setIsUse(0); //设置机构默认为未启用
333 335
         //将机构名称保存到部门表里
334
-        SysDept sysDept = new SysDept();
335
-        sysDept.setDeptName(identifyName);
336
-        sysDept.setParentId(0L);
337
-        sysDept.setDeptType(1);
338
-        int i1 = sysDeptMapper.insertDept(sysDept);
336
+        int i1=0;
337
+        if(sysDept == null) {
338
+             sysDept = new SysDept();
339
+             sysDept.setParentId(0L);
340
+            sysDept.setDeptName(identifyName);
341
+            sysDept.setDeptType(1);
342
+            i1 = sysDeptMapper.insertDept(sysDept);
343
+        }
344
+        else {
345
+            sysDept.setDeptType(1);
346
+            sysDeptMapper.updateDept(sysDept);
347
+        }
348
+
339 349
         if (i1 > 0) {
340 350
            /* //将经办人信息存入到用户表里
341 351
             Long deptId = sysDept.getDeptId();

+ 63
- 28
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Просмотреть файл

@@ -2132,6 +2132,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2132 2132
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
2133 2133
         // 根据案件id查询案件
2134 2134
         MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
2135
+        if (caseApplication == null) {
2136
+            throw new ServiceException("未找到案件");
2137
+        }
2135 2138
         caseApplication.setHearDate(application.getHearDate());
2136 2139
         ExecutorService executor = ThreadUtil.createThreadPool();
2137 2140
         CompletableFuture.runAsync(() -> {
@@ -2141,15 +2144,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2141 2144
 
2142 2145
                         // 申请人发送开庭日期短信
2143 2146
                         sendHearDateSms(caseApplication, affiliates);
2147
+                        // 调解员发送开庭短信
2148
+                        sendMeditorHearDateSms(caseApplication,vo);
2144 2149
 
2145
-
2146
-                    }
2150
+                                           }
2147 2151
                 }, executor);
2148
-        // 调解员发送短信,根据调解员id查询用户
2149
-        CompletableFuture.runAsync(() -> { if (caseApplication.getMediatorId() != null) {
2152
+
2153
+        // 新增日志
2154
+        CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
2155
+
2156
+    }
2157
+
2158
+    /**
2159
+     * 调解员发送开庭短信
2160
+     * @param caseApplication
2161
+     * @param vo
2162
+     */
2163
+    private void sendMeditorHearDateSms(MsCaseApplication caseApplication, BookingVO vo) {
2164
+        if (caseApplication.getMediatorId() != null && CollectionUtil.isNotEmpty(vo.getHerDates()) && StrUtil.isNotEmpty(caseApplication.getHearDate())) {
2150 2165
             // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
2151 2166
             SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
2152
-            String content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "的案件,线下调解日期已确定为" + application.getHearDate() + ",请知晓,如非本人操作,请忽略本短信。";
2167
+            String content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "的案件,线下调解日期已确定为" + caseApplication.getHearDate() + ",请知晓,如非本人操作,请忽略本短信。";
2153 2168
             String templateId = "2077966";
2154 2169
             String subject = "开庭日期通知";
2155 2170
             MsCaseAffiliate meditorAffliate = new MsCaseAffiliate();
@@ -2163,17 +2178,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2163 2178
                 roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
2164 2179
                 // 短信模板:2130103 线上调解时间和会议通知  尊敬的用户,您的{2}线上开庭时间为{3},会议链接https://txroom.xayunmei.com/#/home?{4},请点击链接参加会议,如非本人操作,请忽略本短信.
2165 2180
 
2166
-                content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为" + application.getHearDate() + "会议链接https://txroom.xayunmei.com/#/home?" +"authId="+ roomUuid + ",请点击链接参加会议,如非本人操作,请忽略本短信.";
2181
+                content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为" + caseApplication.getHearDate() + "会议链接https://txroom.xayunmei.com/#/home?" +"authId="+ roomUuid + ",请点击链接参加会议,如非本人操作,请忽略本短信.";
2167 2182
                 templateId = "2130103";
2168 2183
             }
2169 2184
             // 电话号不为空,发送短信,否则发邮箱
2170 2185
             if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
2171 2186
                 if (roomUuid == null) {
2172 2187
                     SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
2173
-                            new String[]{caseApplication.getCaseNum(), application.getHearDate()});
2188
+                            new String[]{caseApplication.getCaseNum(), caseApplication.getHearDate()});
2174 2189
                 } else {
2175 2190
                     SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
2176
-                            new String[]{caseApplication.getCaseNum(), application.getHearDate(), "authId="+roomUuid});
2191
+                            new String[]{caseApplication.getCaseNum(), caseApplication.getHearDate(), "authId="+roomUuid});
2177 2192
                 }
2178 2193
 
2179 2194
 
@@ -2182,11 +2197,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2182 2197
                 caseApplicationService.sendEmail(caseApplication, meditorAffliate, subject, content);
2183 2198
 
2184 2199
             }
2185
-        } }, executor);
2186
-        // 新增日志
2187
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
2200
+        }
2188 2201
 
2189 2202
     }
2203
+
2190 2204
     /**
2191 2205
      * 发送开庭日期短信
2192 2206
      * @param application
@@ -2386,6 +2400,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2386 2400
     public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) {
2387 2401
         if(StrUtil.isEmpty(caseAttach.getAnnexName())) {
2388 2402
             caseAttach.setAnnexName("调解书");
2403
+        }
2404
+        if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())) {
2405
+            String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath", "/profile");
2406
+            caseAttach.setAnnexPath(replace);
2389 2407
         }
2390 2408
             caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
2391 2409
             caseAttach.setUseId(getUserInfo().getUserId());
@@ -2483,8 +2501,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2483 2501
                     for (MsCaseAttach caseAttach : caseAttachList) {
2484 2502
                         if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
2485 2503
                             String annexPath = caseAttach.getAnnexPath();
2486
-                            if (annexPath.contains("/profile/upload")) {
2487
-                                annexPath = annexPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload");
2504
+                              if (annexPath.contains("/profile")) {
2505
+                                annexPath = annexPath.replace("/profile", "/home/ruoyi/uploadPath");
2488 2506
                             }
2489 2507
                             String path = annexPath;
2490 2508
                             //获取文件上传地址
@@ -2829,8 +2847,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2829 2847
                     for (MsCaseAttach caseAttach : caseAttachList) {
2830 2848
                         if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
2831 2849
                             String annexPath = caseAttach.getAnnexPath();
2832
-                            if (annexPath.contains("/profile/upload")) {
2833
-                                annexPath = annexPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload");
2850
+                            if (annexPath.contains("/profile")) {
2851
+                                annexPath = annexPath.replace("/profile", "/home/ruoyi/uploadPath");
2834 2852
                             }
2835 2853
                             String path = annexPath;
2836 2854
                             //获取文件上传地址
@@ -2959,7 +2977,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2959 2977
                                                SmsUtils.sendSms(application, "2047719",resAffiliateOpt.get().getPhone(), new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew});
2960 2978
 
2961 2979
                                             } else {
2962
-                                                throw new ServiceException(jsonObject3.getString("message"));
2980
+                                                return AjaxResult.error(jsonObject3.getString("message"));
2963 2981
                                             }
2964 2982
                                         } else {
2965 2983
                                             return AjaxResult.error();
@@ -3019,14 +3037,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3019 3037
             List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
3020 3038
             if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
3021 3039
                 for (MsCaseAttach msCaseAttach : msCaseAttaches) {
3022
-                    String templatePath = "/home/ruoyi" + msCaseAttach.getAnnexPath();
3023
-                    File file = new File(templatePath.replace("/profile", "/uploadPath"));
3040
+                    if (StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
3041
+                        continue;
3042
+                    }
3043
+
3044
+                    String replacePath = msCaseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
3045
+                    File file = new File(replacePath);
3024 3046
                     MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
3025 3047
                     // 更新附件表
3026 3048
                     if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
3027 3049
                         msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
3028 3050
                         msCaseAttachMapper.updateCaseAttach(msCaseAttach);
3029 3051
                     }
3052
+
3053
+
3030 3054
                 }
3031 3055
             }
3032 3056
             // 修改案件状态为待送达
@@ -3398,12 +3422,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3398 3422
                     caseAttach=    MsCaseAttach.builder()
3399 3423
                             .caseAppliId(application.getId())
3400 3424
                             .annexName(jsonObject.getString("fileName"))
3401
-                            .annexPath(jsonObject.getString("filePath"))
3402 3425
                             .annexType(annexType)
3403 3426
                             .onlyOfficeFileId(jsonObject.getString("fileId"))
3404 3427
                             .build();
3405 3428
 
3429
+                    if(jsonObject.get("filePath")!=null){
3430
+                        String officePath = jsonObject.getString("filePath");
3431
+                        String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
3432
+                        caseAttach.setAnnexPath(replace);
3433
+
3434
+                    }
3435
+
3406 3436
                 }
3437
+
3407 3438
                 //保存到附件表里,先删除之前的在保存
3408 3439
                 msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
3409 3440
                 msCaseAttachMapper.save(caseAttach);
@@ -3430,16 +3461,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3430 3461
             msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
3431 3462
             if(StrUtil.isEmpty(application.getCaseSource())) {
3432 3463
                 // 北明推送
3433
-                String path = "/home/ruoyi" + caseAttach.getAnnexPath();
3434
-                File file = new File(path.replace("/profile", "/uploadPath"));
3435
-                MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_APPLY_BOOK);
3464
+                if (StrUtil.isNotEmpty(caseAttach.getAnnexPath())) {
3465
+                    String replacePath = caseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
3466
+                    File file = new File(replacePath);
3467
+                    MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_APPLY_BOOK);
3436 3468
 
3437
-                // 更新附件表
3438
-                if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
3439
-                    caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
3469
+                    // 更新附件表
3470
+                    if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
3471
+                        caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
3472
+                    }
3440 3473
                 }
3441
-            }
3442
-            msCaseAttachMapper.save(caseAttach);
3474
+                msCaseAttachMapper.save(caseAttach);
3475
+                }
3476
+
3477
+
3443 3478
         }
3444 3479
 
3445 3480
     }
@@ -3451,7 +3486,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3451 3486
     @Override
3452 3487
     @Transactional
3453 3488
     public JSONArray uploadOnlyOffice(String annexPath,Long caseId) {
3454
-        annexPath=annexPath.replace("/profile","/home/ruoyi/uploadPath");
3489
+        annexPath=annexPath.replace("/profile/","/home/ruoyi/uploadPath/");
3455 3490
         File file = new File(annexPath);
3456 3491
         if (file.exists()) {
3457 3492
            // 调用onlyoffice

+ 146
- 132
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Просмотреть файл

@@ -59,6 +59,7 @@ import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
59 59
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
60 60
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
61 61
 import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
62
+import lombok.extern.slf4j.Slf4j;
62 63
 import org.springframework.beans.BeanUtils;
63 64
 import org.springframework.beans.factory.annotation.Autowired;
64 65
 import org.springframework.beans.factory.annotation.Value;
@@ -76,7 +77,7 @@ import java.util.concurrent.ExecutorService;
76 77
 import java.util.stream.Collectors;
77 78
 
78 79
 import static com.ruoyi.common.core.domain.AjaxResult.success;
79
-
80
+@Slf4j
80 81
 @Service
81 82
 public class MsSignSealServiceImpl implements MsSignSealService {
82 83
 
@@ -706,6 +707,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
706 707
         JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
707 708
         Gson gson = new Gson();
708 709
         if (jsonObjectCallback != null) {
710
+            log.info("签名回调======"+jsonObjectCallback);
709 711
             int signResult = jsonObjectCallback.getIntValue("signResult");
710 712
             String action = jsonObjectCallback.getString("action");
711 713
             String signFlowId = jsonObjectCallback.getString("signFlowId");
@@ -857,11 +859,15 @@ public class MsSignSealServiceImpl implements MsSignSealService {
857 859
                             //修改"签署用印记录表"的状态为待用印
858 860
                             if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
859 861
                                 sealSignRecordsel.setSignFlowStatus(2);
862
+                                sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
860 863
                             }else {
861 864
                                 // 否则为已完成
862 865
                                 sealSignRecordsel.setSignFlowStatus(3);
866
+                                sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
867
+                                // 下载调解书
868
+                                downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
863 869
                             }
864
-                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
870
+
865 871
                         }
866 872
                     }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc) && caseApplicationselect.getSealFlag()!=null && caseApplicationselect.getSealFlag()==1 ){
867 873
                         //需要用印
@@ -915,71 +921,72 @@ public class MsSignSealServiceImpl implements MsSignSealService {
915 921
                             sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
916 922
 
917 923
                             //下载审核完成的调解书
918
-                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
919
-                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
920
-                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
921
-                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
922
-                            if (filesArray != null && filesArray.size() > 0) {
923
-                                JsonObject fileObject = (JsonObject) filesArray.get(0);
924
-                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
925
-                                LocalDate now = LocalDate.now();
926
-                                String year = Integer.toString(now.getYear());
927
-                                String month = String.format("%02d", now.getMonthValue());
928
-                                String day = String.format("%02d", now.getDayOfMonth());
929
-                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
930
-                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
931
-                                String saveName = fileName;
932
-                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
933
-
934
-                                // 创建日期目录
935
-                                File saveFolder = new File(saveFolderPath);
936
-                                if (!saveFolder.exists()) {
937
-                                    saveFolder.mkdirs();
938
-                                }
939
-                                String resultFilePath = saveFolderPath + "/" + fileName;
940
-                                File resultFilePathFile = new File(resultFilePath);
941
-                                if (!resultFilePathFile.exists()) {
942
-                                    resultFilePathFile.createNewFile();
943
-                                }
944
-
945
-                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
946
-                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
947
-                                if (downLoadFile) {
948
-                                    // 先删除已经存在的调解书
949
-                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
950
-                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
951
-                                        if(CollectionUtil.isNotEmpty(existAttach)){
952
-                                            //  对接北明,同步案件状态,删除
953
-                                            for (MsCaseAttach msCaseAttach : existAttach) {
954
-                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
955
-                                                    continue;
956
-                                                }
957
-                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
958
-                                            }
959
-                                        }
960
-                                    }
961
-                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
962
-                                    MsCaseAttach caseAttach = new MsCaseAttach();
963
-                                    caseAttach.setCaseAppliId(caseAppliId);
964
-                                    caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
965
-                                    caseAttach.setAnnexPath(savePath);
966
-                                    caseAttach.setAnnexName(saveName);
967
-                                    caseAttachMapper.save(caseAttach);
968
-                                    //  对接北明,调用上传附件接口
969
-                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
970
-                                        String templatePath = "/home/ruoyi" + savePath;
971
-                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
972
-                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
973
-                                        // 更新附件表
974
-                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
975
-                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
976
-                                            msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
977
-                                        }
978
-
979
-                                    }
980
-                                }
981
-
982
-                            }
924
+                            downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
925
+//                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
926
+//                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
927
+//                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
928
+//                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
929
+//                            if (filesArray != null && filesArray.size() > 0) {
930
+//                                JsonObject fileObject = (JsonObject) filesArray.get(0);
931
+//                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
932
+//                                LocalDate now = LocalDate.now();
933
+//                                String year = Integer.toString(now.getYear());
934
+//                                String month = String.format("%02d", now.getMonthValue());
935
+//                                String day = String.format("%02d", now.getDayOfMonth());
936
+//                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
937
+//                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
938
+//                                String saveName = fileName;
939
+//                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
940
+//
941
+//                                // 创建日期目录
942
+//                                File saveFolder = new File(saveFolderPath);
943
+//                                if (!saveFolder.exists()) {
944
+//                                    saveFolder.mkdirs();
945
+//                                }
946
+//                                String resultFilePath = saveFolderPath + "/" + fileName;
947
+//                                File resultFilePathFile = new File(resultFilePath);
948
+//                                if (!resultFilePathFile.exists()) {
949
+//                                    resultFilePathFile.createNewFile();
950
+//                                }
951
+//
952
+//                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
953
+//                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
954
+//                                if (downLoadFile) {
955
+//                                    // 先删除已经存在的调解书
956
+//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
957
+//                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
958
+//                                        if(CollectionUtil.isNotEmpty(existAttach)){
959
+//                                            //  对接北明,同步案件状态,删除
960
+//                                            for (MsCaseAttach msCaseAttach : existAttach) {
961
+//                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
962
+//                                                    continue;
963
+//                                                }
964
+//                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
965
+//                                            }
966
+//                                        }
967
+//                                    }
968
+//                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
969
+//                                    MsCaseAttach caseAttach = new MsCaseAttach();
970
+//                                    caseAttach.setCaseAppliId(caseAppliId);
971
+//                                    caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
972
+//                                    caseAttach.setAnnexPath(savePath);
973
+//                                    caseAttach.setAnnexName(saveName);
974
+//                                    caseAttachMapper.save(caseAttach);
975
+//                                    //  对接北明,调用上传附件接口
976
+//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
977
+//                                        String templatePath = "/home/ruoyi" + savePath;
978
+//                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
979
+//                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
980
+//                                        // 更新附件表
981
+//                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
982
+//                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
983
+//                                            msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
984
+//                                        }
985
+//
986
+//                                    }
987
+//                                }
988
+//
989
+//                            }
983 990
                         }
984 991
                     }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
985 992
                         //被申请人签名
@@ -1005,71 +1012,72 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1005 1012
                             sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1006 1013
 
1007 1014
                             //下载审核完成的调解书
1008
-                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
1009
-                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
1010
-                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1011
-                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1012
-                            if (filesArray != null && filesArray.size() > 0) {
1013
-                                JsonObject fileObject = (JsonObject) filesArray.get(0);
1014
-                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
1015
-                                LocalDate now = LocalDate.now();
1016
-                                String year = Integer.toString(now.getYear());
1017
-                                String month = String.format("%02d", now.getMonthValue());
1018
-                                String day = String.format("%02d", now.getDayOfMonth());
1019
-                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1020
-                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
1021
-                                String saveName = fileName;
1022
-                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1023
-
1024
-                                // 创建日期目录
1025
-                                File saveFolder = new File(saveFolderPath);
1026
-                                if (!saveFolder.exists()) {
1027
-                                    saveFolder.mkdirs();
1028
-                                }
1029
-                                String resultFilePath = saveFolderPath + "/" + fileName;
1030
-                                File resultFilePathFile = new File(resultFilePath);
1031
-                                if (!resultFilePathFile.exists()) {
1032
-                                    resultFilePathFile.createNewFile();
1033
-                                }
1034
-
1035
-                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1036
-                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1037
-                                if (downLoadFile) {
1038
-                                    // 先删除已经存在的调解书
1039
-                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
1040
-                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1041
-                                        if(CollectionUtil.isNotEmpty(existAttach)){
1042
-                                            //  对接北明,同步案件状态,删除
1043
-                                            for (MsCaseAttach msCaseAttach : existAttach) {
1044
-                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1045
-                                                    continue;
1046
-                                                }
1047
-                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
1048
-                                            }
1049
-                                        }
1050
-                                    }
1051
-                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1052
-                                    MsCaseAttach caseAttach = new MsCaseAttach();
1053
-                                    caseAttach.setCaseAppliId(caseAppliId);
1054
-                                    caseAttach.setAnnexType(7);
1055
-                                    caseAttach.setAnnexPath(savePath);
1056
-                                    caseAttach.setAnnexName(saveName);
1057
-
1058
-                                    //  对接北明,调用上传附件接口
1059
-
1060
-                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1061
-                                        String templatePath = "/home/ruoyi" + savePath;
1062
-                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
1063
-                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
1064
-                                        // 更新附件表
1065
-                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
1066
-                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
1067
-                                        }
1068
-                                    }
1069
-                                    caseAttachMapper.save(caseAttach);
1070
-                                }
1071
-
1072
-                            }
1015
+                            downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
1016
+//                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
1017
+//                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
1018
+//                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1019
+//                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1020
+//                            if (filesArray != null && filesArray.size() > 0) {
1021
+//                                JsonObject fileObject = (JsonObject) filesArray.get(0);
1022
+//                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
1023
+//                                LocalDate now = LocalDate.now();
1024
+//                                String year = Integer.toString(now.getYear());
1025
+//                                String month = String.format("%02d", now.getMonthValue());
1026
+//                                String day = String.format("%02d", now.getDayOfMonth());
1027
+//                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1028
+//                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
1029
+//                                String saveName = fileName;
1030
+//                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1031
+//
1032
+//                                // 创建日期目录
1033
+//                                File saveFolder = new File(saveFolderPath);
1034
+//                                if (!saveFolder.exists()) {
1035
+//                                    saveFolder.mkdirs();
1036
+//                                }
1037
+//                                String resultFilePath = saveFolderPath + "/" + fileName;
1038
+//                                File resultFilePathFile = new File(resultFilePath);
1039
+//                                if (!resultFilePathFile.exists()) {
1040
+//                                    resultFilePathFile.createNewFile();
1041
+//                                }
1042
+//
1043
+//                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1044
+//                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1045
+//                                if (downLoadFile) {
1046
+//                                    // 先删除已经存在的调解书
1047
+//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
1048
+//                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1049
+//                                        if(CollectionUtil.isNotEmpty(existAttach)){
1050
+//                                            //  对接北明,同步案件状态,删除
1051
+//                                            for (MsCaseAttach msCaseAttach : existAttach) {
1052
+//                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1053
+//                                                    continue;
1054
+//                                                }
1055
+//                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
1056
+//                                            }
1057
+//                                        }
1058
+//                                    }
1059
+//                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1060
+//                                    MsCaseAttach caseAttach = new MsCaseAttach();
1061
+//                                    caseAttach.setCaseAppliId(caseAppliId);
1062
+//                                    caseAttach.setAnnexType(7);
1063
+//                                    caseAttach.setAnnexPath(savePath);
1064
+//                                    caseAttach.setAnnexName(saveName);
1065
+//
1066
+//                                    //  对接北明,调用上传附件接口
1067
+//
1068
+//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1069
+//                                        String templatePath = "/home/ruoyi" + savePath;
1070
+//                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
1071
+//                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
1072
+//                                        // 更新附件表
1073
+//                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
1074
+//                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
1075
+//                                        }
1076
+//                                    }
1077
+//                                    caseAttachMapper.save(caseAttach);
1078
+//                                }
1079
+//
1080
+//                            }
1073 1081
                         }
1074 1082
                     }
1075 1083
                 }
@@ -1082,10 +1090,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1082 1090
     }
1083 1091
 
1084 1092
     private void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId) throws EsignDemoException, IOException {
1093
+        log.info("signFlowId===="+signFlowId);
1085 1094
         EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
1095
+        log.info("下载成功===="+fileDownload);
1086 1096
         JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
1087 1097
         JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1088 1098
         JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1099
+        log.info("下载调解书pdf===="+filesArray);
1089 1100
         if (filesArray != null && filesArray.size() > 0) {
1090 1101
             JsonObject fileObject = (JsonObject) filesArray.get(0);
1091 1102
             String fileDownloadUrl = fileObject.get("downloadUrl").toString();
@@ -1111,6 +1122,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1111 1122
 
1112 1123
             String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1113 1124
             boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1125
+            log.info("是否下载成功======="+downLoadFile);
1114 1126
             if (downLoadFile) {
1115 1127
                 // 先删除已经存在的调解书
1116 1128
                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
@@ -1126,11 +1138,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1126 1138
                     }
1127 1139
                 }
1128 1140
                 msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1141
+
1129 1142
                 MsCaseAttach caseAttach = new MsCaseAttach();
1130 1143
                 caseAttach.setCaseAppliId(caseAppliId);
1131 1144
                 caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
1132 1145
                 caseAttach.setAnnexPath(savePath);
1133 1146
                 caseAttach.setAnnexName(saveName);
1147
+                log.info("调解书保存======="+downLoadFile);
1134 1148
                 caseAttachMapper.save(caseAttach);
1135 1149
                 //  对接北明,调用上传附件接口
1136 1150
                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {

+ 2
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml Просмотреть файл

@@ -113,7 +113,7 @@
113 113
   <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
114 114
     select t.* from(
115 115
     SELECT
116
-    c.id,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
116
+    c.id,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
117 117
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
118 118
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
119 119
     c.mediation_method mediationMethod,
@@ -123,7 +123,7 @@
123 123
     c.id
124 124
     union
125 125
     SELECT
126
-    c.id,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
126
+    c.id,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
127 127
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
128 128
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
129 129
     c.mediation_method mediationMethod,