Pārlūkot izejas kodu

会议短信,签收优化

18792927508 2 gadus atpakaļ
vecāks
revīzija
b03cf6428b

+ 2
- 2
ruoyi-admin/src/main/resources/application.yml Parādīt failu

120
   header: Authorization
120
   header: Authorization
121
   # 令牌密钥
121
   # 令牌密钥
122
   secret: abcdefghijklmnopqrstuvwxyz
122
   secret: abcdefghijklmnopqrstuvwxyz
123
-  # 令牌有效期(默认30分钟)
124
-  expireTime: 30
123
+  # 令牌有效期(默认120分钟)
124
+  expireTime: 120
125
 
125
 
126
 # MyBatis配置
126
 # MyBatis配置
127
 mybatis:
127
 mybatis:

+ 10
- 10
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Parādīt failu

2133
         // 根据案件id查询案件
2133
         // 根据案件id查询案件
2134
         MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
2134
         MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
2135
         caseApplication.setHearDate(application.getHearDate());
2135
         caseApplication.setHearDate(application.getHearDate());
2136
-        long l = System.currentTimeMillis();
2137
         ExecutorService executor = ThreadUtil.createThreadPool();
2136
         ExecutorService executor = ThreadUtil.createThreadPool();
2138
         CompletableFuture.runAsync(() -> {
2137
         CompletableFuture.runAsync(() -> {
2139
                     // 发送开庭短信
2138
                     // 发送开庭短信
2160
             // 线上调解
2159
             // 线上调解
2161
             if (StrUtil.isNotEmpty(caseApplication.getMediationMethod()) && caseApplication.getMediationMethod().equals("1")) {
2160
             if (StrUtil.isNotEmpty(caseApplication.getMediationMethod()) && caseApplication.getMediationMethod().equals("1")) {
2162
                 // 获取短信链接uuid
2161
                 // 获取短信链接uuid
2163
-                MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(caseApplication.getId()).roomId(caseApplication.getRoomId()).build();
2162
+                MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(caseApplication.getId()).roomId(caseApplication.getRoomId()).systemType("TJ").build();
2164
                 roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
2163
                 roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
2165
                 // 短信模板:2130103 线上调解时间和会议通知  尊敬的用户,您的{2}线上开庭时间为{3},会议链接https://txroom.xayunmei.com/#/home?{4},请点击链接参加会议,如非本人操作,请忽略本短信.
2164
                 // 短信模板:2130103 线上调解时间和会议通知  尊敬的用户,您的{2}线上开庭时间为{3},会议链接https://txroom.xayunmei.com/#/home?{4},请点击链接参加会议,如非本人操作,请忽略本短信.
2166
 
2165
 
2167
-                content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为" + application.getHearDate() + "会议链接https://txroom.xayunmei.com/#/home?" + roomUuid + ",请点击链接参加会议,如非本人操作,请忽略本短信.";
2166
+                content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为" + application.getHearDate() + "会议链接https://txroom.xayunmei.com/#/home?" +"authId="+ roomUuid + ",请点击链接参加会议,如非本人操作,请忽略本短信.";
2168
                 templateId = "2130103";
2167
                 templateId = "2130103";
2169
             }
2168
             }
2170
             // 电话号不为空,发送短信,否则发邮箱
2169
             // 电话号不为空,发送短信,否则发邮箱
2174
                             new String[]{caseApplication.getCaseNum(), application.getHearDate()});
2173
                             new String[]{caseApplication.getCaseNum(), application.getHearDate()});
2175
                 } else {
2174
                 } else {
2176
                     SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
2175
                     SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
2177
-                            new String[]{caseApplication.getCaseNum(), application.getHearDate(), roomUuid});
2176
+                            new String[]{caseApplication.getCaseNum(), application.getHearDate(), "authId="+roomUuid});
2178
                 }
2177
                 }
2179
 
2178
 
2180
 
2179
 
2209
                     // 申请人
2208
                     // 申请人
2210
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
2209
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
2211
                         // 获取短信链接uuid
2210
                         // 获取短信链接uuid
