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

This commit was merged in pull request #148.
This commit is contained in:
2024-04-19 14:20:02 +08:00
committed by Gitea
@@ -431,9 +431,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
return AjaxResult.error("未找到案件相关人员"); return AjaxResult.error("未找到案件相关人员");
} }
// 申请操作人 // 申请操作人
Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst();
// 被申请操作人 // 被申请操作人
Optional<MsCaseAffiliate> resAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); Optional<MsCaseAffiliate> resAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst();
if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
throw new ServiceException("未找到案件操作人员"); throw new ServiceException("未找到案件操作人员");
} }
@@ -459,20 +459,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
sendEmail(caseApplication1, sysUser, "调解系统文件签收", content); sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
} }
}, executor); }, executor);
CompletableFuture.runAsync(() -> {
SysUser sysUser = sysUserMapper.selectUserById(resAffiliateOpt.get().getUserId());
MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(caseApplication1.getId()).systemType("TJ").build();
String roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
SmsUtils.sendSms(caseApplication1,"2126313", sysUser.getPhonenumber(),new String[]{sysUser.getNickName(),caseApplication1.getCaseNum(),"authId="+ roomUuid});
}else if(StrUtil.isNotEmpty(sysUser.getEmail())){
String content = "尊敬的"+sysUser.getNickName()+"用户,您的" + caseApplication1.getCaseNum() + "文件已发送至邮箱,请点击链接进行确认签收https://txroom.xayunmei.com/#/sign?" + "authId="+ roomUuid + ",如非本人操作,请忽略本短信";
emailOutUtil.sendMessage(sysUser.getEmail(), "调解系统文件签收", content, null, null);
sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
}
}, executor);
CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),""); CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
} }
@@ -496,6 +482,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
sendMailRecord.setCreateTime(new Date()); sendMailRecord.setCreateTime(new Date());
sendMailRecord.setMailSubject(subject); sendMailRecord.setMailSubject(subject);
sendMailRecord.setMailFromAddress(emailFrom); sendMailRecord.setMailFromAddress(emailFrom);
sendMailRecord.setCaseNum(application.getCaseNum());
if (emailFlag) { if (emailFlag) {
sendMailRecord.setSendStatus(1); sendMailRecord.setSendStatus(1);
} else { } else {
@@ -529,7 +516,12 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if(CollectionUtil.isEmpty(msCaseAffiliates)){ if(CollectionUtil.isEmpty(msCaseAffiliates)){
return AjaxResult.error("未找到案件相关人员"); return AjaxResult.error("未找到案件相关人员");
} }
// 被申请操作人
Optional<MsCaseAffiliate> resAffiliateOpt = msCaseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst();
ExecutorService executor = ThreadUtil.createThreadPool();
if(!resAffiliateOpt.isPresent()){
return AjaxResult.error("案件相关人员不完整");
}
for (MsCaseAffiliate affiliate : msCaseAffiliates) { for (MsCaseAffiliate affiliate : msCaseAffiliates) {
// 申请人签收,根据流程id查找下一个流程节点 // 申请人签收,根据流程id查找下一个流程节点
if(affiliate.getUserId()!=null if(affiliate.getUserId()!=null
@@ -540,6 +532,21 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName()); caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect); caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null); CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
// 发送被申请人签收短信
CompletableFuture.runAsync(() -> {
MsCaseAffiliate caseAffiliate = resAffiliateOpt.get();
SysUser sysUser = sysUserMapper.selectUserById(caseAffiliate.getUserId());
MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(caseApplicationselect.getId()).systemType("TJ").build();
String roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
SmsUtils.sendSms(caseApplicationselect, "2126313", sysUser.getPhonenumber(), new String[]{sysUser.getNickName(), caseApplicationselect.getCaseNum(), "authId=" + roomUuid});
} else if (StrUtil.isNotEmpty(sysUser.getEmail())) {
String content = "尊敬的" + sysUser.getNickName() + "用户,您的" + caseApplicationselect.getCaseNum() + "文件已发送至邮箱,请点击链接进行确认签收https://txroom.xayunmei.com/#/sign?" + "authId=" + roomUuid + ",如非本人操作,请忽略本短信";
emailOutUtil.sendMessage(sysUser.getEmail(), "调解系统文件签收", content, null, null);
sendEmail(caseApplicationselect, sysUser, "调解系统文件签收", content);
}
}, executor);
break;
} }
// 被申请人签收 // 被申请人签收
@@ -558,6 +565,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) { if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS); applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
} }
break;
} }
} }
@@ -1247,11 +1255,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
} }
SendMailRecord sendMailRecord = new SendMailRecord(); SendMailRecord sendMailRecord = new SendMailRecord();
sendMailRecord.setCaseId(caseApplication.getId()); sendMailRecord.setCaseId(caseApplication.getId());
sendMailRecord.setCaseNum(caseApplication.getCaseNum());
sendMailRecord.setMailAddress(email); sendMailRecord.setMailAddress(email);
sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅"); sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
sendMailRecord.setMailName("签署后的调解书"); sendMailRecord.setMailName("签署后的调解书");
sendMailRecord.setSendTime(new Date()); sendMailRecord.setSendTime(new Date());
sendMailRecord.setMailSubject("签署后的调解书"); sendMailRecord.setMailSubject("签署后的调解书");
sendMailRecord.setMailFromAddress(emailFrom);
sendMailRecord.setFileIds(fileId!=null?fileId.toString():null); sendMailRecord.setFileIds(fileId!=null?fileId.toString():null);
// sendMailRecord.setCreateBy(SecurityUtils.getUsername()); // sendMailRecord.setCreateBy(SecurityUtils.getUsername());
sendMailRecord.setCreateTime(new Date()); sendMailRecord.setCreateTime(new Date());