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

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

qtz 2 лет назад
Родитель
Сommit
8b1da3b4d9

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

@@ -253,7 +253,7 @@ public class MsCaseApplicationController extends BaseController {
253 253
      * @return
254 254
      */
255 255
     @PostMapping("/mediation")
256
-    public AjaxResult mediation(@RequestBody MsCaseApplicationReq req)   {
256
+    public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
257 257
         if (req.getCaseFlowId() == null || req.getId() == null) {
258 258
             return error("参数校验失败");
259 259
         }

+ 5
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java Просмотреть файл

@@ -98,6 +98,11 @@ public class MsCaseApplication {
98 98
     @Column(name = "pay_type")
99 99
     private String payType;
100 100
 
101
+    /**
102
+     * 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁
103
+     */
104
+    @Column(name = "media_result")
105
+    private Integer mediaResult;
101 106
 
102 107
     /**
103 108
      * 被申请人是否缺席,1是,0否

+ 9
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Просмотреть файл

@@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
5 5
 import lombok.Data;
6 6
 import lombok.NoArgsConstructor;
7 7
 
8
+import javax.persistence.Column;
8 9
 import java.util.List;
9 10
 
10 11
 @NoArgsConstructor
@@ -56,6 +57,14 @@ public class MsCaseApplicationReq {
56 57
      * 是否同意,0-否,1-是
57 58
      */
58 59
     private Integer yesOrNo;
60
+    /**
61
+     * 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁
62
+     */
63
+    private Integer mediaResult;
64
+    /**
65
+     * 是否和解,0-否,1-是
66
+     */
67
+    private Integer isReconci;
59 68
     /**
60 69
      * 调解员id
61 70
      */

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

@@ -157,7 +157,7 @@ public interface MsCaseApplicationService {
157 157
      * @param req
158 158
      * @return
159 159
      */
160
-    AjaxResult mediation(MsCaseApplicationReq req);
160
+    AjaxResult mediation(MsCaseApplicationReq req) throws EsignDemoException, InterruptedException;
161 161
 
162 162
     /**
163 163
      * 修改庭审笔录

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

@@ -1203,7 +1203,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1203 1203
      */
1204 1204
     @Transactional
1205 1205
     @Override
1206
-    public AjaxResult mediation(MsCaseApplicationReq req) {
1206
+    public AjaxResult mediation(MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
1207 1207
         // 查询案件是否存在
1208 1208
         MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(req.getId());
1209 1209
         if (application == null) {
@@ -1212,17 +1212,365 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1212 1212
         if (StrUtil.isEmpty(application.getMediationMethod())) {
1213 1213
             return AjaxResult.error("未选择调解方式");
1214 1214
         }
1215
+        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
1215 1216
         if (application.getMediationMethod().equals("1")) {
1216 1217
             // 线上调解
1217
-            if (application.getTemplateId() == null) {
1218
-                return AjaxResult.error("未找到模板");
1219
-            }
1220
-            String templateId = String.valueOf(application.getTemplateId());
1221
-            req.setTemplateId(templateId);
1222
-            req.setTemplateType(1);
1223
-            AjaxResult result = generateApplication(req);
1224
-            if (result != null && result.isSuccess()) {
1225
-                return result;
1218
+            Integer mediaResult = req.getMediaResult();
1219
+
1220
+            if(mediaResult!=null){
1221
+                if(mediaResult.intValue()==1){
1222
+                    Integer isReconci = req.getIsReconci();
1223
+                    //达成调解
1224
+                    if (application.getTemplateId() == null) {
1225
+                        return AjaxResult.error("未找到模板");
1226
+                    }
1227
+                    String templateId = String.valueOf(application.getTemplateId());
1228
+                    req.setTemplateId(templateId);
1229
+                    req.setTemplateType(1);
1230
+                    AjaxResult result = generateApplication(req);
1231
+                    if (result != null && result.isSuccess()) {
1232
+                        List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
1233
+                        if (caseAttachList != null && caseAttachList.size() > 0) {
1234
+                            for (MsCaseAttach caseAttach : caseAttachList) {
1235
+                                if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
1236
+                                    String prefix = "/profile";
1237
+                                    int startIndex = prefix.length();
1238
+                                    String annexPath = caseAttach.getAnnexPath();
1239
+                                    String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
1240
+                                    //获取文件上传地址
1241
+                                    EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
1242
+                                    String body = response.getBody();
1243
+                                    if (body != null) {
1244
+                                        JSONObject jsonObject = JSONObject.parseObject(body);
1245
+                                        String fileId = jsonObject.getJSONObject("data").getString("fileId");
1246
+                                        String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
1247
+                                        //上传文件流
1248
+                                        EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
1249
+                                        JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
1250
+                                        if (jsonObject1.getIntValue("errCode") == 0) {
1251
+                                            //查看文件上传状态
1252
+                                            Thread.sleep(1000);
1253
+                                            EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
1254
+                                            JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
1255
+                                            JSONObject data = jsonObject2.getJSONObject("data");
1256
+                                            int fileStatus = data.getIntValue("fileStatus");
1257
+                                            if (fileStatus == 2 || fileStatus == 5) {
1258
+                                                String fileName = data.getString("fileName");
1259
+                                                //上传成功,获取文件签名印章位置
1260
+                                                SealSignRecord sealSignRecord = new SealSignRecord();
1261
+                                                sealSignRecord.setFileid(fileId);
1262
+                                                EsignHttpResponse positions = SignAward.getPositionsMediation(sealSignRecord);
1263
+                                                Gson gson = new Gson();
1264
+                                                JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
1265
+                                                JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
1266
+                                                String keywordPositions = positionsData.get("keywordPositions").toString();
1267
+                                                //发起签署
1268
+                                                sealSignRecord.setFilename(fileName);
1269
+
1270
+                                                Long arbitratorId = application.getMediatorId();
1271
+                                                if (arbitratorId!=null) {
1272
+                                                    SysUser sysUser = sysUserMapper.selectUserById(arbitratorId);
1273
+                                                    if (sysUser == null) {
1274
+                                                        return AjaxResult.error();
1275
+                                                    }
1276
+                                                    sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
1277
+                                                    sealSignRecord.setPensonNameMedi(sysUser.getNickName());
1278
+                                                }
1279
+
1280
+                                                sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1281
+                                                sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
1282
+                                                sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
1283
+                                                sealSignRecord.setPensonNameRes(caseAffiliate.getRespondentName());
1284
+
1285
+                                                DeptIdentify deptIdentify = new DeptIdentify();
1286
+                                                deptIdentify.setIsUse(1);
1287
+                                                DeptIdentify deptIdentifyselect = new DeptIdentify();
1288
+                                                List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
1289
+                                                if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
1290
+                                                    deptIdentifyselect = deptIdentifysnew.get(0);
1291
+                                                    sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
1292
+                                                    sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone());
1293
+                                                    sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName());
1294
+                                                } else {
1295
+                                                    return AjaxResult.error("没有用印时的机构名称及经办人信息");
1296
+                                                }
1297
+
1298
+                                                //解析文件签名印章位置
1299
+                                                JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
1300
+                                                for (int i = 0; i < jsonArray.size(); i++) {
1301
+                                                    JSONObject jsonObject3 = jsonArray.getJSONObject(i);
1302
+                                                    String keyword = jsonObject3.getString("keyword");
1303
+                                                    if (keyword.equals("甲方(签字):")) {
1304
+                                                        //签名
1305
+                                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
1306
+                                                        // 遍历 positionsArray 中的每个元素
1307
+                                                        for (int j = 0; j < positionsArray.size(); j++) {
1308
+                                                            JSONObject positionObj = positionsArray.getJSONObject(j);
1309
+                                                            int pageNum = positionObj.getIntValue("pageNum");
1310
+                                                            sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
1311
+                                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
1312
+                                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
1313
+                                                            double positionX = coordinateObj.getDoubleValue("positionX");
1314
+                                                            double positionY = coordinateObj.getDoubleValue("positionY");
1315
+                                                            sealSignRecord.setPositionXpsn(positionX + 120);
1316
+                                                            sealSignRecord.setPositionYpsn(positionY);
1317
+                                                        }
1318
+                                                    }else if (keyword.equals("乙方(签字):")) {
1319
+                                                        //签名
1320
+                                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
1321
+                                                        // 遍历 positionsArray 中的每个元素
1322
+                                                        for (int j = 0; j < positionsArray.size(); j++) {
1323
+                                                            JSONObject positionObj = positionsArray.getJSONObject(j);
1324
+                                                            int pageNum = positionObj.getIntValue("pageNum");
1325
+                                                            sealSignRecord.setPositionPagepsnRes(String.valueOf(pageNum));
1326
+                                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
1327
+                                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
1328
+                                                            double positionX = coordinateObj.getDoubleValue("positionX");
1329
+                                                            double positionY = coordinateObj.getDoubleValue("positionY");
1330
+                                                            sealSignRecord.setPositionXpsnRes(positionX + 120);
1331
+                                                            sealSignRecord.setPositionYpsnRes(positionY + 10);
1332
+                                                        }
1333
+                                                    }else if (keyword.equals("调解员(签字):")) {
1334
+                                                        //签名
1335
+                                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
1336
+                                                        // 遍历 positionsArray 中的每个元素
1337
+                                                        for (int j = 0; j < positionsArray.size(); j++) {
1338
+                                                            JSONObject positionObj = positionsArray.getJSONObject(j);
1339
+                                                            int pageNum = positionObj.getIntValue("pageNum");
1340
+                                                            sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
1341
+                                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
1342
+                                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
1343
+                                                            double positionX = coordinateObj.getDoubleValue("positionX");
1344
+                                                            double positionY = coordinateObj.getDoubleValue("positionY");
1345
+                                                            sealSignRecord.setPositionXpsnMedi(positionX + 120);
1346
+                                                            sealSignRecord.setPositionYpsnMedi(positionY + 10);
1347
+                                                        }
1348
+                                                    }else {
1349
+                                                        //用印
1350
+                                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
1351
+                                                        // 遍历 positionsArray 中的每个元素
1352
+                                                        for (int j = 0; j < positionsArray.size(); j++) {
1353
+                                                            JSONObject positionObj = positionsArray.getJSONObject(j);
1354
+                                                            int pageNum = positionObj.getIntValue("pageNum");
1355
+                                                            sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
1356
+                                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
1357
+                                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
1358
+                                                            double positionX = coordinateObj.getDoubleValue("positionX");
1359
+                                                            double positionY = coordinateObj.getDoubleValue("positionY");
1360
+                                                            sealSignRecord.setPositionXorg(positionX + 90);
1361
+                                                            sealSignRecord.setPositionYorg(positionY);
1362
+                                                        }
1363
+                                                    }
1364
+                                                }
1365
+
1366
+                                                if(isReconci.intValue()==1){
1367
+                                                    EsignHttpResponse response3 = SignAward.createByFileReconci(sealSignRecord);
1368
+
1369
+                                                    JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1370
+                                                    if (jsonObject3 != null) {
1371
+                                                        if (jsonObject3.getIntValue("code") == 0) {
1372
+                                                            //获取签署流程ID
1373
+                                                            JSONObject data1 = jsonObject3.getJSONObject("data");
1374
+                                                            String signFlowId = data1.getString("signFlowId");
1375
+                                                            //保存案件id,文件id,文件名称.流程id到签署用印记录表里
1376
+                                                            sealSignRecord.setCaseAppliId(application.getId());
1377
+                                                            sealSignRecord.setSignFlowid(signFlowId);
1378
+                                                            sealSignRecord.setSignFlowStatus(1);//待签名
1379
+                                                            MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
1380
+                                                            BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
1381
+                                                            msSealSignRecord.setFileId(sealSignRecord.getFileid());
1382
+                                                            msSealSignRecord.setFileName(sealSignRecord.getFilename());
1383
+                                                            msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
1384
+                                                            sealSignRecordMapper.insert(msSealSignRecord);
1385
+
1386
+                                                            SealSignRecord sealSignRecordapply = new SealSignRecord();
1387
+                                                            sealSignRecordapply.setSignFlowid(signFlowId);
1388
+                                                            sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1389
+                                                            EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1390
+                                                            JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1391
+                                                            JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1392
+                                                            String urlapply = signUrlData.get("shortUrl").getAsString();
1393
+                                                            String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
1394
+
1395
+                                                            //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1396
+                                                            SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1397
+                                                            request.setTemplateId("2047719");
1398
+                                                            request.setPhone(caseAffiliate.getContactTelphoneAgent());
1399
+                                                            request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), application.getCaseNum(),urlapplynew});
1400
+                                                            Boolean aBoolean = SmsUtils.sendSms(request);
1401
+
1402
+                                                            SealSignRecord sealSignRecordRespon = new SealSignRecord();
1403
+                                                            sealSignRecordRespon.setSignFlowid(signFlowId);
1404
+                                                            sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
1405
+                                                            EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
1406
+                                                            JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
1407
+                                                            JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
1408
+                                                            String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
1409
+                                                            String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
1410
+
1411
+                                                            SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
1412
+                                                            request1.setTemplateId("2047719");
1413
+                                                            request1.setPhone(caseAffiliate.getRespondentPhone());
1414
+                                                            request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), application.getCaseNum(),urlResponnew});
1415
+                                                            Boolean aBoolean1 = SmsUtils.sendSms(request1);
1416
+
1417
+                                                        } else {
1418
+                                                            throw new ServiceException(jsonObject3.getString("message"));
1419
+                                                        }
1420
+                                                    } else {
1421
+                                                        return AjaxResult.error();
1422
+                                                    }
1423
+
1424
+                                                }else {
1425
+                                            /*DeptIdentify deptIdentify1 = new DeptIdentify();
1426
+                                        deptIdentify1.setSealStatus(1); // 印章状态为启用
1427
+                                        //根据机构名称查询部门id
1428
+                                        SysDept sysDept = new SysDept();
1429
+                                        sysDept.setDeptName(sealSignRecord.getOrgnizeName());
1430
+                                        List<SysDept> sysDepts = deptMapper.selectDeptList(sysDept);
1431
+                                        if (sysDepts != null && sysDepts.size() > 0) {
1432
+                                            Long deptId = sysDepts.get(0).getDeptId();
1433
+                                            deptIdentify1.setDeptId(deptId);
1434
+                                        }
1435
+                                        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1);
1436
+                                        List<String> sealIds = new ArrayList<>();
1437
+                                        if (deptIdentifies != null && deptIdentifies.size() > 0) {
1438
+                                            for (DeptIdentify identify : deptIdentifies) {
1439
+                                                String sealId = identify.getSealId();
1440
+                                                sealIds.add(sealId);
1441
+                                            }
1442
+                                        }*/
1443
+                                                    String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
1444
+                                                    String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
1445
+                                                    String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
1446
+                                                    //查询机构信息
1447
+                                                    DeptIdentify deptIdentify1 = new DeptIdentify();
1448
+                                                    deptIdentify1.setIdentifyName(orgnizeName);
1449
+                                                    deptIdentify1.setOperName(orgnizeNamepsnName);
1450
+                                                    deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
1451
+                                                    List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
1452
+                                                    if (deptIdentifies != null && deptIdentifies.size() > 0) {
1453
+                                                        Long iddeptIdent = deptIdentifies.get(0).getId();
1454
+                                                        SealManage sealManage = new SealManage();
1455
+                                                        sealManage.setIdentifyId(iddeptIdent);
1456
+                                                        List<String> sealIdList = new ArrayList<>();
1457
+                                                        List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
1458
+                                                        if (selectSealList != null && selectSealList.size() > 0) {
1459
+                                                            for (SealManage manage : selectSealList) {
1460
+                                                                Integer sealStatus = manage.getSealStatus();
1461
+                                                                Integer isUse = manage.getIsUse();
1462
+                                                                if (sealStatus == 1 && isUse ==1) {
1463
+                                                                    sealIdList.add(manage.getSealId());
1464
+                                                                }
1465
+                                                            }
1466
+                                                            EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
1467
+
1468
+                                                            JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1469
+                                                            if (jsonObject3 != null) {
1470
+                                                                if (jsonObject3.getIntValue("code") == 0) {
1471
+                                                                    //获取签署流程ID
1472
+                                                                    JSONObject data1 = jsonObject3.getJSONObject("data");
1473
+                                                                    String signFlowId = data1.getString("signFlowId");
1474
+                                                                    //保存案件id,文件id,文件名称.流程id到签署用印记录表里
1475
+                                                                    sealSignRecord.setCaseAppliId(application.getId());
1476
+                                                                    sealSignRecord.setSignFlowid(signFlowId);
1477
+                                                                    sealSignRecord.setSignFlowStatus(1);//待签名
1478
+                                                                    MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
1479
+                                                                    BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
1480
+                                                                    msSealSignRecord.setFileId(sealSignRecord.getFileid());
1481
+                                                                    msSealSignRecord.setFileName(sealSignRecord.getFilename());
1482
+                                                                    msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
1483
+                                                                    msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
1484
+                                                                    msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
1485
+                                                                    sealSignRecordMapper.insert(msSealSignRecord);
1486
+
1487
+                                                                    SealSignRecord sealSignRecordapply = new SealSignRecord();
1488
+                                                                    sealSignRecordapply.setSignFlowid(signFlowId);
1489
+                                                                    sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1490
+                                                                    EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1491
+                                                                    JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1492
+                                                                    JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1493
+                                                                    String urlapply = signUrlData.get("shortUrl").getAsString();
1494
+                                                                    String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
1495
+
1496
+                                                                    //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1497
+                                                                    SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1498
+                                                                    request.setTemplateId("2047719");
1499
+                                                                    request.setPhone(caseAffiliate.getContactTelphoneAgent());
1500
+                                                                    request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), application.getCaseNum(),urlapplynew});
1501
+                                                                    Boolean aBoolean = SmsUtils.sendSms(request);
1502
+
1503
+                                                                    SealSignRecord sealSignRecordRespon = new SealSignRecord();
1504
+                                                                    sealSignRecordRespon.setSignFlowid(signFlowId);
1505
+                                                                    sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
1506
+                                                                    EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
1507
+                                                                    JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
1508
+                                                                    JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
1509
+                                                                    String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
1510
+                                                                    String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
1511
+
1512
+                                                                    SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
1513
+                                                                    request1.setTemplateId("2047719");
1514
+                                                                    request1.setPhone(caseAffiliate.getRespondentPhone());
1515
+                                                                    request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), application.getCaseNum(),urlResponnew});
1516
+                                                                    Boolean aBoolean1 = SmsUtils.sendSms(request1);
1517
+
1518
+                                                                    SealSignRecord sealSignRecordMedi = new SealSignRecord();
1519
+                                                                    sealSignRecordMedi.setSignFlowid(signFlowId);
1520
+                                                                    sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
1521
+                                                                    EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
1522
+                                                                    JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
1523
+                                                                    JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
1524
+                                                                    String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
1525
+                                                                    String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
1526
+
1527
+                                                                    SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
1528
+                                                                    requestMedi.setTemplateId("2047719");
1529
+                                                                    requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
1530
+                                                                    requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), application.getCaseNum(),urlResponnewMedi});
1531
+                                                                    Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
1532
+
1533
+                                                                } else {
1534
+                                                                    throw new ServiceException(jsonObject3.getString("message"));
1535
+                                                                }
1536
+                                                            } else {
1537
+                                                                return AjaxResult.error();
1538
+                                                            }
1539
+
1540
+                                                        }
1541
+
1542
+
1543
+                                                    } else {
1544
+                                                        return AjaxResult.error();
1545
+                                                    }
1546
+                                                }
1547
+                                            }else{
1548
+                                                return AjaxResult.error();
1549
+                                            }
1550
+                                        }else{
1551
+                                            return AjaxResult.error();
1552
+                                        }
1553
+                                    }
1554
+                                    break;
1555
+
1556
+                                }
1557
+                            }
1558
+                        }
1559
+                    }
1560
+                    return AjaxResult.success();
1561
+                }else if(mediaResult.intValue()==2){
1562
+                    //未达成调解
1563
+
1564
+
1565
+                }else if(mediaResult.intValue()==3){
1566
+                    //未达成调解但不再争议
1567
+
1568
+
1569
+                }else if(mediaResult.intValue()==4){
1570
+                    //未达成调解但同意引入仲裁
1571
+
1572
+
1573
+                }
1226 1574
             }
1227 1575
         } else {
1228 1576
             // 线下调解
@@ -2044,10 +2392,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2044 2392
         }
2045 2393
         msCaseAttachMapper.save(caseAttach);
2046 2394
         // 生成调解书成功,需要更新流程节点
2047
-        if (templateType!=null&&templateType==1) {
2048
-            caseApplicationService.nextFlow(application.getId(), application.getCaseFlowId(), application.getLockStatus());
2395
+        //if (templateType!=null&&templateType==1) {
2396
+        //    caseApplicationService.nextFlow(application.getId(), application.getCaseFlowId(), application.getLockStatus());
2049 2397
             // todo 发送短信
2050
-        }
2398
+        //}
2051 2399
     }
2052 2400
 
2053 2401
     /**