2212
-                        MeetingInfoVO meetingInfoVO= MeetingInfoVO.builder().userId(affiliate.getUserId()).userName(affiliate.getUserName()).caseId(application.getId()).roomId(application.getRoomId()).build();
2211
+                        MeetingInfoVO meetingInfoVO= MeetingInfoVO.builder().userId(affiliate.getUserId()).userName(affiliate.getUserName()).caseId(application.getId()).roomId(application.getRoomId()).systemType("TJ").build();
2213
                         String roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
2212
                         String roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
2214
                         // 申请人/被申通知,  线上调解 2075447  尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
2213
                         // 申请人/被申通知,  线上调解 2075447  尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
2215
-                       String content="尊敬的用户,您的" + application.getCaseNum() + "线上开庭时间为"+application.getHearDate()+"会议链接https://txroom.xayunmei.com/#/home?"+roomUuid+",请点击链接参加会议,如非本人操作,请忽略本短信.";
2214
+                       String content="尊敬的用户,您的" + application.getCaseNum() + "线上开庭时间为"+application.getHearDate()+"会议链接https://txroom.xayunmei.com/#/home?"+"authId="+roomUuid+",请点击链接参加会议,如非本人操作,请忽略本短信.";
2216
                         if (StrUtil.isNotEmpty(affiliate.getPhone())&&!appPhones.contains(affiliate.getPhone())) {
2215
                         if (StrUtil.isNotEmpty(affiliate.getPhone())&&!appPhones.contains(affiliate.getPhone())) {
2217
                             appPhones.add(affiliate.getPhone());
2216
                             appPhones.add(affiliate.getPhone());
2218
                             SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2217
                             SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2219
-                                    new String[]{application.getCaseNum(),application.getHearDate(),roomUuid});
2218
+                                    new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
2220
 
2219
 
2221
                         } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
2220
                         } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
2222
                             appEmails.add(affiliate.getEmail());
2221
                             appEmails.add(affiliate.getEmail());
2229
                     // 被申请人
2228
                     // 被申请人
2230
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) {
2229
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) {
2231
                         // 获取短信链接uuid
2230
                         // 获取短信链接uuid
2232
-                        MeetingInfoVO meetingInfoVO= MeetingInfoVO.builder().userId(affiliate.getUserId()).userName(affiliate.getUserName()).caseId(application.getId()).roomId(application.getRoomId()).build();
2231
+                        MeetingInfoVO meetingInfoVO= MeetingInfoVO.builder().userId(affiliate.getUserId()).userName(affiliate.getUserName()).caseId(application.getId()).roomId(application.getRoomId()).systemType("TJ").build();
2233
                         String roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
2232
                         String roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
2234
                         // 申请人/被申通知,  线上调解 2075447  尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
2233
                         // 申请人/被申通知,  线上调解 2075447  尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
2235
-                        String content="尊敬的用户,您的" + application.getCaseNum() + "线上开庭时间为"+application.getHearDate()+"会议链接https://txroom.xayunmei.com/#/home?"+roomUuid+",请点击链接参加会议,如非本人操作,请忽略本短信.";
2234
+                        String content="尊敬的用户,您的" + application.getCaseNum() + "线上开庭时间为"+application.getHearDate()+"会议链接https://txroom.xayunmei.com/#/home?"+"authId="+roomUuid+",请点击链接参加会议,如非本人操作,请忽略本短信.";
2236
                             if (StrUtil.isNotEmpty(affiliate.getPhone())&& !resPhones.contains(affiliate.getPhone())) {
2235
                             if (StrUtil.isNotEmpty(affiliate.getPhone())&& !resPhones.contains(affiliate.getPhone())) {
2237
                                 resPhones.add(affiliate.getPhone());
2236
                                 resPhones.add(affiliate.getPhone());
2238
                                 SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2237
                                 SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2239
-                                        new String[]{application.getCaseNum(),application.getHearDate(),roomUuid});
2238
+                                        new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
2240
 
2239
 
2241
                             } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
2240
                             } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
2242
                                 resEmails.add(affiliate.getEmail());
2241
                                 resEmails.add(affiliate.getEmail());
