|
|
@@ -4,10 +4,14 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
|
4
|
4
|
import cn.hutool.core.collection.CollectionUtil;
|
|
5
|
5
|
import cn.hutool.core.util.StrUtil;
|
|
6
|
6
|
|
|
|
7
|
+import com.alibaba.fastjson.JSONObject;
|
|
7
|
8
|
import com.ruoyi.common.annotation.DataScope;
|
|
8
|
9
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
|
10
|
+import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|
9
|
11
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
12
|
+import com.ruoyi.common.exception.EsignDemoException;
|
|
10
|
13
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
14
|
+import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
11
|
15
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
12
|
16
|
import com.ruoyi.common.utils.DateUtils;
|
|
13
|
17
|
import com.ruoyi.common.utils.SmsUtils;
|
|
|
@@ -21,6 +25,8 @@ import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
21
|
25
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
22
|
26
|
import org.springframework.stereotype.Service;
|
|
23
|
27
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
28
|
+
|
|
|
29
|
+import java.io.File;
|
|
24
|
30
|
import java.math.BigDecimal;
|
|
25
|
31
|
import java.text.SimpleDateFormat;
|
|
26
|
32
|
import java.util.*;
|
|
|
@@ -47,6 +53,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
47
|
53
|
private CaseAttachMapper caseAttachMapper;
|
|
48
|
54
|
@Autowired
|
|
49
|
55
|
private SysDeptMapper sysDeptMapper;
|
|
|
56
|
+ @Autowired
|
|
|
57
|
+ private ICaseApplicationService caseApplicationService;
|
|
|
58
|
+
|
|
50
|
59
|
// 手机号正则
|
|
51
|
60
|
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
|
52
|
61
|
|
|
|
@@ -690,10 +699,48 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
690
|
699
|
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
|
691
|
700
|
Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
|
|
692
|
701
|
if(agreeOrNotCheck.intValue()==1){//同意审核
|
|
|
702
|
+ try {
|
|
|
703
|
+ //获取当前案件的裁决书
|
|
|
704
|
+ CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
|
|
|
705
|
+ List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
|
|
|
706
|
+ if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
|
707
|
+ for (CaseAttach caseAttach : caseAttachList) {
|
|
|
708
|
+ if (caseAttach.getAnnexType() == 3) {
|
|
|
709
|
+ String annexPath = caseAttach.getAnnexPath();
|
|
|
710
|
+ String path = "/home/ruoyi/" + annexPath;
|
|
|
711
|
+ //获取文件上传地址
|
|
|
712
|
+ EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
|
713
|
+ String body = response.getBody();
|
|
|
714
|
+ if (body != null){
|
|
|
715
|
+ JSONObject jsonObject = JSONObject.parseObject(body);
|
|
|
716
|
+ String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
|
|
717
|
+ String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
|
|
718
|
+ //上传文件流
|
|
|
719
|
+ EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
|
|
720
|
+ JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
|
|
721
|
+ if (jsonObject1.getIntValue("errCode")==0){
|
|
|
722
|
+ //查看文件上传状态
|
|
|
723
|
+ Thread.sleep(5000);
|
|
|
724
|
+ EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
|
|
725
|
+ JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
|
|
726
|
+ int fileStatus = jsonObject2.getJSONObject("data").getIntValue("fileStatus");
|
|
|
727
|
+ if (fileStatus == 2 || fileStatus == 5){
|
|
|
728
|
+ //上传成功,发起签署流程
|
|
|
729
|
+ //保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
|
|
730
|
+ }
|
|
|
731
|
+ }
|
|
|
732
|
+ }
|
|
|
733
|
+ }
|
|
|
734
|
+ }
|
|
|
735
|
+ }
|
|
|
736
|
+ } catch (EsignDemoException e) {
|
|
|
737
|
+ e.printStackTrace();
|
|
|
738
|
+ } catch (InterruptedException e) {
|
|
|
739
|
+ e.printStackTrace();
|
|
|
740
|
+ }
|
|
693
|
741
|
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
|
|
694
|
742
|
// 新增日志
|
|
695
|
743
|
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,"");
|
|
696
|
|
-
|
|
697
|
744
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
698
|
745
|
}else if(agreeOrNotCheck.intValue()==2){//拒绝审核
|
|
699
|
746
|
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|