|
|
@@ -74,6 +74,8 @@ import java.text.SimpleDateFormat;
|
|
74
|
74
|
import java.time.LocalDate;
|
|
75
|
75
|
import java.time.format.DateTimeFormatter;
|
|
76
|
76
|
import java.util.*;
|
|
|
77
|
+import java.util.concurrent.CompletableFuture;
|
|
|
78
|
+import java.util.concurrent.ExecutorService;
|
|
77
|
79
|
import java.util.function.Function;
|
|
78
|
80
|
import java.util.stream.Collectors;
|
|
79
|
81
|
|
|
|
@@ -1609,20 +1611,23 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1609
|
1611
|
application.setUpdateBy(SecurityUtils.getUsername());
|
|
1610
|
1612
|
application.setUpdateTime(new Date());
|
|
1611
|
1613
|
application.setBatchNumber(null);
|
|
1612
|
|
- // 给被申请人发送短信
|
|
1613
|
|
- if (affiliateMap.containsKey(application.getId())) {
|
|
1614
|
|
- List<MsCaseAffiliate> affiliates = affiliateMap.get(application.getId());
|
|
1615
|
|
- // 被申受理分配通知
|
|
1616
|
|
- SMSNoticeDO resNotice = new SMSNoticeDO("待缴费通知",
|
|
1617
|
|
- "尊敬的用户,您的" + application.getCaseNum() + "的案件已成功提交,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信。",
|
|
1618
|
|
- "2074247",
|
|
1619
|
|
- new String[]{application.getCaseNum()}
|
|
1620
|
|
- );
|
|
1621
|
|
- SMSNotice notice = new SMSNotice(null,resNotice);
|
|
1622
|
|
- caseApplicationService.sendNotice(application,affiliates,false,notice);
|
|
1623
|
|
- }
|
|
|
1614
|
+
|
|
1624
|
1615
|
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
1625
|
1616
|
caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
|
|
|
1617
|
+ ExecutorService executor = ThreadUtil.createThreadPool();
|
|
|
1618
|
+ CompletableFuture.runAsync(() -> {
|
|
|
1619
|
+ // 给被申请人发送短信
|
|
|
1620
|
+ if (affiliateMap.containsKey(application.getId())) {
|
|
|
1621
|
+ List<MsCaseAffiliate> affiliates = affiliateMap.get(application.getId());
|
|
|
1622
|
+ // 被申受理分配通知
|
|
|
1623
|
+ SMSNoticeDO resNotice = new SMSNoticeDO("待缴费通知",
|
|
|
1624
|
+ "尊敬的用户,您的" + application.getCaseNum() + "的案件已成功提交,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信。",
|
|
|
1625
|
+ "2074247",
|
|
|
1626
|
+ new String[]{application.getCaseNum()}
|
|
|
1627
|
+ );
|
|
|
1628
|
+ SMSNotice notice = new SMSNotice(null,resNotice);
|
|
|
1629
|
+ caseApplicationService.sendNotice(application,affiliates,false,notice);
|
|
|
1630
|
+ }}, executor);
|
|
1626
|
1631
|
}
|
|
1627
|
1632
|
|
|
1628
|
1633
|
/**
|
|
|
@@ -1639,6 +1644,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1639
|
1644
|
if(selectApplication==null){
|
|
1640
|
1645
|
return;
|
|
1641
|
1646
|
}
|
|
|
1647
|
+ ExecutorService executor = ThreadUtil.createThreadPool();
|
|
|
1648
|
+ CompletableFuture.runAsync(() -> {
|
|
1642
|
1649
|
List<String> appPhones=new ArrayList<>();
|
|
1643
|
1650
|
List<String> resPhones=new ArrayList<>();
|
|
1644
|
1651
|
List<String> appEmails=new ArrayList<>();
|
|
|
@@ -1682,7 +1689,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1682
|
1689
|
}
|
|
1683
|
1690
|
}
|
|
1684
|
1691
|
}
|
|
1685
|
|
- }
|
|
|
1692
|
+ }}, executor);
|
|
1686
|
1693
|
}
|
|
1687
|
1694
|
|
|
1688
|
1695
|
/**
|
|
|
@@ -2125,54 +2132,58 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2125
|
2132
|
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
2126
|
2133
|
// 根据案件id查询案件
|
|
2127
|
2134
|
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
|
|
2128
|
|
- // 发送开庭短信
|
|
2129
|
|
- if(CollectionUtil.isNotEmpty(vo.getHerDates())) {
|
|
2130
|
|
- List<MsCaseAffiliate> affiliates = selectAffliatesByCaseId(application.getId());
|
|
2131
|
|
- caseApplication.setHearDate(application.getHearDate());
|
|
2132
|
|
- // 申请人发送开庭日期短信
|
|
2133
|
|
- sendHearDateSms(caseApplication, affiliates);
|
|
2134
|
|
-
|
|
2135
|
|
- // 调解员发送短信,根据调解员id查询用户
|
|
2136
|
|
- if (caseApplication.getMediatorId() != null) {
|
|
2137
|
|
- // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
|
|
2138
|
|
- SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
|
|
2139
|
|
- String content="尊敬的用户,您的" + caseApplication.getCaseNum() + "的案件,线下调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
|
|
2140
|
|
- String templateId="2077966";
|
|
2141
|
|
- String subject="开庭日期通知";
|
|
2142
|
|
- MsCaseAffiliate meditorAffliate = new MsCaseAffiliate();
|
|
2143
|
|
- meditorAffliate.setPhone(sysUser.getPhonenumber());
|
|
2144
|
|
- meditorAffliate.setEmail(sysUser.getEmail());
|
|
2145
|
|
- String roomUuid=null;
|
|
2146
|
|
- // 线上调解
|
|
2147
|
|
- if(StrUtil.isNotEmpty(application.getMediationMethod()) && application.getMediationMethod().equals("1")){
|
|
2148
|
|
- // 获取短信链接uuid
|
|
2149
|
|
- MeetingInfoVO meetingInfoVO= MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(application.getId()).roomId(application.getRoomId()).build();
|
|
2150
|
|
- roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
|
|
2151
|
|
- // 短信模板:2130103 线上调解时间和会议通知 尊敬的用户,您的{2}线上开庭时间为{3},会议链接https://txroom.xayunmei.com/#/home?{4},请点击链接参加会议,如非本人操作,请忽略本短信.
|
|
2152
|
|
-
|
|
2153
|
|
- content="尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为"+application.getHearDate()+"会议链接https://txroom.xayunmei.com/#/home?"+roomUuid+",请点击链接参加会议,如非本人操作,请忽略本短信.";
|
|
2154
|
|
- templateId = "2130103";
|
|
2155
|
|
- }
|
|
2156
|
|
- // 电话号不为空,发送短信,否则发邮箱
|
|
2157
|
|
- if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
|
|
2158
|
|
- if(roomUuid==null) {
|
|
2159
|
|
- SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
|
|
2160
|
|
- new String[]{caseApplication.getCaseNum(), application.getHearDate()});
|
|
2161
|
|
- }else {
|
|
2162
|
|
- SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
|
|
2163
|
|
- new String[]{caseApplication.getCaseNum(), application.getHearDate(),roomUuid});
|
|
2164
|
|
- }
|
|
|
2135
|
+ long l = System.currentTimeMillis();
|
|
|
2136
|
+ ExecutorService executor = ThreadUtil.createThreadPool();
|
|
|
2137
|
+ CompletableFuture.runAsync(() -> {
|
|
|
2138
|
+ // 发送开庭短信
|
|
|
2139
|
+ if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
|
|
|
2140
|
+ List<MsCaseAffiliate> affiliates = selectAffliatesByCaseId(application.getId());
|
|
|
2141
|
+ caseApplication.setHearDate(application.getHearDate());
|
|
|
2142
|
+ // 申请人发送开庭日期短信
|
|
|
2143
|
+ sendHearDateSms(caseApplication, affiliates);
|
|
2165
|
2144
|
|
|
2166
|
2145
|
|
|
|
2146
|
+ }
|
|
|
2147
|
+ }, executor);
|
|
|
2148
|
+ // 调解员发送短信,根据调解员id查询用户
|
|
|
2149
|
+ CompletableFuture.runAsync(() -> { if (caseApplication.getMediatorId() != null) {
|
|
|
2150
|
+ // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
|
|
|
2151
|
+ SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
|
|
|
2152
|
+ String content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "的案件,线下调解日期已确定为" + application.getHearDate() + ",请知晓,如非本人操作,请忽略本短信。";
|
|
|
2153
|
+ String templateId = "2077966";
|
|
|
2154
|
+ String subject = "开庭日期通知";
|
|
|
2155
|
+ MsCaseAffiliate meditorAffliate = new MsCaseAffiliate();
|
|
|
2156
|
+ meditorAffliate.setPhone(sysUser.getPhonenumber());
|
|
|
2157
|
+ meditorAffliate.setEmail(sysUser.getEmail());
|
|
|
2158
|
+ String roomUuid = null;
|
|
|
2159
|
+ // 线上调解
|
|
|
2160
|
+ if (StrUtil.isNotEmpty(application.getMediationMethod()) && application.getMediationMethod().equals("1")) {
|
|
|
2161
|
+ // 获取短信链接uuid
|
|
|
2162
|
+ MeetingInfoVO meetingInfoVO = MeetingInfoVO.builder().userId(sysUser.getUserId()).userName(sysUser.getUserName()).caseId(application.getId()).roomId(application.getRoomId()).build();
|
|
|
2163
|
+ roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
|
|
|
2164
|
+ // 短信模板:2130103 线上调解时间和会议通知 尊敬的用户,您的{2}线上开庭时间为{3},会议链接https://txroom.xayunmei.com/#/home?{4},请点击链接参加会议,如非本人操作,请忽略本短信.
|
|
|
2165
|
+
|
|
|
2166
|
+ content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为" + application.getHearDate() + "会议链接https://txroom.xayunmei.com/#/home?" + roomUuid + ",请点击链接参加会议,如非本人操作,请忽略本短信.";
|
|
|
2167
|
+ templateId = "2130103";
|
|
|
2168
|
+ }
|
|
|
2169
|
+ // 电话号不为空,发送短信,否则发邮箱
|
|
|
2170
|
+ if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
|
|
|
2171
|
+ if (roomUuid == null) {
|
|
|
2172
|
+ SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
|
|
|
2173
|
+ new String[]{caseApplication.getCaseNum(), application.getHearDate()});
|
|
2167
|
2174
|
} else {
|
|
2168
|
|
- // 发送邮件
|
|
2169
|
|
- caseApplicationService.sendEmail(caseApplication, meditorAffliate, subject, content);
|
|
2170
|
|
-
|
|
|
2175
|
+ SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
|
|
|
2176
|
+ new String[]{caseApplication.getCaseNum(), application.getHearDate(), roomUuid});
|
|
2171
|
2177
|
}
|
|
|
2178
|
+
|
|
|
2179
|
+
|
|
|
2180
|
+ } else {
|
|
|
2181
|
+ // 发送邮件
|
|
|
2182
|
+ caseApplicationService.sendEmail(caseApplication, meditorAffliate, subject, content);
|
|
|
2183
|
+
|
|
2172
|
2184
|
}
|
|
2173
|
|
- }
|
|
|
2185
|
+ } }, executor);
|
|
2174
|
2186
|
// 新增日志
|
|
2175
|
|
-
|
|
2176
|
2187
|
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
|
|
2177
|
2188
|
|
|
2178
|
2189
|
}
|
|
|
@@ -2327,7 +2338,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2327
|
2338
|
application.setRejectReason(reason);
|
|
2328
|
2339
|
if(application.getCaseFlowId()!=null && application.getCaseFlowId()==4){
|
|
2329
|
2340
|
// todo 超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
|
|
2330
|
|
- // 申请人不受理分配通知
|
|
|
2341
|
+ // 申请人不受理分配通知 // todo 短信异步
|
|
|
2342
|
+ ExecutorService executor = ThreadUtil.createThreadPool();
|
|
|
2343
|
+ CompletableFuture.runAsync(() -> {
|
|
2331
|
2344
|
String rejectReason = application.getRejectReason() == null ? "" : application.getRejectReason();
|
|
2332
|
2345
|
SMSNoticeDO applicantNotice = new SMSNoticeDO("案件不受理通知",
|
|
2333
|
2346
|
"尊敬的用户,您编号为" + application.getCaseNum() + "的案件由于" + rejectReason + "所以不予受理,请知晓,如非本人操作,请忽略本短信。",
|
|
|
@@ -2337,6 +2350,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2337
|
2350
|
|
|
2338
|
2351
|
SMSNotice notice = new SMSNotice(applicantNotice,null);
|
|
2339
|
2352
|
caseApplicationService.sendNotice(application,affiliates,true,notice);
|
|
|
2353
|
+ }, executor);
|
|
2340
|
2354
|
// 修改案件状态为17,结束
|
|
2341
|
2355
|
MsCaseApplication caseApplication = new MsCaseApplication();
|
|
2342
|
2356
|
caseApplication.setId(id);
|