2440
         if (application == null) {
2439
         if (application == null) {
2441
             return AjaxResult.error("未找到案件");
2440
             return AjaxResult.error("未找到案件");
2442
         }
2441
         }
2442
+        req.setSealFlag(application.getSealFlag());
2443
         if (StrUtil.isEmpty(application.getMediationMethod())) {
2443
         if (StrUtil.isEmpty(application.getMediationMethod())) {
2444
             return AjaxResult.error("未选择调解方式");
2444
             return AjaxResult.error("未选择调解方式");
2445
         }
2445
         }

+ 112
- 35
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Parādīt failu

21
 import com.ruoyi.common.utils.EmailOutUtil;
21
 import com.ruoyi.common.utils.EmailOutUtil;
22
 import com.ruoyi.common.utils.SecurityUtils;
22
 import com.ruoyi.common.utils.SecurityUtils;
23
 import com.ruoyi.common.utils.StringUtils;
23
 import com.ruoyi.common.utils.StringUtils;
24
+import com.ruoyi.common.utils.ThreadUtil;
24
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
25
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
25
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
26
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
26
 import com.ruoyi.system.domain.entity.shortmessage.MsSendMailHistoryRecord;
27
 import com.ruoyi.system.domain.entity.shortmessage.MsSendMailHistoryRecord;
43
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
44
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
44
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
45
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
45
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
46
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
47
+import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
46
 import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
48
 import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
47
 import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
49
 import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
48
 import com.ruoyi.wisdomarbitrate.mapper.dept.SealManageMapper;
50
 import com.ruoyi.wisdomarbitrate.mapper.dept.SealManageMapper;
53
 import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SendMailRecordMapper;
55
 import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SendMailRecordMapper;
54
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
56
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
55
 import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
57
 import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
58
+import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
56
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
59
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
57
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
60
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
61
+import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
58
 import org.springframework.beans.BeanUtils;
62
 import org.springframework.beans.BeanUtils;
59
 import org.springframework.beans.factory.annotation.Autowired;
63
 import org.springframework.beans.factory.annotation.Autowired;
60
 import org.springframework.beans.factory.annotation.Value;
64
 import org.springframework.beans.factory.annotation.Value;
67
 import java.io.IOException;
71
 import java.io.IOException;
68
 import java.time.LocalDate;
72
 import java.time.LocalDate;
69
 import java.util.*;
73
 import java.util.*;
74
+import java.util.concurrent.CompletableFuture;
75
+import java.util.concurrent.ExecutorService;
70
 import java.util.stream.Collectors;
76
 import java.util.stream.Collectors;
71
 
77
 
72
 import static com.ruoyi.common.core.domain.AjaxResult.success;
78
 import static com.ruoyi.common.core.domain.AjaxResult.success;
123
     BeiMingInterfaceService beiMingInterfaceService;
129
     BeiMingInterfaceService beiMingInterfaceService;
124
     @Autowired
130
     @Autowired
125
     private MsSendMailHistoryRecordMapper sendMailHistoryRecordMapper;
131
     private MsSendMailHistoryRecordMapper sendMailHistoryRecordMapper;
126
-
132
+    @Autowired
133
+    ShortMessageService shortMessageService;
127
 
134
 
128
 
135
 
129
 
136
 
423
                 if(CollectionUtil.isEmpty(affiliates)){
430
                 if(CollectionUtil.isEmpty(affiliates)){
424
                     return AjaxResult.error("未找到案件相关人员");
431
                     return AjaxResult.error("未找到案件相关人员");
425
                 }
432
                 }
426
-                List<MsCaseAffiliate> oprratorList = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() != null
427
-                                && affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()))
428
-                        .collect(Collectors.toList());
429
-                if(CollectionUtil.isEmpty(oprratorList)){
430
-                    return AjaxResult.error("未找到案件操作人员");
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();
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();
437
+                if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
438
+                    throw new ServiceException("未找到案件操作人员");
431
                 }
439
                 }
