Selaa lähdekoodia

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

qtz 2 vuotta sitten
vanhempi
commit
1023662211

+ 13
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java Näytä tiedosto

@@ -89,6 +89,19 @@ public class MsSignSealController  extends BaseController {
89 89
         return msSignSealService.msCaseFile(dto.getIds());
90 90
     }
91 91
 
92
+    /**
93
+     * 签收
94
+     * @param dto
95
+     * @return
96
+     */
97
+    @PostMapping("/msCaseSign")
98
+    public AjaxResult msCaseSign(@RequestBody MsSignSealDTO dto){
99
+        if (dto.getCaseId() == null) {
100
+            return error("参数校验失败");
101
+        }
102
+        return msSignSealService.msCaseSign(dto);
103
+    }
104
+
92 105
 
93 106
 
94 107
 

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/MsSignSealDTO.java Näytä tiedosto

@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.domain.dto.mscase;
2 2
 
3 3
 import lombok.Data;
4 4
 
5
+import javax.persistence.Column;
5 6
 import java.util.List;
6 7
 
7 8
 @Data
@@ -22,6 +23,15 @@ public class MsSignSealDTO {
22 23
 
23 24
     private List<Long> ids;
24 25
 
26
+    /**
27
+     * 申请人是否签收
28
+     */
29
+    private Integer isSignApply;
30
+    /**
31
+     * 被申请人是否签收
32
+     */
33
+    private Integer isSignRespon;
34
+
25 35
 
26 36
 
27 37
 }

+ 11
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java Näytä tiedosto

@@ -127,4 +127,15 @@ public class MsCaseAffiliate {
127 127
      */
128 128
     @Column(name = "respondent_track_num")
129 129
     private String respondentTrackNum;
130
+
131
+    /**
132
+     * 申请人是否签收
133
+     */
134
+    @Column(name = "is_sign_apply")
135
+    private Integer isSignApply;
136
+    /**
137
+     * 被申请人是否签收
138
+     */
139
+    @Column(name = "is_sign_respon")
140
+    private Integer isSignRespon;
130 141
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java Näytä tiedosto

@@ -24,4 +24,6 @@ public interface MsSignSealService {
24 24
     List<MsCaseLogRecordVO> selectCaseLogRecordList(MsSignSealDTO dto);
25 25
 
26 26
     AjaxResult msCaseFile(List<Long> ids);
27
+
28
+    AjaxResult msCaseSign(MsSignSealDTO dto);
27 29
 }

+ 35
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Näytä tiedosto

@@ -601,6 +601,41 @@ public class MsSignSealServiceImpl implements MsSignSealService {
601 601
         return AjaxResult.success("归档成功");
602 602
     }
603 603
 
604
+    @Override
605
+    @Transactional
606
+    public AjaxResult msCaseSign(MsSignSealDTO dto) {
607
+        Long caseId = dto.getCaseId();
608
+        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
609
+        MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseId);
610
+        if (dto.getIsSignApply() != null && dto.getIsSignApply().intValue() == 1) {
611
+            caseAffiliate.setIsSignApply(1);
612
+            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
613
+            if (caseAffiliate.getIsSignRespon() != null && caseAffiliate.getIsSignRespon().intValue() == 1) {
614
+                // 根据流程id查找下一个流程节点
615
+                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
616
+                caseApplicationselect.setCaseFlowId(nextFlow.getId());
617
+                caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
618
+                caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
619
+                CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"签收");
620
+            }
621
+        }
622
+        if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
623
+            caseAffiliate.setIsSignRespon(1);
624
+            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
625
+            if (caseAffiliate.getIsSignApply() != null && caseAffiliate.getIsSignApply().intValue() == 1) {
626
+                // 根据流程id查找下一个流程节点
627
+                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
628
+                caseApplicationselect.setCaseFlowId(nextFlow.getId());
629
+                caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
630
+                caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
631
+                CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"签收");
632
+            }
633
+        }
634
+
635
+        return AjaxResult.success("签收成功");
636
+
637
+    }
638
+
604 639
     /**
605 640
      * 通过邮件发送裁决书文件
606 641
      *

+ 45
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Näytä tiedosto

@@ -244,7 +244,7 @@ public class FixSelectFlowDetailUtils {
244 244
     /*
245 245
     定时查询签署流程详情
246 246
      */
247
-//    @Scheduled(cron = "0/10 * * * * ?")
247
+    @Scheduled(cron = "0/10 * * * * ?")
248 248
     @Transactional
249 249
     public void fixExecuteSelectFlowDetailUtils() {
250 250
         Gson gson = new Gson();
@@ -319,12 +319,55 @@ public class FixSelectFlowDetailUtils {
319 319
                             application.setCaseFlowId(nextFlow.getId());
320 320
                             application.setCaseStatusName(nextFlow.getCaseStatusName());
321 321
                             caseApplicationMapper.updateByPrimaryKeySelective(application);
322
+
323
+                            //下载审核完成的调解书
324
+                            String signFlowId = sealSignRecord.getSignFlowid();
325
+                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
326
+                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
327
+                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
328
+                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
329
+                            if (filesArray != null && filesArray.size() > 0) {
330
+                                JsonObject fileObject = (JsonObject) filesArray.get(0);
331
+                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
332
+                                LocalDate now = LocalDate.now();
333
+                                String year = Integer.toString(now.getYear());
334
+                                String month = String.format("%02d", now.getMonthValue());
335
+                                String day = String.format("%02d", now.getDayOfMonth());
336
+                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
337
+                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
338
+                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
339
+                                String savePath = "/home/ruoyi/uploadPath/upload/";
340
+
341
+                                // 创建日期目录
342
+                                File saveFolder = new File(saveFolderPath);
343
+                                if (!saveFolder.exists()) {
344
+                                    saveFolder.mkdirs();
345
+                                }
346
+                                String resultFilePath = saveFolderPath + "/" + fileName;
347
+                                File resultFilePathFile = new File(resultFilePath);
348
+                                if (!resultFilePathFile.exists()) {
349
+                                    resultFilePathFile.createNewFile();
350
+                                }
351
+
352
+                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
353
+                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
354
+                                if (downLoadFile) {
355
+                                    Long caseAppliId = sealSignRecord.getCaseAppliId();
356
+                                    MsCaseAttach caseAttach = new MsCaseAttach();
357
+                                    caseAttach.setCaseAppliId(caseAppliId);
358
+                                    caseAttach.setAnnexType(3);
359
+                                    caseAttach.setAnnexPath(savePath);
360
+                                    caseAttach.setAnnexName(saveName);
361
+                                    caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
362
+                                }
363
+
364
+                            }
322 365
                         }
323 366
                     }
324 367
                 }
325 368
 
326 369
             }
327
-        } catch (EsignDemoException e) {
370
+        } catch (EsignDemoException | IOException e) {
328 371
             e.printStackTrace();
329 372
         }
330 373