|
|
@@ -1155,140 +1155,139 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1155
|
1155
|
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
|
1156
|
1156
|
// 查询案件相关人员
|
|
1157
|
1157
|
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
|
|
1158
|
|
- // 查询附件
|
|
1159
|
|
- List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(id);
|
|
1160
|
|
- if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
1161
|
|
- for (MsCaseAttach caseAttach : caseAttachList) {
|
|
1162
|
|
- if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
|
1163
|
|
- String prefix = "/profile";
|
|
1164
|
|
- int startIndex = prefix.length();
|
|
1165
|
|
- String annexPath = caseAttach.getAnnexPath();
|
|
1166
|
|
- String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
|
1167
|
|
- //获取文件上传地址
|
|
1168
|
|
- EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
1169
|
|
- String body = response.getBody();
|
|
1170
|
|
- if (body != null) {
|
|
1171
|
|
- JSONObject jsonObject = JSONObject.parseObject(body);
|
|
1172
|
|
- String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
|
1173
|
|
- String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
|
1174
|
|
- //上传文件流
|
|
1175
|
|
- EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
|
1176
|
|
- JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
|
1177
|
|
- if (jsonObject1.getIntValue("errCode") == 0) {
|
|
1178
|
|
- //查看文件上传状态
|
|
1179
|
|
- Thread.sleep(1000);
|
|
1180
|
|
- EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
|
1181
|
|
- JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
|
1182
|
|
- JSONObject data = jsonObject2.getJSONObject("data");
|
|
1183
|
|
- int fileStatus = data.getIntValue("fileStatus");
|
|
1184
|
|
- if (fileStatus == 2 || fileStatus == 5) {
|
|
1185
|
|
- String fileName = data.getString("fileName");
|
|
1186
|
|
- //上传成功,获取文件签名印章位置
|
|
1187
|
|
- SealSignRecord sealSignRecord = new SealSignRecord();
|
|
1188
|
|
- sealSignRecord.setFileid(fileId);
|
|
1189
|
|
- EsignHttpResponse positions = SignAward.getPositionsMediation(sealSignRecord);
|
|
1190
|
|
- Gson gson = new Gson();
|
|
1191
|
|
- JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
|
1192
|
|
- JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
|
1193
|
|
- String keywordPositions = positionsData.get("keywordPositions").toString();
|
|
1194
|
|
- //发起签署
|
|
1195
|
|
- sealSignRecord.setFilename(fileName);
|
|
1196
|
|
-
|
|
1197
|
|
- String arbitratorId = caseApplication.getMediatorId();
|
|
1198
|
|
- if (StringUtils.isNotEmpty(arbitratorId)) {
|
|
1199
|
|
- SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
|
1200
|
|
- if (sysUser == null) {
|
|
1201
|
|
- return AjaxResult.error();
|
|
1202
|
|
- }
|
|
1203
|
|
- sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
|
|
1204
|
|
- sealSignRecord.setPensonNameMedi(sysUser.getNickName());
|
|
1205
|
|
- }
|
|
1206
|
1158
|
|
|
1207
|
|
- sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
1208
|
|
- sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
|
1209
|
|
- sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
|
|
1210
|
|
- sealSignRecord.setPensonNameRes(caseAffiliate.getRespondentName());
|
|
1211
|
|
-
|
|
1212
|
|
- DeptIdentify deptIdentify = new DeptIdentify();
|
|
1213
|
|
- deptIdentify.setIsUse(1);
|
|
1214
|
|
- DeptIdentify deptIdentifyselect = new DeptIdentify();
|
|
1215
|
|
- List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
|
|
1216
|
|
- if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
|
1217
|
|
- deptIdentifyselect = deptIdentifysnew.get(0);
|
|
1218
|
|
- sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
|
|
1219
|
|
- sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone());
|
|
1220
|
|
- sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName());
|
|
1221
|
|
- } else {
|
|
1222
|
|
- return AjaxResult.error("没有用印时的机构名称及经办人信息");
|
|
|
1159
|
+ if(attach.getAnnexId()!=null){
|
|
|
1160
|
+ MsCaseAttach caseAttach = msCaseAttachMapper.queryAnnexById(attach.getAnnexId());
|
|
|
1161
|
+ if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
|
|
1162
|
+ String prefix = "/profile";
|
|
|
1163
|
+ int startIndex = prefix.length();
|
|
|
1164
|
+ String annexPath = caseAttach.getAnnexPath();
|
|
|
1165
|
+ String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
|
|
1166
|
+ //获取文件上传地址
|
|
|
1167
|
+ EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
|
1168
|
+ String body = response.getBody();
|
|
|
1169
|
+ if (body != null) {
|
|
|
1170
|
+ JSONObject jsonObject = JSONObject.parseObject(body);
|
|
|
1171
|
+ String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
|
|
1172
|
+ String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
|
|
1173
|
+ //上传文件流
|
|
|
1174
|
+ EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
|
|
1175
|
+ JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
|
|
1176
|
+ if (jsonObject1.getIntValue("errCode") == 0) {
|
|
|
1177
|
+ //查看文件上传状态
|
|
|
1178
|
+ Thread.sleep(1000);
|
|
|
1179
|
+ EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
|
|
1180
|
+ JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
|
|
1181
|
+ JSONObject data = jsonObject2.getJSONObject("data");
|
|
|
1182
|
+ int fileStatus = data.getIntValue("fileStatus");
|
|
|
1183
|
+ if (fileStatus == 2 || fileStatus == 5) {
|
|
|
1184
|
+ String fileName = data.getString("fileName");
|
|
|
1185
|
+ //上传成功,获取文件签名印章位置
|
|
|
1186
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
1187
|
+ sealSignRecord.setFileid(fileId);
|
|
|
1188
|
+ EsignHttpResponse positions = SignAward.getPositionsMediation(sealSignRecord);
|
|
|
1189
|
+ Gson gson = new Gson();
|
|
|
1190
|
+ JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
|
|
1191
|
+ JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
|
|
1192
|
+ String keywordPositions = positionsData.get("keywordPositions").toString();
|
|
|
1193
|
+ //发起签署
|
|
|
1194
|
+ sealSignRecord.setFilename(fileName);
|
|
|
1195
|
+
|
|
|
1196
|
+ String arbitratorId = caseApplication.getMediatorId();
|
|
|
1197
|
+ if (StringUtils.isNotEmpty(arbitratorId)) {
|
|
|
1198
|
+ SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
|
|
1199
|
+ if (sysUser == null) {
|
|
|
1200
|
+ return AjaxResult.error();
|
|
1223
|
1201
|
}
|
|
|
1202
|
+ sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
|
|
|
1203
|
+ sealSignRecord.setPensonNameMedi(sysUser.getNickName());
|
|
|
1204
|
+ }
|
|
1224
|
1205
|
|
|
1225
|
|
- //解析文件签名印章位置
|
|
1226
|
|
- JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
|
|
1227
|
|
- for (int i = 0; i < jsonArray.size(); i++) {
|
|
1228
|
|
- JSONObject jsonObject3 = jsonArray.getJSONObject(i);
|
|
1229
|
|
- String keyword = jsonObject3.getString("keyword");
|
|
1230
|
|
- if (keyword.equals("甲方(签字):")) {
|
|
1231
|
|
- //签名
|
|
1232
|
|
- JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
1233
|
|
- // 遍历 positionsArray 中的每个元素
|
|
1234
|
|
- for (int j = 0; j < positionsArray.size(); j++) {
|
|
1235
|
|
- JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
1236
|
|
- int pageNum = positionObj.getIntValue("pageNum");
|
|
1237
|
|
- sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
|
|
1238
|
|
- JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
1239
|
|
- JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
1240
|
|
- double positionX = coordinateObj.getDoubleValue("positionX");
|
|
1241
|
|
- double positionY = coordinateObj.getDoubleValue("positionY");
|
|
1242
|
|
- sealSignRecord.setPositionXpsn(positionX + 90);
|
|
1243
|
|
- sealSignRecord.setPositionYpsn(positionY + 30);
|
|
1244
|
|
- }
|
|
1245
|
|
- }else if (keyword.equals("乙方(签字):")) {
|
|
1246
|
|
- //签名
|
|
1247
|
|
- JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
1248
|
|
- // 遍历 positionsArray 中的每个元素
|
|
1249
|
|
- for (int j = 0; j < positionsArray.size(); j++) {
|
|
1250
|
|
- JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
1251
|
|
- int pageNum = positionObj.getIntValue("pageNum");
|
|
1252
|
|
- sealSignRecord.setPositionPagepsnRes(String.valueOf(pageNum));
|
|
1253
|
|
- JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
1254
|
|
- JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
1255
|
|
- double positionX = coordinateObj.getDoubleValue("positionX");
|
|
1256
|
|
- double positionY = coordinateObj.getDoubleValue("positionY");
|
|
1257
|
|
- sealSignRecord.setPositionXpsnRes(positionX + 90);
|
|
1258
|
|
- sealSignRecord.setPositionYpsnRes(positionY);
|
|
1259
|
|
- }
|
|
1260
|
|
- }else if (keyword.equals("调解员(签字):")) {
|
|
1261
|
|
- //签名
|
|
1262
|
|
- JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
1263
|
|
- // 遍历 positionsArray 中的每个元素
|
|
1264
|
|
- for (int j = 0; j < positionsArray.size(); j++) {
|
|
1265
|
|
- JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
1266
|
|
- int pageNum = positionObj.getIntValue("pageNum");
|
|
1267
|
|
- sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
|
|
1268
|
|
- JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
1269
|
|
- JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
1270
|
|
- double positionX = coordinateObj.getDoubleValue("positionX");
|
|
1271
|
|
- double positionY = coordinateObj.getDoubleValue("positionY");
|
|
1272
|
|
- sealSignRecord.setPositionXpsnMedi(positionX + 90);
|
|
1273
|
|
- sealSignRecord.setPositionYpsnMedi(positionY);
|
|
1274
|
|
- }
|
|
1275
|
|
- }else {
|
|
1276
|
|
- //用印
|
|
1277
|
|
- JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
1278
|
|
- // 遍历 positionsArray 中的每个元素
|
|
1279
|
|
- for (int j = 0; j < positionsArray.size(); j++) {
|
|
1280
|
|
- JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
1281
|
|
- int pageNum = positionObj.getIntValue("pageNum");
|
|
1282
|
|
- sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
|
|
1283
|
|
- JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
1284
|
|
- JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
1285
|
|
- double positionX = coordinateObj.getDoubleValue("positionX");
|
|
1286
|
|
- double positionY = coordinateObj.getDoubleValue("positionY");
|
|
1287
|
|
- sealSignRecord.setPositionXorg(positionX + 90);
|
|
1288
|
|
- sealSignRecord.setPositionYorg(positionY);
|
|
1289
|
|
- }
|
|
|
1206
|
+ sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
|
1207
|
+ sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
|
|
1208
|
+ sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
|
|
|
1209
|
+ sealSignRecord.setPensonNameRes(caseAffiliate.getRespondentName());
|
|
|
1210
|
+
|
|
|
1211
|
+ DeptIdentify deptIdentify = new DeptIdentify();
|
|
|
1212
|
+ deptIdentify.setIsUse(1);
|
|
|
1213
|
+ DeptIdentify deptIdentifyselect = new DeptIdentify();
|
|
|
1214
|
+ List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
|
|
|
1215
|
+ if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
|
|
1216
|
+ deptIdentifyselect = deptIdentifysnew.get(0);
|
|
|
1217
|
+ sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
|
|
|
1218
|
+ sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone());
|
|
|
1219
|
+ sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName());
|
|
|
1220
|
+ } else {
|
|
|
1221
|
+ return AjaxResult.error("没有用印时的机构名称及经办人信息");
|
|
|
1222
|
+ }
|
|
|
1223
|
+
|
|
|
1224
|
+ //解析文件签名印章位置
|
|
|
1225
|
+ JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
|
|
|
1226
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
1227
|
+ JSONObject jsonObject3 = jsonArray.getJSONObject(i);
|
|
|
1228
|
+ String keyword = jsonObject3.getString("keyword");
|
|
|
1229
|
+ if (keyword.equals("甲方(签字):")) {
|
|
|
1230
|
+ //签名
|
|
|
1231
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1232
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1233
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1234
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1235
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1236
|
+ sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
|
|
|
1237
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1238
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1239
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1240
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1241
|
+ sealSignRecord.setPositionXpsn(positionX + 120);
|
|
|
1242
|
+ sealSignRecord.setPositionYpsn(positionY);
|
|
|
1243
|
+ }
|
|
|
1244
|
+ }else if (keyword.equals("乙方(签字):")) {
|
|
|
1245
|
+ //签名
|
|
|
1246
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1247
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1248
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1249
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1250
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1251
|
+ sealSignRecord.setPositionPagepsnRes(String.valueOf(pageNum));
|
|
|
1252
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1253
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1254
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1255
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1256
|
+ sealSignRecord.setPositionXpsnRes(positionX + 120);
|
|
|
1257
|
+ sealSignRecord.setPositionYpsnRes(positionY + 10);
|
|
|
1258
|
+ }
|
|
|
1259
|
+ }else if (keyword.equals("调解员(签字):")) {
|
|
|
1260
|
+ //签名
|
|
|
1261
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1262
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1263
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1264
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1265
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1266
|
+ sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
|
|
|
1267
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1268
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1269
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1270
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1271
|
+ sealSignRecord.setPositionXpsnMedi(positionX + 120);
|
|
|
1272
|
+ sealSignRecord.setPositionYpsnMedi(positionY + 10);
|
|
|
1273
|
+ }
|
|
|
1274
|
+ }else {
|
|
|
1275
|
+ //用印
|
|
|
1276
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1277
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1278
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1279
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1280
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1281
|
+ sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
|
|
|
1282
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1283
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1284
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1285
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1286
|
+ sealSignRecord.setPositionXorg(positionX + 90);
|
|
|
1287
|
+ sealSignRecord.setPositionYorg(positionY);
|
|
1290
|
1288
|
}
|
|
1291
|
1289
|
}
|
|
|
1290
|
+ }
|
|
1292
|
1291
|
/*DeptIdentify deptIdentify1 = new DeptIdentify();
|
|
1293
|
1292
|
deptIdentify1.setSealStatus(1); // 印章状态为启用
|
|
1294
|
1293
|
//根据机构名称查询部门id
|
|
|
@@ -1307,121 +1306,379 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1307
|
1306
|
sealIds.add(sealId);
|
|
1308
|
1307
|
}
|
|
1309
|
1308
|
}*/
|
|
1310
|
|
- String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
|
|
1311
|
|
- String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
|
|
1312
|
|
- String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
|
|
1313
|
|
- //查询机构信息
|
|
1314
|
|
- DeptIdentify deptIdentify1 = new DeptIdentify();
|
|
1315
|
|
- deptIdentify1.setIdentifyName(orgnizeName);
|
|
1316
|
|
- deptIdentify1.setOperName(orgnizeNamepsnName);
|
|
1317
|
|
- deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
|
|
1318
|
|
- List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
|
|
1319
|
|
- if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
|
1320
|
|
- Long iddeptIdent = deptIdentifies.get(0).getId();
|
|
1321
|
|
- SealManage sealManage = new SealManage();
|
|
1322
|
|
- sealManage.setIdentifyId(iddeptIdent);
|
|
1323
|
|
- List<String> sealIdList = new ArrayList<>();
|
|
1324
|
|
- List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
|
|
1325
|
|
- if (selectSealList != null && selectSealList.size() > 0) {
|
|
1326
|
|
- for (SealManage manage : selectSealList) {
|
|
1327
|
|
- Integer sealStatus = manage.getSealStatus();
|
|
1328
|
|
- Integer isUse = manage.getIsUse();
|
|
1329
|
|
- if (sealStatus == 1 && isUse ==1) {
|
|
1330
|
|
- sealIdList.add(manage.getSealId());
|
|
1331
|
|
- }
|
|
|
1309
|
+ String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
|
|
|
1310
|
+ String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
|
|
|
1311
|
+ String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
|
|
|
1312
|
+ //查询机构信息
|
|
|
1313
|
+ DeptIdentify deptIdentify1 = new DeptIdentify();
|
|
|
1314
|
+ deptIdentify1.setIdentifyName(orgnizeName);
|
|
|
1315
|
+ deptIdentify1.setOperName(orgnizeNamepsnName);
|
|
|
1316
|
+ deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
|
|
|
1317
|
+ List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
|
|
|
1318
|
+ if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
|
|
1319
|
+ Long iddeptIdent = deptIdentifies.get(0).getId();
|
|
|
1320
|
+ SealManage sealManage = new SealManage();
|
|
|
1321
|
+ sealManage.setIdentifyId(iddeptIdent);
|
|
|
1322
|
+ List<String> sealIdList = new ArrayList<>();
|
|
|
1323
|
+ List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
|
|
|
1324
|
+ if (selectSealList != null && selectSealList.size() > 0) {
|
|
|
1325
|
+ for (SealManage manage : selectSealList) {
|
|
|
1326
|
+ Integer sealStatus = manage.getSealStatus();
|
|
|
1327
|
+ Integer isUse = manage.getIsUse();
|
|
|
1328
|
+ if (sealStatus == 1 && isUse ==1) {
|
|
|
1329
|
+ sealIdList.add(manage.getSealId());
|
|
1332
|
1330
|
}
|
|
1333
|
|
- EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
|
|
1334
|
|
-
|
|
1335
|
|
- JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
|
|
1336
|
|
- if (jsonObject3 != null) {
|
|
1337
|
|
- if (jsonObject3.getIntValue("code") == 0) {
|
|
1338
|
|
- //获取签署流程ID
|
|
1339
|
|
- JSONObject data1 = jsonObject3.getJSONObject("data");
|
|
1340
|
|
- String signFlowId = data1.getString("signFlowId");
|
|
1341
|
|
- //保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
|
1342
|
|
- sealSignRecord.setCaseAppliId(caseApplication.getId());
|
|
1343
|
|
- sealSignRecord.setSignFlowid(signFlowId);
|
|
1344
|
|
- sealSignRecord.setSignFlowStatus(1);//待签名
|
|
1345
|
|
- MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
|
|
1346
|
|
- BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
|
|
1347
|
|
- msSealSignRecord.setFileId(sealSignRecord.getFileid());
|
|
1348
|
|
- msSealSignRecord.setFileName(sealSignRecord.getFilename());
|
|
1349
|
|
- msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
|
|
1350
|
|
- msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
|
|
1351
|
|
- msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
|
|
1352
|
|
- sealSignRecordMapper.insert(msSealSignRecord);
|
|
1353
|
|
-
|
|
1354
|
|
- SealSignRecord sealSignRecordapply = new SealSignRecord();
|
|
1355
|
|
- sealSignRecordapply.setSignFlowid(signFlowId);
|
|
1356
|
|
- sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
1357
|
|
- EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
|
|
1358
|
|
- JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
|
1359
|
|
- JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
|
1360
|
|
- String urlapply = signUrlData.get("shortUrl").getAsString();
|
|
1361
|
|
- String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
|
|
1362
|
|
-
|
|
1363
|
|
- //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
|
|
1364
|
|
- SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
1365
|
|
- request.setTemplateId("2047719");
|
|
1366
|
|
- request.setPhone(caseAffiliate.getContactTelphoneAgent());
|
|
1367
|
|
- request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
|
|
1368
|
|
- Boolean aBoolean = SmsUtils.sendSms(request);
|
|
1369
|
|
-
|
|
1370
|
|
- SealSignRecord sealSignRecordRespon = new SealSignRecord();
|
|
1371
|
|
- sealSignRecordRespon.setSignFlowid(signFlowId);
|
|
1372
|
|
- sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
|
|
1373
|
|
- EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
|
|
1374
|
|
- JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
|
|
1375
|
|
- JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
|
|
1376
|
|
- String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
|
|
1377
|
|
- String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
|
|
1378
|
|
-
|
|
1379
|
|
- SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
|
|
1380
|
|
- request1.setTemplateId("2047719");
|
|
1381
|
|
- request1.setPhone(caseAffiliate.getRespondentPhone());
|
|
1382
|
|
- request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
|
|
1383
|
|
- Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
|
1384
|
|
-
|
|
1385
|
|
- SealSignRecord sealSignRecordMedi = new SealSignRecord();
|
|
1386
|
|
- sealSignRecordMedi.setSignFlowid(signFlowId);
|
|
1387
|
|
- sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
|
|
1388
|
|
- EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
|
|
1389
|
|
- JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
|
|
1390
|
|
- JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
|
|
1391
|
|
- String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
|
|
1392
|
|
- String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
|
|
1393
|
|
-
|
|
1394
|
|
- SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
|
|
1395
|
|
- requestMedi.setTemplateId("2047719");
|
|
1396
|
|
- requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
|
|
1397
|
|
- requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
|
|
1398
|
|
- Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
|
|
|
1331
|
+ }
|
|
|
1332
|
+ EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
|
|
|
1333
|
+
|
|
|
1334
|
+ JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
|
|
|
1335
|
+ if (jsonObject3 != null) {
|
|
|
1336
|
+ if (jsonObject3.getIntValue("code") == 0) {
|
|
|
1337
|
+ //获取签署流程ID
|
|
|
1338
|
+ JSONObject data1 = jsonObject3.getJSONObject("data");
|
|
|
1339
|
+ String signFlowId = data1.getString("signFlowId");
|
|
|
1340
|
+ //保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
|
|
1341
|
+ sealSignRecord.setCaseAppliId(caseApplication.getId());
|
|
|
1342
|
+ sealSignRecord.setSignFlowid(signFlowId);
|
|
|
1343
|
+ sealSignRecord.setSignFlowStatus(1);//待签名
|
|
|
1344
|
+ MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
|
|
|
1345
|
+ BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
|
|
|
1346
|
+ msSealSignRecord.setFileId(sealSignRecord.getFileid());
|
|
|
1347
|
+ msSealSignRecord.setFileName(sealSignRecord.getFilename());
|
|
|
1348
|
+ msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
|
|
|
1349
|
+ msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
|
|
|
1350
|
+ msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
|
|
|
1351
|
+ sealSignRecordMapper.insert(msSealSignRecord);
|
|
|
1352
|
+
|
|
|
1353
|
+ SealSignRecord sealSignRecordapply = new SealSignRecord();
|
|
|
1354
|
+ sealSignRecordapply.setSignFlowid(signFlowId);
|
|
|
1355
|
+ sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
|
1356
|
+ EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
|
|
|
1357
|
+ JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
|
|
1358
|
+ JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
|
|
1359
|
+ String urlapply = signUrlData.get("shortUrl").getAsString();
|
|
|
1360
|
+ String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
|
|
|
1361
|
+
|
|
|
1362
|
+ //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
|
|
|
1363
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
1364
|
+ request.setTemplateId("2047719");
|
|
|
1365
|
+ request.setPhone(caseAffiliate.getContactTelphoneAgent());
|
|
|
1366
|
+ request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
|
|
|
1367
|
+ Boolean aBoolean = SmsUtils.sendSms(request);
|
|
|
1368
|
+
|
|
|
1369
|
+ SealSignRecord sealSignRecordRespon = new SealSignRecord();
|
|
|
1370
|
+ sealSignRecordRespon.setSignFlowid(signFlowId);
|
|
|
1371
|
+ sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
|
|
|
1372
|
+ EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
|
|
|
1373
|
+ JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
|
|
|
1374
|
+ JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
|
|
|
1375
|
+ String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
|
|
|
1376
|
+ String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
|
|
|
1377
|
+
|
|
|
1378
|
+ SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
|
|
|
1379
|
+ request1.setTemplateId("2047719");
|
|
|
1380
|
+ request1.setPhone(caseAffiliate.getRespondentPhone());
|
|
|
1381
|
+ request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
|
|
|
1382
|
+ Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
|
|
1383
|
+
|
|
|
1384
|
+ SealSignRecord sealSignRecordMedi = new SealSignRecord();
|
|
|
1385
|
+ sealSignRecordMedi.setSignFlowid(signFlowId);
|
|
|
1386
|
+ sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
|
|
|
1387
|
+ EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
|
|
|
1388
|
+ JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
|
|
|
1389
|
+ JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
|
|
|
1390
|
+ String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
|
|
|
1391
|
+ String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
|
|
|
1392
|
+
|
|
|
1393
|
+ SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
|
|
|
1394
|
+ requestMedi.setTemplateId("2047719");
|
|
|
1395
|
+ requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
|
|
|
1396
|
+ requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
|
|
|
1397
|
+ Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
|
|
1399
|
1398
|
|
|
1400
|
|
- } else {
|
|
1401
|
|
- throw new ServiceException(jsonObject3.getString("message"));
|
|
1402
|
|
- }
|
|
1403
|
1399
|
} else {
|
|
|
1400
|
+ throw new ServiceException(jsonObject3.getString("message"));
|
|
|
1401
|
+ }
|
|
|
1402
|
+ } else {
|
|
|
1403
|
+ return AjaxResult.error();
|
|
|
1404
|
+ }
|
|
|
1405
|
+
|
|
|
1406
|
+ }
|
|
|
1407
|
+
|
|
|
1408
|
+
|
|
|
1409
|
+ } else {
|
|
|
1410
|
+ return AjaxResult.error();
|
|
|
1411
|
+ }
|
|
|
1412
|
+ }
|
|
|
1413
|
+ }
|
|
|
1414
|
+ }
|
|
|
1415
|
+ }
|
|
|
1416
|
+ }else {
|
|
|
1417
|
+ // 查询附件
|
|
|
1418
|
+ List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(id);
|
|
|
1419
|
+ if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
|
1420
|
+ for (MsCaseAttach caseAttach : caseAttachList) {
|
|
|
1421
|
+ if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
|
|
1422
|
+ String prefix = "/profile";
|
|
|
1423
|
+ int startIndex = prefix.length();
|
|
|
1424
|
+ String annexPath = caseAttach.getAnnexPath();
|
|
|
1425
|
+ String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
|
|
1426
|
+ //获取文件上传地址
|
|
|
1427
|
+ EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
|
1428
|
+ String body = response.getBody();
|
|
|
1429
|
+ if (body != null) {
|
|
|
1430
|
+ JSONObject jsonObject = JSONObject.parseObject(body);
|
|
|
1431
|
+ String fileId = jsonObject.getJSONObject("data").getString("fileId");
|
|
|
1432
|
+ String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
|
|
|
1433
|
+ //上传文件流
|
|
|
1434
|
+ EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
|
|
|
1435
|
+ JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
|
|
|
1436
|
+ if (jsonObject1.getIntValue("errCode") == 0) {
|
|
|
1437
|
+ //查看文件上传状态
|
|
|
1438
|
+ Thread.sleep(1000);
|
|
|
1439
|
+ EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
|
|
|
1440
|
+ JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
|
|
|
1441
|
+ JSONObject data = jsonObject2.getJSONObject("data");
|
|
|
1442
|
+ int fileStatus = data.getIntValue("fileStatus");
|
|
|
1443
|
+ if (fileStatus == 2 || fileStatus == 5) {
|
|
|
1444
|
+ String fileName = data.getString("fileName");
|
|
|
1445
|
+ //上传成功,获取文件签名印章位置
|
|
|
1446
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
1447
|
+ sealSignRecord.setFileid(fileId);
|
|
|
1448
|
+ EsignHttpResponse positions = SignAward.getPositionsMediation(sealSignRecord);
|
|
|
1449
|
+ Gson gson = new Gson();
|
|
|
1450
|
+ JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
|
|
1451
|
+ JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
|
|
1452
|
+ String keywordPositions = positionsData.get("keywordPositions").toString();
|
|
|
1453
|
+ //发起签署
|
|
|
1454
|
+ sealSignRecord.setFilename(fileName);
|
|
|
1455
|
+
|
|
|
1456
|
+ String arbitratorId = caseApplication.getMediatorId();
|
|
|
1457
|
+ if (StringUtils.isNotEmpty(arbitratorId)) {
|
|
|
1458
|
+ SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
|
|
1459
|
+ if (sysUser == null) {
|
|
1404
|
1460
|
return AjaxResult.error();
|
|
1405
|
1461
|
}
|
|
|
1462
|
+ sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
|
|
|
1463
|
+ sealSignRecord.setPensonNameMedi(sysUser.getNickName());
|
|
|
1464
|
+ }
|
|
1406
|
1465
|
|
|
|
1466
|
+ sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
|
1467
|
+ sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
|
|
|
1468
|
+ sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
|
|
|
1469
|
+ sealSignRecord.setPensonNameRes(caseAffiliate.getRespondentName());
|
|
|
1470
|
+
|
|
|
1471
|
+ DeptIdentify deptIdentify = new DeptIdentify();
|
|
|
1472
|
+ deptIdentify.setIsUse(1);
|
|
|
1473
|
+ DeptIdentify deptIdentifyselect = new DeptIdentify();
|
|
|
1474
|
+ List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
|
|
|
1475
|
+ if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
|
|
1476
|
+ deptIdentifyselect = deptIdentifysnew.get(0);
|
|
|
1477
|
+ sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
|
|
|
1478
|
+ sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone());
|
|
|
1479
|
+ sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName());
|
|
|
1480
|
+ } else {
|
|
|
1481
|
+ return AjaxResult.error("没有用印时的机构名称及经办人信息");
|
|
1407
|
1482
|
}
|
|
1408
|
1483
|
|
|
|
1484
|
+ //解析文件签名印章位置
|
|
|
1485
|
+ JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
|
|
|
1486
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
1487
|
+ JSONObject jsonObject3 = jsonArray.getJSONObject(i);
|
|
|
1488
|
+ String keyword = jsonObject3.getString("keyword");
|
|
|
1489
|
+ if (keyword.equals("甲方(签字):")) {
|
|
|
1490
|
+ //签名
|
|
|
1491
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1492
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1493
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1494
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1495
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1496
|
+ sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
|
|
|
1497
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1498
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1499
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1500
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1501
|
+ sealSignRecord.setPositionXpsn(positionX + 120);
|
|
|
1502
|
+ sealSignRecord.setPositionYpsn(positionY);
|
|
|
1503
|
+ }
|
|
|
1504
|
+ }else if (keyword.equals("乙方(签字):")) {
|
|
|
1505
|
+ //签名
|
|
|
1506
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1507
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1508
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1509
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1510
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1511
|
+ sealSignRecord.setPositionPagepsnRes(String.valueOf(pageNum));
|
|
|
1512
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1513
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1514
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1515
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1516
|
+ sealSignRecord.setPositionXpsnRes(positionX + 120);
|
|
|
1517
|
+ sealSignRecord.setPositionYpsnRes(positionY + 10);
|
|
|
1518
|
+ }
|
|
|
1519
|
+ }else if (keyword.equals("调解员(签字):")) {
|
|
|
1520
|
+ //签名
|
|
|
1521
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1522
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1523
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1524
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1525
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1526
|
+ sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
|
|
|
1527
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1528
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1529
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1530
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1531
|
+ sealSignRecord.setPositionXpsnMedi(positionX + 120);
|
|
|
1532
|
+ sealSignRecord.setPositionYpsnMedi(positionY + 10);
|
|
|
1533
|
+ }
|
|
|
1534
|
+ }else {
|
|
|
1535
|
+ //用印
|
|
|
1536
|
+ JSONArray positionsArray = jsonObject3.getJSONArray("positions");
|
|
|
1537
|
+ // 遍历 positionsArray 中的每个元素
|
|
|
1538
|
+ for (int j = 0; j < positionsArray.size(); j++) {
|
|
|
1539
|
+ JSONObject positionObj = positionsArray.getJSONObject(j);
|
|
|
1540
|
+ int pageNum = positionObj.getIntValue("pageNum");
|
|
|
1541
|
+ sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
|
|
|
1542
|
+ JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
|
|
|
1543
|
+ JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
|
|
|
1544
|
+ double positionX = coordinateObj.getDoubleValue("positionX");
|
|
|
1545
|
+ double positionY = coordinateObj.getDoubleValue("positionY");
|
|
|
1546
|
+ sealSignRecord.setPositionXorg(positionX + 90);
|
|
|
1547
|
+ sealSignRecord.setPositionYorg(positionY);
|
|
|
1548
|
+ }
|
|
|
1549
|
+ }
|
|
|
1550
|
+ }
|
|
|
1551
|
+ /*DeptIdentify deptIdentify1 = new DeptIdentify();
|
|
|
1552
|
+ deptIdentify1.setSealStatus(1); // 印章状态为启用
|
|
|
1553
|
+ //根据机构名称查询部门id
|
|
|
1554
|
+ SysDept sysDept = new SysDept();
|
|
|
1555
|
+ sysDept.setDeptName(sealSignRecord.getOrgnizeName());
|
|
|
1556
|
+ List<SysDept> sysDepts = deptMapper.selectDeptList(sysDept);
|
|
|
1557
|
+ if (sysDepts != null && sysDepts.size() > 0) {
|
|
|
1558
|
+ Long deptId = sysDepts.get(0).getDeptId();
|
|
|
1559
|
+ deptIdentify1.setDeptId(deptId);
|
|
|
1560
|
+ }
|
|
|
1561
|
+ List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1);
|
|
|
1562
|
+ List<String> sealIds = new ArrayList<>();
|
|
|
1563
|
+ if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
|
|
1564
|
+ for (DeptIdentify identify : deptIdentifies) {
|
|
|
1565
|
+ String sealId = identify.getSealId();
|
|
|
1566
|
+ sealIds.add(sealId);
|
|
|
1567
|
+ }
|
|
|
1568
|
+ }*/
|
|
|
1569
|
+ String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
|
|
|
1570
|
+ String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
|
|
|
1571
|
+ String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
|
|
|
1572
|
+ //查询机构信息
|
|
|
1573
|
+ DeptIdentify deptIdentify1 = new DeptIdentify();
|
|
|
1574
|
+ deptIdentify1.setIdentifyName(orgnizeName);
|
|
|
1575
|
+ deptIdentify1.setOperName(orgnizeNamepsnName);
|
|
|
1576
|
+ deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
|
|
|
1577
|
+ List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
|
|
|
1578
|
+ if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
|
|
1579
|
+ Long iddeptIdent = deptIdentifies.get(0).getId();
|
|
|
1580
|
+ SealManage sealManage = new SealManage();
|
|
|
1581
|
+ sealManage.setIdentifyId(iddeptIdent);
|
|
|
1582
|
+ List<String> sealIdList = new ArrayList<>();
|
|
|
1583
|
+ List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
|
|
|
1584
|
+ if (selectSealList != null && selectSealList.size() > 0) {
|
|
|
1585
|
+ for (SealManage manage : selectSealList) {
|
|
|
1586
|
+ Integer sealStatus = manage.getSealStatus();
|
|
|
1587
|
+ Integer isUse = manage.getIsUse();
|
|
|
1588
|
+ if (sealStatus == 1 && isUse ==1) {
|
|
|
1589
|
+ sealIdList.add(manage.getSealId());
|
|
|
1590
|
+ }
|
|
|
1591
|
+ }
|
|
|
1592
|
+ EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
|
|
|
1593
|
+
|
|
|
1594
|
+ JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
|
|
|
1595
|
+ if (jsonObject3 != null) {
|
|
|
1596
|
+ if (jsonObject3.getIntValue("code") == 0) {
|
|
|
1597
|
+ //获取签署流程ID
|
|
|
1598
|
+ JSONObject data1 = jsonObject3.getJSONObject("data");
|
|
|
1599
|
+ String signFlowId = data1.getString("signFlowId");
|
|
|
1600
|
+ //保存案件id,文件id,文件名称.流程id到签署用印记录表里
|
|
|
1601
|
+ sealSignRecord.setCaseAppliId(caseApplication.getId());
|
|
|
1602
|
+ sealSignRecord.setSignFlowid(signFlowId);
|
|
|
1603
|
+ sealSignRecord.setSignFlowStatus(1);//待签名
|
|
|
1604
|
+ MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
|
|
|
1605
|
+ BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
|
|
|
1606
|
+ msSealSignRecord.setFileId(sealSignRecord.getFileid());
|
|
|
1607
|
+ msSealSignRecord.setFileName(sealSignRecord.getFilename());
|
|
|
1608
|
+ msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
|
|
|
1609
|
+ msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
|
|
|
1610
|
+ msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
|
|
|
1611
|
+ sealSignRecordMapper.insert(msSealSignRecord);
|
|
|
1612
|
+
|
|
|
1613
|
+ SealSignRecord sealSignRecordapply = new SealSignRecord();
|
|
|
1614
|
+ sealSignRecordapply.setSignFlowid(signFlowId);
|
|
|
1615
|
+ sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
|
|
|
1616
|
+ EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
|
|
|
1617
|
+ JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
|
|
1618
|
+ JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
|
|
1619
|
+ String urlapply = signUrlData.get("shortUrl").getAsString();
|
|
|
1620
|
+ String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
|
|
|
1621
|
+
|
|
|
1622
|
+ //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
|
|
|
1623
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
1624
|
+ request.setTemplateId("2047719");
|
|
|
1625
|
+ request.setPhone(caseAffiliate.getContactTelphoneAgent());
|
|
|
1626
|
+ request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
|
|
|
1627
|
+ Boolean aBoolean = SmsUtils.sendSms(request);
|
|
|
1628
|
+
|
|
|
1629
|
+ SealSignRecord sealSignRecordRespon = new SealSignRecord();
|
|
|
1630
|
+ sealSignRecordRespon.setSignFlowid(signFlowId);
|
|
|
1631
|
+ sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
|
|
|
1632
|
+ EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
|
|
|
1633
|
+ JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
|
|
|
1634
|
+ JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
|
|
|
1635
|
+ String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
|
|
|
1636
|
+ String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
|
|
|
1637
|
+
|
|
|
1638
|
+ SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
|
|
|
1639
|
+ request1.setTemplateId("2047719");
|
|
|
1640
|
+ request1.setPhone(caseAffiliate.getRespondentPhone());
|
|
|
1641
|
+ request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
|
|
|
1642
|
+ Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
|
|
1643
|
+
|
|
|
1644
|
+ SealSignRecord sealSignRecordMedi = new SealSignRecord();
|
|
|
1645
|
+ sealSignRecordMedi.setSignFlowid(signFlowId);
|
|
|
1646
|
+ sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
|
|
|
1647
|
+ EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
|
|
|
1648
|
+ JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
|
|
|
1649
|
+ JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
|
|
|
1650
|
+ String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
|
|
|
1651
|
+ String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
|
|
|
1652
|
+
|
|
|
1653
|
+ SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
|
|
|
1654
|
+ requestMedi.setTemplateId("2047719");
|
|
|
1655
|
+ requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
|
|
|
1656
|
+ requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
|
|
|
1657
|
+ Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
|
|
|
1658
|
+
|
|
|
1659
|
+ } else {
|
|
|
1660
|
+ throw new ServiceException(jsonObject3.getString("message"));
|
|
|
1661
|
+ }
|
|
|
1662
|
+ } else {
|
|
|
1663
|
+ return AjaxResult.error();
|
|
|
1664
|
+ }
|
|
1409
|
1665
|
|
|
1410
|
|
- } else {
|
|
1411
|
|
- return AjaxResult.error();
|
|
|
1666
|
+ }
|
|
|
1667
|
+
|
|
|
1668
|
+
|
|
|
1669
|
+ } else {
|
|
|
1670
|
+ return AjaxResult.error();
|
|
|
1671
|
+ }
|
|
1412
|
1672
|
}
|
|
1413
|
1673
|
}
|
|
1414
|
1674
|
}
|
|
|
1675
|
+ break;
|
|
1415
|
1676
|
}
|
|
1416
|
|
- break;
|
|
|
1677
|
+
|
|
1417
|
1678
|
}
|
|
1418
|
1679
|
|
|
1419
|
1680
|
}
|
|
1420
|
|
-
|
|
1421
|
1681
|
}
|
|
1422
|
|
-
|
|
1423
|
|
-
|
|
1424
|
|
-
|
|
1425
|
1682
|
return AjaxResult.success();
|
|
1426
|
1683
|
}
|
|
1427
|
1684
|
|