432
-
433
-                for (MsCaseAffiliate affiliate : oprratorList) {
434
-                    if(affiliate.getRoleType()==null){
435
-                        continue;
436
-                    }
437
-                    boolean appEmailFlag = sendCaseEmail(caseApplication1, affiliate.getEmail(), caseAttachList);
438
-
439
-
440
+                ExecutorService executor = ThreadUtil.createThreadPool();
441
+                // 发送邮件
442
+                CompletableFuture.runAsync(() -> {
443
+                if (StrUtil.isNotEmpty(applicantAffiliateOpt.get().getEmail())) {
444
+                    boolean appEmailFlag = sendCaseEmail(caseApplication1, applicantAffiliateOpt.get().getEmail(), caseAttachList);
445
+                }
446
+                if (!StrUtil.isEmpty(resAffiliateOpt.get().getEmail())) {
447
+                    boolean appEmailFlag = sendCaseEmail(caseApplication1, resAffiliateOpt.get().getEmail(), caseAttachList);
448
+                } }, executor);
449
+                // 发送签收短信,2126313	尊敬的{1}用户,您的{2}文件已发送至邮箱,请点击链接进行确认签收https://txroom.xayunmei.com/#/sign?{3},如非本人操作,请忽略本短信
450
+                CompletableFuture.runAsync(() -> {
451
+                    SysUser sysUser = sysUserMapper.selectUserById(applicantAffiliateOpt.get().getUserId());
452
+                    // 获取短信链接uuid
453
+                    MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(caseApplication1.getId()).systemType("TJ").build();
454
+                    String   roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
455
+                if (!StrUtil.isEmpty(sysUser.getPhonenumber())) {
456
+                    SmsUtils.sendSms(caseApplication1,"2126313", sysUser.getPhonenumber(),new String[]{sysUser.getNickName(),caseApplication1.getCaseNum(),"authId="+ roomUuid});
457
+                }else if(StrUtil.isNotEmpty(sysUser.getEmail())){
458
+                  String  content = "尊敬的"+sysUser.getNickName()+"用户,您的" + caseApplication1.getCaseNum() + "文件已发送至邮箱,请点击链接进行确认签收https://txroom.xayunmei.com/#/sign?" + "authId="+ roomUuid + ",如非本人操作,请忽略本短信";
459
+                    sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
440
                 }
460
                 }
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
+
441
 
475
 
442
                 CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
476
                 CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
443
 
477
 
449
 
483
 
450
         return AjaxResult.success("");
484
         return AjaxResult.success("");
451
     }
485
     }
486
+    public void sendEmail(MsCaseApplication application, SysUser user, String subject, String sendContent) {
487
+        boolean emailFlag = emailOutUtil.sendMessage(user.getEmail(), subject, sendContent, null, null);
452
 
488
 
489
+        SendMailRecord sendMailRecord = new SendMailRecord();
490
+        sendMailRecord.setCaseId(application.getId());
491
+        sendMailRecord.setMailAddress(user.getEmail());
492
+        sendMailRecord.setMailContent(sendContent);
493
+        sendMailRecord.setMailName(subject);
494
+        sendMailRecord.setSendTime(new Date());
495
+//        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
496
+        sendMailRecord.setCreateTime(new Date());
497
+        sendMailRecord.setMailSubject(subject);
498
+        sendMailRecord.setMailFromAddress(emailFrom);
499
+        if (emailFlag) {
500
+            sendMailRecord.setSendStatus(1);
501
+        } else {
502
+            sendMailRecord.setSendStatus(0);
503
+        }
504
+        sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
505
+        // 新增历史记录
506
+        MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord();
507
+        BeanUtils.copyProperties(sendMailRecord, msSendMailHistoryRecord);
508
+        msSendMailHistoryRecord.setParentId(sendMailRecord.getId());
509
+        msSendMailHistoryRecord.setId(null);
510
+        sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
511
+    }
453
     @Override
512
     @Override
454
     @Transactional
513
     @Transactional
455
     public AjaxResult msCaseSign(MsSignSealDTO dto) {
514
     public AjaxResult msCaseSign(MsSignSealDTO dto) {
456
         Long caseId = dto.getCaseId();
515
         Long caseId = dto.getCaseId();
457
-       //  MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
458
         MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseId);
516
         MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseId);
