|
|
@@ -4,25 +4,18 @@ 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
|
|
-
|
|
8
|
7
|
import com.alibaba.fastjson.JSONArray;
|
|
9
|
8
|
import com.alibaba.fastjson.JSONObject;
|
|
10
|
9
|
import com.google.gson.Gson;
|
|
11
|
|
-import com.google.gson.JsonArray;
|
|
12
|
10
|
import com.google.gson.JsonObject;
|
|
13
|
11
|
import com.ruoyi.common.annotation.DataScope;
|
|
14
|
12
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
15
|
13
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
16
|
14
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|
17
|
15
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
18
|
|
-
|
|
19
|
16
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
20
|
|
-
|
|
21
|
17
|
import com.ruoyi.common.exception.EsignDemoException;
|
|
22
|
18
|
import com.ruoyi.common.exception.ServiceException;
|
|
23
|
|
-import com.ruoyi.common.utils.SignAward;
|
|
24
|
|
-import com.ruoyi.common.utils.bean.SealSignRecord;
|
|
25
|
|
-
|
|
26
|
19
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
27
|
20
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
28
|
21
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
|
@@ -35,11 +28,10 @@ import com.ruoyi.wisdomarbitrate.domain.*;
|
|
35
|
28
|
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
|
36
|
29
|
import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
37
|
30
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
|
31
|
+import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
|
38
|
32
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
39
|
33
|
import org.springframework.stereotype.Service;
|
|
40
|
34
|
import org.springframework.transaction.annotation.Transactional;
|
|
41
|
|
-
|
|
42
|
|
-import java.io.File;
|
|
43
|
35
|
import java.math.BigDecimal;
|
|
44
|
36
|
import java.text.SimpleDateFormat;
|
|
45
|
37
|
import java.util.*;
|
|
|
@@ -61,18 +53,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
61
|
53
|
private ArbitratorMapper arbitratorMapper;
|
|
62
|
54
|
@Autowired
|
|
63
|
55
|
private ArbitrateRecordMapper arbitrateRecordMapper;
|
|
64
|
|
-
|
|
|
56
|
+ @Autowired
|
|
|
57
|
+ private ICaseApplicationService caseApplicationService;
|
|
65
|
58
|
@Autowired
|
|
66
|
59
|
private CaseAttachMapper caseAttachMapper;
|
|
67
|
60
|
@Autowired
|
|
68
|
61
|
private SysDeptMapper sysDeptMapper;
|
|
69
|
62
|
@Autowired
|
|
70
|
|
- private ICaseApplicationService caseApplicationService;
|
|
71
|
|
- @Autowired
|
|
72
|
63
|
private SysUserMapper sysUserMapper;
|
|
|
64
|
+
|
|
73
|
65
|
@Autowired
|
|
74
|
66
|
private SealSignRecordMapper sealSignRecordMapper;
|
|
75
|
|
-
|
|
76
|
67
|
// 手机号正则
|
|
77
|
68
|
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}$");
|
|
78
|
69
|
|
|
|
@@ -113,7 +104,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
113
|
104
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
114
|
105
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
115
|
106
|
// 将组织机构id设为申请人名称
|
|
116
|
|
- if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
|
107
|
+ if (deptMap.containsKey(caseApplication.getName())) {
|
|
117
|
108
|
caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
118
|
109
|
} else {
|
|
119
|
110
|
// 如果不存在则新增
|
|
|
@@ -196,7 +187,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
196
|
187
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
197
|
188
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
198
|
189
|
// 将组织机构id设为申请人名称
|
|
199
|
|
- if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
|
190
|
+ if (deptMap.containsKey(caseApplication.getName())) {
|
|
200
|
191
|
caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
201
|
192
|
} else {
|
|
202
|
193
|
// 如果不存在则新增
|
|
|
@@ -680,7 +671,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
680
|
671
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
681
|
672
|
}else {
|
|
682
|
673
|
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
|
|
683
|
|
- // 仲裁员信息
|
|
684
|
674
|
if(arbitrators!=null&&arbitrators.size()>0){
|
|
685
|
675
|
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
|
|
686
|
676
|
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
|
|
|
@@ -835,6 +825,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
835
|
825
|
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
|
|
836
|
826
|
// 新增日志
|
|
837
|
827
|
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,"");
|
|
|
828
|
+
|
|
838
|
829
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
839
|
830
|
}else if(agreeOrNotCheck.intValue()==2){//拒绝审核
|
|
840
|
831
|
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
|
|
@@ -928,6 +919,43 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
928
|
919
|
return "短信发送成功";
|
|
929
|
920
|
}
|
|
930
|
921
|
|
|
|
922
|
+ @Override
|
|
|
923
|
+ public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException {
|
|
|
924
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
925
|
+ sealSignRecord.setCaseAppliId(caseApplication.getId());
|
|
|
926
|
+ Gson gson = new Gson();
|
|
|
927
|
+ List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord);
|
|
|
928
|
+ SealSignRecord sealSignRecordReslt = new SealSignRecord();
|
|
|
929
|
+ if(sealSignRecords!=null&&sealSignRecords.size()>0){
|
|
|
930
|
+ SealSignRecord sealSignRecordselect = sealSignRecords.get(0);
|
|
|
931
|
+ EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecordselect);
|
|
|
932
|
+ JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
|
|
933
|
+ JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
|
|
934
|
+ String url = signUrlData.get("url").getAsString();
|
|
|
935
|
+ sealSignRecordReslt.setSignUrl(url);
|
|
|
936
|
+ }
|
|
|
937
|
+
|
|
|
938
|
+ return sealSignRecordReslt;
|
|
|
939
|
+ }
|
|
|
940
|
+
|
|
|
941
|
+ @Override
|
|
|
942
|
+ public SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException {
|
|
|
943
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
944
|
+ sealSignRecord.setCaseAppliId(caseApplication.getId());
|
|
|
945
|
+ Gson gson = new Gson();
|
|
|
946
|
+ List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord);
|
|
|
947
|
+ SealSignRecord sealSignRecordReslt = new SealSignRecord();
|
|
|
948
|
+ if(sealSignRecords!=null&&sealSignRecords.size()>0){
|
|
|
949
|
+ SealSignRecord sealSignRecordselect = sealSignRecords.get(0);
|
|
|
950
|
+ EsignHttpResponse signUrl = SignAward.usesealUrl(sealSignRecordselect);
|
|
|
951
|
+ JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
|
|
952
|
+ JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
|
|
953
|
+ String url = signUrlData.get("url").getAsString();
|
|
|
954
|
+ sealSignRecordReslt.setSealUrl(url);
|
|
|
955
|
+ }
|
|
|
956
|
+ return sealSignRecordReslt;
|
|
|
957
|
+ }
|
|
|
958
|
+
|
|
931
|
959
|
@Override
|
|
932
|
960
|
@Transactional
|
|
933
|
961
|
public int pendTralSure(CaseApplication caseApplication) {
|
|
|
@@ -945,32 +973,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
945
|
973
|
String hearDatestr = dateFormat.format(hearDate);
|
|
946
|
974
|
|
|
947
|
975
|
String arbitratorId = caseApplicationselect.getArbitratorId();
|
|
948
|
|
-// List<Arbitrator> arbitratorList = new ArrayList<>();
|
|
|
976
|
+ List<Arbitrator> arbitratorList = new ArrayList<>();
|
|
949
|
977
|
if(StringUtils.isNotEmpty(arbitratorId)){
|
|
950
|
978
|
String[] idStrList = arbitratorId.split(",");
|
|
951
|
979
|
List<Long> idList = new ArrayList<>();
|
|
952
|
980
|
for(int i = 0;i < idStrList.length;i ++ ){
|
|
953
|
981
|
idList.add(Long.parseLong(idStrList[i]));
|
|
954
|
982
|
}
|
|
955
|
|
-//
|
|
956
|
|
-
|
|
957
|
|
- // 查询仲裁员电话号
|
|
958
|
|
- List<SysUser> userList= sysUserMapper.selectUserListByIds(idList);
|
|
959
|
|
- if(CollectionUtil.isNotEmpty(userList)) {
|
|
960
|
|
- for (SysUser user : userList) {
|
|
961
|
|
-
|
|
962
|
|
-
|
|
963
|
|
- //给仲裁员发送短信通知
|
|
964
|
|
- request.setPhone(user.getPhonenumber());
|
|
965
|
|
- // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
966
|
|
- String name = user.getNickName();
|
|
967
|
|
- request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
968
|
|
- SmsUtils.sendSms(request);
|
|
969
|
|
-
|
|
970
|
|
- }
|
|
971
|
|
- }
|
|
972
|
|
-
|
|
973
|
|
-
|
|
|
983
|
+ Arbitrator arbitrator = new Arbitrator();
|
|
|
984
|
+ arbitrator.setIdList(idList);
|
|
|
985
|
+ arbitratorList = arbitratorMapper.selectArbitratorList(arbitrator);
|
|
|
986
|
+ if(arbitratorList!=null) {
|
|
|
987
|
+ for (int i = 0; i < arbitratorList.size(); i++) {
|
|
|
988
|
+ Arbitrator arbitratorselect = arbitratorList.get(i);
|
|
|
989
|
+ //给仲裁员发送短信通知
|
|
|
990
|
+ request.setPhone(arbitratorselect.getTelephone());
|
|
|
991
|
+ // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
|
992
|
+ String name = arbitratorselect.getArbitratorName();
|
|
|
993
|
+ request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
|
994
|
+ SmsUtils.sendSms(request);
|
|
|
995
|
+ }
|
|
|
996
|
+ }
|
|
974
|
997
|
}
|
|
975
|
998
|
|
|
976
|
999
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
@@ -992,7 +1015,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
992
|
1015
|
if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
993
|
1016
|
caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
994
|
1017
|
}
|
|
995
|
|
-
|
|
|
1018
|
+ caseAffiliateselect.setName(caseAffiliateselect.getName());;
|
|
996
|
1019
|
}
|
|
997
|
1020
|
//给申请人、被申请人发送短信通知
|
|
998
|
1021
|
request.setPhone(caseAffiliateselect.getContactTelphone());
|
|
|
@@ -1130,62 +1153,75 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1130
|
1153
|
caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable());
|
|
1131
|
1154
|
}
|
|
1132
|
1155
|
|
|
1133
|
|
- @Transactional
|
|
1134
|
|
- public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException {
|
|
1135
|
|
-
|
|
1136
|
|
- Gson gson = new Gson();
|
|
1137
|
|
-
|
|
1138
|
|
-
|
|
1139
|
|
-
|
|
1140
|
|
- SealSignRecord sealSignRecord = new SealSignRecord();
|
|
1141
|
|
- sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d");
|
|
1142
|
|
- EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
|
1143
|
|
- JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
|
1144
|
|
- JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
|
1145
|
|
- JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
|
1146
|
|
- for (int i = 0; i < signersArray.size(); i++) {
|
|
1147
|
|
- JsonObject signerObject = (JsonObject)signersArray.get(i);
|
|
1148
|
|
- Integer psnsignStatus ;
|
|
1149
|
|
- Integer orgsignStatus ;
|
|
1150
|
|
- if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
|
1151
|
|
- JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
|
1152
|
|
- if(psnSignerData!=null){
|
|
1153
|
|
- psnsignStatus = signerObject.get("signStatus").getAsInt();
|
|
1154
|
|
- sealSignRecord.setPsnsignStatus(psnsignStatus);
|
|
1155
|
|
-
|
|
1156
|
|
- if(psnsignStatus.intValue()==2){
|
|
1157
|
|
- //更新立案申请状态为待用印
|
|
1158
|
|
- CaseApplication caseApplication = new CaseApplication();
|
|
1159
|
|
- caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
1160
|
|
- caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
1161
|
|
-
|
|
1162
|
|
- //修改"签署用印记录表"的状态为待用印
|
|
1163
|
|
-
|
|
1164
|
|
- }
|
|
1165
|
|
- }
|
|
1166
|
|
- }
|
|
1167
|
|
- if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
|
1168
|
|
- JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
|
1169
|
|
- if(orgSignerData!=null){
|
|
1170
|
|
- orgsignStatus = signerObject.get("signStatus").getAsInt();
|
|
1171
|
|
- sealSignRecord.setOrgsignStatus(orgsignStatus);
|
|
1172
|
|
- //更新立案申请状态为待送达
|
|
1173
|
|
- CaseApplication caseApplication = new CaseApplication();
|
|
1174
|
|
- caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
|
|
1175
|
|
- caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
1176
|
|
-
|
|
1177
|
|
- //修改"签署用印记录表"的状态为签署完成
|
|
1178
|
|
-
|
|
1179
|
|
- //下载审核完成的裁决书,
|
|
1180
|
|
-// SaaSAPIFileUtils.fileDownloadUrl();
|
|
1181
|
|
-
|
|
1182
|
|
- }
|
|
|
1156
|
+// @Transactional
|
|
|
1157
|
+// public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException {
|
|
|
1158
|
+//
|
|
|
1159
|
+// Gson gson = new Gson();
|
|
|
1160
|
+//
|
|
|
1161
|
+// SealSignRecord sealSignRecordselect = new SealSignRecord();
|
|
|
1162
|
+// sealSignRecordselect.setSignFlowStatus(1);
|
|
|
1163
|
+//
|
|
|
1164
|
+// List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecordselect);
|
|
|
1165
|
+// if(sealSignRecords!=null&&sealSignRecords.size()>0){
|
|
|
1166
|
+// for (int i = 0; i < sealSignRecords.size(); i++) {
|
|
|
1167
|
+// SealSignRecord sealSignRecord = sealSignRecords.get(i);
|
|
|
1168
|
+// EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
|
|
1169
|
+// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
|
|
1170
|
+// JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
|
|
1171
|
+// JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
|
|
1172
|
+// for (int j = 0; j < signersArray.size(); j++) {
|
|
|
1173
|
+// JsonObject signerObject = (JsonObject)signersArray.get(j);
|
|
|
1174
|
+// Integer psnsignStatus ;
|
|
|
1175
|
+// Integer orgsignStatus ;
|
|
|
1176
|
+// if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
|
|
1177
|
+// JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
|
|
1178
|
+// if(psnSignerData!=null){
|
|
|
1179
|
+// psnsignStatus = signerObject.get("signStatus").getAsInt();
|
|
|
1180
|
+// sealSignRecord.setPsnsignStatus(psnsignStatus);
|
|
|
1181
|
+//
|
|
|
1182
|
+// if(psnsignStatus.intValue()==2){
|
|
|
1183
|
+// //更新立案申请状态为待用印
|
|
|
1184
|
+// CaseApplication caseApplication = new CaseApplication();
|
|
|
1185
|
+// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
|
1186
|
+// caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
1187
|
+//
|
|
|
1188
|
+// //修改"签署用印记录表"的状态为待用印
|
|
|
1189
|
+// sealSignRecord.setSignFlowStatus(2);
|
|
|
1190
|
+// sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
|
|
1191
|
+//
|
|
|
1192
|
+// }
|
|
|
1193
|
+// }
|
|
|
1194
|
+// }
|
|
|
1195
|
+// if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
|
|
1196
|
+// JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
|
|
1197
|
+// if(orgSignerData!=null){
|
|
|
1198
|
+// orgsignStatus = signerObject.get("signStatus").getAsInt();
|
|
|
1199
|
+// sealSignRecord.setOrgsignStatus(orgsignStatus);
|
|
|
1200
|
+// //更新立案申请状态为待送达
|
|
|
1201
|
+// CaseApplication caseApplication = new CaseApplication();
|
|
|
1202
|
+// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
|
|
|
1203
|
+// caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
1204
|
+//
|
|
|
1205
|
+// //修改"签署用印记录表"的状态为签署完成
|
|
|
1206
|
+// sealSignRecord.setSignFlowStatus(3);
|
|
|
1207
|
+// sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
|
|
1208
|
+//
|
|
|
1209
|
+// //下载审核完成的裁决书,
|
|
|
1210
|
+//// SaaSAPIFileUtils.fileDownloadUrl();
|
|
|
1211
|
+//
|
|
|
1212
|
+// }
|
|
|
1213
|
+//
|
|
|
1214
|
+// }
|
|
|
1215
|
+//
|
|
|
1216
|
+// }
|
|
|
1217
|
+//
|
|
|
1218
|
+// }
|
|
|
1219
|
+//
|
|
|
1220
|
+// }
|
|
1183
|
1221
|
|
|
1184
|
|
- }
|
|
1185
|
1222
|
|
|
1186
|
|
- }
|
|
1187
|
1223
|
|
|
1188
|
|
- }
|
|
|
1224
|
+// }
|
|
1189
|
1225
|
|
|
1190
|
1226
|
|
|
1191
|
1227
|
|