Преглед изворни кода

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

wangqiong123 пре 2 година
родитељ
комит
a73b5ca3b4

+ 27
- 17
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Прегледај датотеку

@@ -431,9 +431,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
431 431
                     return AjaxResult.error("未找到案件相关人员");
432 432
                 }
433 433
                 // 申请操作人
434
-                Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst();
434
+                Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1  && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst();
435 435
                 // 被申请操作人
436
-                Optional<MsCaseAffiliate> resAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst();
436
+                Optional<MsCaseAffiliate> resAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1  && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst();
437 437
                 if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
438 438
                     throw new ServiceException("未找到案件操作人员");
439 439
                 }
@@ -459,20 +459,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
459 459
                     sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
460 460
                 }
461 461
                 }, executor);
462
-                    CompletableFuture.runAsync(() -> {
463
-                        SysUser sysUser = sysUserMapper.selectUserById(resAffiliateOpt.get().getUserId());
464
-                        MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(caseApplication1.getId()).systemType("TJ").build();
465
-                        String   roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
466
-                if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
467
-                    SmsUtils.sendSms(caseApplication1,"2126313", sysUser.getPhonenumber(),new String[]{sysUser.getNickName(),caseApplication1.getCaseNum(),"authId="+ roomUuid});
468
-                }else if(StrUtil.isNotEmpty(sysUser.getEmail())){
469
-                    String  content = "尊敬的"+sysUser.getNickName()+"用户,您的" + caseApplication1.getCaseNum() + "文件已发送至邮箱,请点击链接进行确认签收https://txroom.xayunmei.com/#/sign?" + "authId="+ roomUuid + ",如非本人操作,请忽略本短信";
470
-                    emailOutUtil.sendMessage(sysUser.getEmail(), "调解系统文件签收", content, null, null);
471
-                    sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
472
-                }
473
-                }, executor);
474
-
475
-
476 462
                 CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
477 463
 
478 464
             }
@@ -496,6 +482,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
496 482
         sendMailRecord.setCreateTime(new Date());
497 483
         sendMailRecord.setMailSubject(subject);
498 484
         sendMailRecord.setMailFromAddress(emailFrom);
485
+        sendMailRecord.setCaseNum(application.getCaseNum());
499 486
         if (emailFlag) {
500 487
             sendMailRecord.setSendStatus(1);
501 488
         } else {
@@ -529,7 +516,12 @@ public class MsSignSealServiceImpl implements MsSignSealService {
529 516
         if(CollectionUtil.isEmpty(msCaseAffiliates)){
530 517
             return AjaxResult.error("未找到案件相关人员");
531 518
         }
532
-
519
+        // 被申请操作人
520
+        Optional<MsCaseAffiliate> resAffiliateOpt = msCaseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst();
521
+        ExecutorService executor = ThreadUtil.createThreadPool();
522
+        if(!resAffiliateOpt.isPresent()){
523
+            return AjaxResult.error("案件相关人员不完整");
524
+        }
533 525
         for (MsCaseAffiliate affiliate : msCaseAffiliates) {
534 526
             //  申请人签收,根据流程id查找下一个流程节点
535 527
             if(affiliate.getUserId()!=null
@@ -540,6 +532,21 @@ public class MsSignSealServiceImpl implements MsSignSealService {
540 532
                 caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
541 533
                 caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
542 534
                 CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
535
+                // 发送被申请人签收短信
536
+                CompletableFuture.runAsync(() -> {
537
+                    MsCaseAffiliate caseAffiliate = resAffiliateOpt.get();
538
+                    SysUser sysUser = sysUserMapper.selectUserById(caseAffiliate.getUserId());
539
+                    MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(caseApplicationselect.getId()).systemType("TJ").build();
540
+                    String roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
541
+                    if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
542
+                        SmsUtils.sendSms(caseApplicationselect, "2126313", sysUser.getPhonenumber(), new String[]{sysUser.getNickName(), caseApplicationselect.getCaseNum(), "authId=" + roomUuid});
543
+                    } else if (StrUtil.isNotEmpty(sysUser.getEmail())) {
544
+                        String content = "尊敬的" + sysUser.getNickName() + "用户,您的" + caseApplicationselect.getCaseNum() + "文件已发送至邮箱,请点击链接进行确认签收https://txroom.xayunmei.com/#/sign?" + "authId=" + roomUuid + ",如非本人操作,请忽略本短信";
545
+                        emailOutUtil.sendMessage(sysUser.getEmail(), "调解系统文件签收", content, null, null);
546
+                        sendEmail(caseApplicationselect, sysUser, "调解系统文件签收", content);
547
+                    }
548
+                }, executor);
549
+                break;
543 550
             }
544 551
 
545 552
             // 被申请人签收
@@ -558,6 +565,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
558 565
                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
559 566
                     applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
560 567
                 }
568
+                break;
561 569
             }
562 570
         }
563 571
 
@@ -1247,11 +1255,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1247 1255
         }
1248 1256
         SendMailRecord sendMailRecord = new SendMailRecord();
1249 1257
         sendMailRecord.setCaseId(caseApplication.getId());
1258
+        sendMailRecord.setCaseNum(caseApplication.getCaseNum());
1250 1259
         sendMailRecord.setMailAddress(email);
1251 1260
         sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
1252 1261
         sendMailRecord.setMailName("签署后的调解书");
1253 1262
         sendMailRecord.setSendTime(new Date());
1254 1263
         sendMailRecord.setMailSubject("签署后的调解书");
1264
+        sendMailRecord.setMailFromAddress(emailFrom);
1255 1265
         sendMailRecord.setFileIds(fileId!=null?fileId.toString():null);
1256 1266
 //        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
1257 1267
         sendMailRecord.setCreateTime(new Date());