517
+        if(caseApplicationselect==null){
518
+            return AjaxResult.error("当前案件不存在");
519
+        }
459
         // 查询当前节点
520
         // 查询当前节点
460
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId());
521
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId());
461
         if (currentFlow == null) {
522
         if (currentFlow == null) {
462
             return AjaxResult.error("当前流程不存在");
523
             return AjaxResult.error("当前流程不存在");
463
         }
524
         }
464
-        if (dto.getIsSignApply() != null && dto.getIsSignApply().equals(1) ) {
465
-            // 根据流程id查找下一个流程节点
466
-            MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
467
-            caseApplicationselect.setCaseFlowId(nextFlow.getId());
468
-            caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
469
-            caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
470
-            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
525
+        Long loginUserId = SecurityUtils.getUserId();
526
+        Example example = new Example(MsCaseAffiliate.class);
527
+        example.createCriteria().andEqualTo("caseAppliId", caseId);
528
+        List<MsCaseAffiliate> msCaseAffiliates = msCaseAffiliateMapper.selectByExample(example);
529
+        if(CollectionUtil.isEmpty(msCaseAffiliates)){
530
+            return AjaxResult.error("未找到案件相关人员");
471
         }
531
         }
472
 
532
 
473
-        if (dto.getIsSignRespon() != null && dto.getIsSignRespon().equals(1)) {
474
-
475
-            // 根据流程id查找下一个流程节点
476
-            MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
477
-            caseApplicationselect.setCaseFlowId(nextFlow.getId());
478
-            caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
479
-            caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
480
-            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
481
-            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), 17, "结束", null);
482
-            //  被申请人签收结束对接北明,为调解成功状态
483
-            if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
484
-                applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
533
+        for (MsCaseAffiliate affiliate : msCaseAffiliates) {
534
+            //  申请人签收,根据流程id查找下一个流程节点
535
+            if(affiliate.getUserId()!=null
536
+                    && loginUserId.equals(affiliate.getUserId())
537
+                    &&affiliate.getRoleType()!=null&&(affiliate.getRoleType().equals(1)||affiliate.getRoleType().equals(2))) {
538
+                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
539
+                caseApplicationselect.setCaseFlowId(nextFlow.getId());
540
+                caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
541
+                caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
542
+                CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
543
+            }
544
+
545
+            // 被申请人签收
546
+            if(affiliate.getUserId()!=null
547
+                    && loginUserId.equals(affiliate.getUserId())
548
+                    &&affiliate.getRoleType()!=null&&(affiliate.getRoleType().equals(3)||affiliate.getRoleType().equals(4))) {
549
+
550
+                // 根据流程id查找下一个流程节点
551
+                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
552
+                caseApplicationselect.setCaseFlowId(nextFlow.getId());
553
+                caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
554
+                caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
555
+                CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
556
+                CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), 17, "结束", null);
557
+                //  被申请人签收结束对接北明,为调解成功状态
558
+                if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
559
+                    applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
560
+                }
485
             }
561
             }
486
         }
562
         }
487
 
563
 
564
+
488
         return AjaxResult.success("签收成功");
565
         return AjaxResult.success("签收成功");
489
 
566
 
490
     }
567
     }
1156
         Long fileId = null;
1233
         Long fileId = null;
1157
         if (caseAttachList != null && caseAttachList.size() > 0) {
1234
         if (caseAttachList != null && caseAttachList.size() > 0) {
1158
             for (MsCaseAttach caseAttach : caseAttachList) {
1235
             for (MsCaseAttach caseAttach : caseAttachList) {
1159
-                if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
1236
+                if (Objects.equals(caseAttach.getAnnexType(), AnnexTypeEnum.MEDIATE_BOOK.getCode())) {
1160
                     String prefix = "/profile";
1237
                     String prefix = "/profile";
1161
                     int startIndex = prefix.length();
1238
                     int startIndex = prefix.length();
1162
                     String annexPath = caseAttach.getAnnexPath();
1239
                     String annexPath = caseAttach.getAnnexPath();