Преглед на файлове

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

qtz преди 2 години
родител
ревизия
986127f7ca

+ 484
- 227
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Целия файл

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

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml Целия файл

@@ -86,7 +86,7 @@
86 86
             </if>
87 87
         </where>
88 88
     </select>
89
-    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
89
+    <select id="queryAnnexById" resultMap="CaseAttachResult">
90 90
         select *
91 91
         from ms_case_attach
92 92
         <where>