18792927508 vor 2 Jahren
Ursprung
Commit
8718bece10

+ 27
- 17
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Datei anzeigen

431
                     return AjaxResult.error("未找到案件相关人员");
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
                 if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
437
                 if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
438
                     throw new ServiceException("未找到案件操作人员");
438
                     throw new ServiceException("未找到案件操作人员");
439
                 }
439
                 }
459
                     sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
459
                     sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
460
                 }
460
                 }
461
                 }, executor);
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
                 CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
462
                 CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
477
 
463
 
478
             }
464
             }
496
         sendMailRecord.setCreateTime(new Date());
482
         sendMailRecord.setCreateTime(new Date());
497
         sendMailRecord.setMailSubject(subject);
483
         sendMailRecord.setMailSubject(subject);
498
         sendMailRecord.setMailFromAddress(emailFrom);
484
         sendMailRecord.setMailFromAddress(emailFrom);
485
+        sendMailRecord.setCaseNum(application.getCaseNum());
499
         if (emailFlag) {
486
         if (emailFlag) {
500
             sendMailRecord.setSendStatus(1);
487
             sendMailRecord.setSendStatus(1);
501
         } else {
488
         } else {
529
         if(CollectionUtil.isEmpty(msCaseAffiliates)){
516
         if(CollectionUtil.isEmpty(msCaseAffiliates)){
530
             return AjaxResult.error("未找到案件相关人员");
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
         for (MsCaseAffiliate affiliate : msCaseAffiliates) {
525
         for (MsCaseAffiliate affiliate : msCaseAffiliates) {
534
             //  申请人签收,根据流程id查找下一个流程节点
526
             //  申请人签收,根据流程id查找下一个流程节点
535
             if(affiliate.getUserId()!=null
527
             if(affiliate.getUserId()!=null
540
                 caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
532
                 caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
541
                 caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
533
                 caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
542
                 CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
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
                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
565
                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
559
                     applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
566
                     applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
560
                 }
567
                 }
568
+                break;
561
             }
569
             }
562
         }
570
         }
563
 
571
 
1247
         }
1255
         }
1248
         SendMailRecord sendMailRecord = new SendMailRecord();
1256
         SendMailRecord sendMailRecord = new SendMailRecord();
1249
         sendMailRecord.setCaseId(caseApplication.getId());
1257
         sendMailRecord.setCaseId(caseApplication.getId());
1258
+        sendMailRecord.setCaseNum(caseApplication.getCaseNum());
1250
         sendMailRecord.setMailAddress(email);
1259
         sendMailRecord.setMailAddress(email);
1251
         sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
1260
         sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
1252
         sendMailRecord.setMailName("签署后的调解书");
1261
         sendMailRecord.setMailName("签署后的调解书");
1253
         sendMailRecord.setSendTime(new Date());
1262
         sendMailRecord.setSendTime(new Date());
1254
         sendMailRecord.setMailSubject("签署后的调解书");
1263
         sendMailRecord.setMailSubject("签署后的调解书");
1264
+        sendMailRecord.setMailFromAddress(emailFrom);
1255
         sendMailRecord.setFileIds(fileId!=null?fileId.toString():null);
1265
         sendMailRecord.setFileIds(fileId!=null?fileId.toString():null);
1256
 //        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
1266
 //        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
1257
         sendMailRecord.setCreateTime(new Date());
1267
         sendMailRecord.setCreateTime(new Date());