|
|
@@ -316,10 +316,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
316
|
316
|
vo.setAppOperatorFlag(0);
|
|
317
|
317
|
}
|
|
318
|
318
|
}
|
|
|
319
|
+ // 签收按钮权限
|
|
|
320
|
+ if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
|
|
|
321
|
+ vo.setSignFlag(1);
|
|
|
322
|
+ }
|
|
319
|
323
|
|
|
320
|
324
|
}
|
|
321
|
325
|
if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
|
|
322
|
|
- // 申请人操作人
|
|
|
326
|
+ // 被申请人操作人
|
|
323
|
327
|
if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
|
|
324
|
328
|
vo.setResOperatorFlag(1);
|
|
325
|
329
|
}else if(vo.getCaseStatusName().equals("待签名")) {
|
|
|
@@ -329,7 +333,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
329
|
333
|
vo.setResOperatorFlag(0);
|
|
330
|
334
|
}
|
|
331
|
335
|
}
|
|
332
|
|
-
|
|
|
336
|
+ // 签收按钮权限
|
|
|
337
|
+ if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
|
|
|
338
|
+ vo.setSignFlag(1);
|
|
|
339
|
+ }
|
|
333
|
340
|
}
|
|
334
|
341
|
}
|
|
335
|
342
|
if(affiliate.getOrganizeFlag()==null || affiliate.getOrganizeFlag()!=1) {
|
|
|
@@ -387,7 +394,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
387
|
394
|
){
|
|
388
|
395
|
vo.setOtherFlag(1);
|
|
389
|
396
|
}
|
|
390
|
|
- if(role.getRoleName().equals("法律顾问")){
|
|
|
397
|
+ if(role.getRoleName().equals("法律顾问") && mediatorSort!=null && sendSort!=null
|
|
|
398
|
+ && null!=flowNameMap.get(vo.getCaseStatusName())
|
|
|
399
|
+ && flowNameMap.get(vo.getCaseStatusName())>mediatorSort
|
|
|
400
|
+ && flowNameMap.get(vo.getCaseStatusName())<=sendSort){
|
|
391
|
401
|
// 顾问可以上传下载调解书
|
|
392
|
402
|
vo.setMediationFileFlag(1);
|
|
393
|
403
|
}
|
|
|
@@ -1363,7 +1373,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1363
|
1373
|
|
|
1364
|
1374
|
}
|
|
1365
|
1375
|
}
|
|
1366
|
|
-
|
|
|
1376
|
+ if(StrUtil.isNotEmpty(applicant.getIdCard())){
|
|
|
1377
|
+ setBirthByIdentityNum(applicant);
|
|
|
1378
|
+ }
|
|
1367
|
1379
|
affiliateVO.setApplicant(applicantList);
|
|
1368
|
1380
|
|
|
1369
|
1381
|
// 如果身份证不为空,设置生日和性别
|
|
|
@@ -1727,6 +1739,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1727
|
1739
|
@Override
|
|
1728
|
1740
|
@Transactional
|
|
1729
|
1741
|
public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent) {
|
|
|
1742
|
+ if(StrUtil.isEmpty(affiliate.getEmail())){
|
|
|
1743
|
+ return;
|
|
|
1744
|
+ }
|
|
1730
|
1745
|
boolean emailFlag = emailOutUtil.sendMessage(affiliate.getEmail(), subject, sendContent, null, null);
|
|
1731
|
1746
|
|
|
1732
|
1747
|
SendMailRecord sendMailRecord = new SendMailRecord();
|
|
|
@@ -1897,18 +1912,22 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1897
|
1912
|
if (CollectionUtil.isNotEmpty(caseApplicationList)) {
|
|
1898
|
1913
|
caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
|
|
1899
|
1914
|
}
|
|
1900
|
|
- if(caseAppliId!=null) {
|
|
1901
|
1915
|
// 查询该用户是否是操作人,是申请操作人还是被申请操作人
|
|
1902
|
1916
|
List<MsCaseAffiliate> affiliates = msCaseAffiliateMapper.selectByCaseId(caseAppliId);
|
|
1903
|
1917
|
if(CollectionUtil.isEmpty(affiliates)){
|
|
1904
|
1918
|
return AjaxResult.error("未找到案件相关人员");
|
|
1905
|
1919
|
}
|
|
|
1920
|
+ List<Long> affiliateUserIds=new ArrayList<>();
|
|
1906
|
1921
|
// 根据案件id和用户id查询已选择的调解员进行回显
|
|
1907
|
1922
|
Example example = new Example(MsCaseMediator.class);
|
|
1908
|
1923
|
Example.Criteria criteria = example.createCriteria();
|
|
1909
|
1924
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
1910
|
1925
|
for (MsCaseAffiliate affiliate : affiliates) {
|
|
1911
|
|
- if(affiliate.getUserId()!=null && affiliate.getUserId().equals(loginUser.getUser().getUserId())){
|
|
|
1926
|
+ if(affiliate.getUserId()==null ){
|
|
|
1927
|
+ continue;
|
|
|
1928
|
+ }
|
|
|
1929
|
+ affiliateUserIds.add(affiliate.getUserId());
|
|
|
1930
|
+ if(affiliate.getUserId().equals(loginUser.getUser().getUserId())){
|
|
1912
|
1931
|
if( affiliate.getRoleType()==null){
|
|
1913
|
1932
|
continue;
|
|
1914
|
1933
|
}
|
|
|
@@ -1917,7 +1936,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1917
|
1936
|
criteria.andEqualTo("type", YesOrNoEnum.NO.getCode());
|
|
1918
|
1937
|
}
|
|
1919
|
1938
|
if(affiliate.getRoleType()==3|| affiliate.getRoleType()==4){
|
|
1920
|
|
- // 申请人
|
|
|
1939
|
+ // 被申请人
|
|
1921
|
1940
|
criteria.andEqualTo("type", YesOrNoEnum.YES.getCode());
|
|
1922
|
1941
|
}
|
|
1923
|
1942
|
}
|
|
|
@@ -1926,9 +1945,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1926
|
1945
|
// 已选择的调解员
|
|
1927
|
1946
|
List<MsCaseMediator> selectedMediators = msCaseMediatorMapper.selectByExample(example);
|
|
1928
|
1947
|
selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
|
|
1929
|
|
- }
|
|
|
1948
|
+
|
|
1930
|
1949
|
|
|
1931
|
1950
|
for (SysUser user : users) {
|
|
|
1951
|
+ if(affiliateUserIds.contains(user.getUserId())){
|
|
|
1952
|
+ continue;
|
|
|
1953
|
+ }
|
|
1932
|
1954
|
MediatorVO mediatorVO = new MediatorVO();
|
|
1933
|
1955
|
mediatorVO.setMediatorId(user.getUserId());
|
|
1934
|
1956
|
mediatorVO.setMediatorName(user.getNickName());
|
|
|
@@ -2079,7 +2101,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2079
|
2101
|
if (caseMap.containsKey(userId)) {
|
|
2080
|
2102
|
List<MsCaseApplication> applications = caseMap.get(userId);
|
|
2081
|
2103
|
// 已办案件
|
|
2082
|
|
- long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
|
|
|
2104
|
+ long count = applications.stream().filter(caseApplication -> caseApplication.getCaseStatusName().equals("结束")).count();
|
|
2083
|
2105
|
if(count>=maxCount){
|
|
2084
|
2106
|
maxCount=count;
|
|
2085
|
2107
|
application.setMediatorId(userId);
|
|
|
@@ -2135,6 +2157,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2135
|
2157
|
*/
|
|
2136
|
2158
|
@Transactional
|
|
2137
|
2159
|
public void verifyMediator(MsCaseApplication application,BookingVO vo) {
|
|
|
2160
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
2161
|
+ final List<MsCaseAffiliate>[] affiliates = new List[]{new ArrayList<>()};
|
|
|
2162
|
+ ExecutorService executor = ThreadUtil.createThreadPool();
|
|
|
2163
|
+ CompletableFuture<MsCaseApplication> cf1 = CompletableFuture.supplyAsync(() -> {
|
|
2138
|
2164
|
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId());
|
|
2139
|
2165
|
if (currentFlow == null) {
|
|
2140
|
2166
|
throw new ServiceException("未找到当前流程节点");
|
|
|
@@ -2145,7 +2171,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2145
|
2171
|
}
|
|
2146
|
2172
|
|
|
2147
|
2173
|
if(vo.getMediatorId()!=null) {
|
|
2148
|
|
- // setMediatorAndDate(application,vo);
|
|
2149
|
2174
|
application.setMediatorId(vo.getMediatorId());
|
|
2150
|
2175
|
application.setMediatorName(vo.getMediatorName());
|
|
2151
|
2176
|
}
|
|
|
@@ -2160,23 +2185,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2160
|
2185
|
if (caseApplication == null) {
|
|
2161
|
2186
|
throw new ServiceException("未找到案件");
|
|
2162
|
2187
|
}
|
|
|
2188
|
+
|
|
|
2189
|
+ affiliates[0] = selectAffliatesByCaseId(caseApplication.getId());
|
|
|
2190
|
+ if(CollectionUtil.isEmpty(affiliates[0])){
|
|
|
2191
|
+ throw new ServiceException("未找到案件相关人员");
|
|
|
2192
|
+ }
|
|
|
2193
|
+ // 新增日志
|
|
|
2194
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "",userId);
|
|
2163
|
2195
|
caseApplication.setHearDate(application.getHearDate());
|
|
2164
|
|
- ExecutorService executor = ThreadUtil.createThreadPool();
|
|
2165
|
|
- CompletableFuture.runAsync(() -> {
|
|
2166
|
|
- // 发送开庭短信
|
|
2167
|
|
- if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
|
|
2168
|
|
- List<MsCaseAffiliate> affiliates = selectAffliatesByCaseId(caseApplication.getId());
|
|
|
2196
|
+ return caseApplication;
|
|
|
2197
|
+ });
|
|
|
2198
|
+ if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
|
|
|
2199
|
+ cf1.thenAcceptAsync((result) -> {
|
|
|
2200
|
+ // 申请人发送开庭日期短信
|
|
|
2201
|
+ sendHearDateSms(result, affiliates[0]);
|
|
|
2202
|
+
|
|
|
2203
|
+ }, executor);
|
|
|
2204
|
+ cf1.thenAcceptAsync((result) -> {
|
|
|
2205
|
+ // 发送开庭短信
|
|
|
2206
|
+ if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
|
|
|
2207
|
+
|
|
|
2208
|
+ // 调解员发送开庭短信
|
|
|
2209
|
+ sendMeditorHearDateSms(result, vo);
|
|
2169
|
2210
|
|
|
2170
|
|
- // 申请人发送开庭日期短信
|
|
2171
|
|
- sendHearDateSms(caseApplication, affiliates);
|
|
2172
|
|
- // 调解员发送开庭短信
|
|
2173
|
|
- sendMeditorHearDateSms(caseApplication,vo);
|
|
|
2211
|
+ }
|
|
|
2212
|
+ }, executor);
|
|
|
2213
|
+ }
|
|
2174
|
2214
|
|
|
2175
|
|
- }
|
|
2176
|
|
- }, executor);
|
|
2177
|
2215
|
|
|
2178
|
|
- // 新增日志
|
|
2179
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
|
|
2180
|
2216
|
|
|
2181
|
2217
|
}
|
|
2182
|
2218
|
|
|
|
@@ -2241,9 +2277,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2241
|
2277
|
List<String> resPhones=new ArrayList<>();
|
|
2242
|
2278
|
List<String> appEmails=new ArrayList<>();
|
|
2243
|
2279
|
List<String> resEmails=new ArrayList<>();
|
|
|
2280
|
+ ExecutorService executor = ThreadUtil.createThreadPool();
|
|
2244
|
2281
|
|
|
2245
|
2282
|
for (MsCaseAffiliate affiliate : affiliates) {
|
|
2246
|
|
-
|
|
|
2283
|
+ CompletableFuture.runAsync(() -> {
|
|
2247
|
2284
|
// 申请人
|
|
2248
|
2285
|
if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
|
|
2249
|
2286
|
// 获取短信链接uuid
|
|
|
@@ -2256,13 +2293,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2256
|
2293
|
SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
|
|
2257
|
2294
|
new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
|
|
2258
|
2295
|
|
|
2259
|
|
- } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
|
|
|
2296
|
+ } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
|
|
2260
|
2297
|
appEmails.add(affiliate.getEmail());
|
|
2261
|
2298
|
// 发送邮件
|
|
2262
|
2299
|
caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
|
|
2263
|
2300
|
|
|
2264
|
2301
|
}
|
|
2265
|
|
- continue;
|
|
2266
|
2302
|
}
|
|
2267
|
2303
|
// 被申请人
|
|
2268
|
2304
|
if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) {
|
|
|
@@ -2276,14 +2312,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2276
|
2312
|
SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
|
|
2277
|
2313
|
new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
|
|
2278
|
2314
|
|
|
2279
|
|
- } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
|
|
|
2315
|
+ } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
|
|
2280
|
2316
|
resEmails.add(affiliate.getEmail());
|
|
2281
|
2317
|
// 发送邮件
|
|
2282
|
2318
|
caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
|
|
2283
|
2319
|
|
|
2284
|
2320
|
}
|
|
2285
|
2321
|
|
|
2286
|
|
- }
|
|
|
2322
|
+ }}, executor);
|
|
2287
|
2323
|
}
|
|
2288
|
2324
|
}else {
|
|
2289
|
2325
|
// 申请人/被申通知, 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
|
|
|
@@ -2322,7 +2358,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2322
|
2358
|
SmsUtils.sendSms(application, applicantNotice.getTemplateId(), affiliate.getPhone(),
|
|
2323
|
2359
|
applicantNotice.getTemplateParamSet());
|
|
2324
|
2360
|
|
|
2325
|
|
- } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
|
|
|
2361
|
+ } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
|
|
2326
|
2362
|
appEmails.add(affiliate.getEmail());
|
|
2327
|
2363
|
// 发送邮件
|
|
2328
|
2364
|
caseApplicationService.sendEmail(application, affiliate, applicantNotice.getSubject(), applicantNotice.getContent());
|
|
|
@@ -2340,7 +2376,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2340
|
2376
|
SmsUtils.sendSms(application, resNotice.getTemplateId(), affiliate.getPhone(),
|
|
2341
|
2377
|
resNotice.getTemplateParamSet());
|
|
2342
|
2378
|
|
|
2343
|
|
- } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
|
|
|
2379
|
+ } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
|
|
2344
|
2380
|
resEmails.add(affiliate.getEmail());
|
|
2345
|
2381
|
// 发送邮件
|
|
2346
|
2382
|
caseApplicationService.sendEmail(application, affiliate, resNotice.getSubject(), resNotice.getContent());
|
|
|
@@ -2485,9 +2521,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2485
|
2521
|
return AjaxResult.error("未找到案件");
|
|
2486
|
2522
|
}
|
|
2487
|
2523
|
req.setSealFlag(application.getSealFlag());
|
|
|
2524
|
+
|
|
2488
|
2525
|
if (StrUtil.isEmpty(application.getMediationMethod())) {
|
|
2489
|
2526
|
return AjaxResult.error("未选择调解方式");
|
|
2490
|
2527
|
}
|
|
|
2528
|
+
|
|
2491
|
2529
|
// 查询当前流程节点
|
|
2492
|
2530
|
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId());
|
|
2493
|
2531
|
if (currentFlow == null) {
|
|
|
@@ -2505,12 +2543,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2505
|
2543
|
if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
|
|
2506
|
2544
|
throw new ServiceException("未找到案件操作人员");
|
|
2507
|
2545
|
}
|
|
2508
|
|
- // 调解结果
|
|
2509
|
|
- Integer mediaResult = req.getMediaResult();
|
|
2510
|
|
- if (mediaResult == null) {
|
|
2511
|
|
- return AjaxResult.error("请选择调解结果");
|
|
2512
|
|
- }
|
|
|
2546
|
+
|
|
2513
|
2547
|
if (application.getMediationMethod().equals("1")) {
|
|
|
2548
|
+ Integer mediaResult = application.getMediaResult();
|
|
|
2549
|
+ if (mediaResult == null) {
|
|
|
2550
|
+ return AjaxResult.error("请选择调解结果");
|
|
|
2551
|
+ }
|
|
2514
|
2552
|
// 线上调解
|
|
2515
|
2553
|
List<MsCaseAttach> attachList = req.getAttachList();
|
|
2516
|
2554
|
if (CollectionUtil.isNotEmpty(attachList)) {
|
|
|
@@ -3037,6 +3075,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3037
|
3075
|
}
|
|
3038
|
3076
|
}
|
|
3039
|
3077
|
} else {
|
|
|
3078
|
+ Integer mediaResult=req.getMediaResult();
|
|
|
3079
|
+ if(mediaResult==null){
|
|
|
3080
|
+ return AjaxResult.error("请选择调解结果");
|
|
|
3081
|
+ }
|
|
3040
|
3082
|
// 线下调解
|
|
3041
|
3083
|
List<MsCaseAttach> attachList = req.getAttachList();
|
|
3042
|
3084
|
if (CollectionUtil.isEmpty(attachList)) {
|
|
|
@@ -3168,6 +3210,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3168
|
3210
|
AjaxResult result = caseApplicationService.generateApplication(req);
|
|
3169
|
3211
|
// 修改案件结果
|
|
3170
|
3212
|
application.setMediaResult(req.getMediaResult());
|
|
|
3213
|
+ application.setSealFlag(req.getSealFlag());
|
|
3171
|
3214
|
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
3172
|
3215
|
return AjaxResult.success();
|
|
3173
|
3216
|
}
|
|
|
@@ -3501,10 +3544,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3501
|
3544
|
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
3502
|
3545
|
}
|
|
3503
|
3546
|
}
|
|
3504
|
|
- caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
|
|
3505
|
|
- msCaseAttachMapper.save(caseAttach);
|
|
3506
|
|
- }
|
|
3507
|
3547
|
|
|
|
3548
|
+ }
|
|
|
3549
|
+ caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
|
|
|
3550
|
+ msCaseAttachMapper.save(caseAttach);
|
|
3508
|
3551
|
|
|
3509
|
3552
|
}
|
|
3510
|
3553
|
|