|
|
@@ -211,7 +211,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
211
|
211
|
startPage();
|
|
212
|
212
|
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null,null);
|
|
213
|
213
|
// 设置申请人被申请人及签名按钮限
|
|
214
|
|
- setAfflicate(new HashMap<>(),list,loginUser.getUserId(),roles);
|
|
|
214
|
+ setAfflicate(new HashMap<>(),list,loginUser,roles,false);
|
|
215
|
215
|
return list;
|
|
216
|
216
|
}
|
|
217
|
217
|
if(CollectionUtil.isEmpty(roles) ){
|
|
|
@@ -238,6 +238,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
238
|
238
|
|
|
239
|
239
|
// 是否查询所有
|
|
240
|
240
|
boolean isSelectAll = false;
|
|
|
241
|
+ // 是否嗲三方代理人
|
|
|
242
|
+ boolean agentFlag = false;
|
|
241
|
243
|
|
|
242
|
244
|
for (SysRole role : roles) {
|
|
243
|
245
|
if(StrUtil.isNotEmpty(role.getRoleName())){
|
|
|
@@ -251,6 +253,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
251
|
253
|
if(StrUtil.equals(role.getRoleName(),"调解员")) {
|
|
252
|
254
|
req.setMediatorId(String.valueOf(sysUser.getUserId()));
|
|
253
|
255
|
}
|
|
|
256
|
+ if(StrUtil.contains(role.getRoleName(),"代理")) {
|
|
|
257
|
+ req.setCreateBy(String.valueOf(sysUser.getUserName()));
|
|
|
258
|
+ agentFlag=true;
|
|
|
259
|
+ }
|
|
254
|
260
|
}
|
|
255
|
261
|
}
|
|
256
|
262
|
if(!isSelectAll){
|
|
|
@@ -265,7 +271,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
265
|
271
|
// 查询案件列表
|
|
266
|
272
|
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, caseFlowIds,roleIds);
|
|
267
|
273
|
// 设置申请人被申请人及签名按钮限
|
|
268
|
|
- setAfflicate(flowNameMap,list,loginUser.getUserId(),roles);
|
|
|
274
|
+ setAfflicate(flowNameMap,list,loginUser,roles,agentFlag);
|
|
269
|
275
|
return list;
|
|
270
|
276
|
}
|
|
271
|
277
|
|
|
|
@@ -273,9 +279,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
273
|
279
|
* 设置申请人被申请人及签名按钮限
|
|
274
|
280
|
* @param
|
|
275
|
281
|
* @param list
|
|
276
|
|
- * @param loginUserId 当前登录用户id
|
|
|
282
|
+ * @param loginUser 当前登录用户
|
|
277
|
283
|
*/
|
|
278
|
|
- private void setAfflicate( Map<String, Integer> flowNameMap,List<MsCaseApplicationVO> list,Long loginUserId, List<SysRole> roles ) {
|
|
|
284
|
+ private void setAfflicate( Map<String, Integer> flowNameMap,List<MsCaseApplicationVO> list,LoginUser loginUser, List<SysRole> roles , boolean agentFlag) {
|
|
279
|
285
|
if(CollectionUtil.isEmpty(list)){
|
|
280
|
286
|
return;
|
|
281
|
287
|
}
|
|
|
@@ -294,8 +300,25 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
294
|
300
|
}
|
|
295
|
301
|
|
|
296
|
302
|
for (MsCaseApplicationVO vo : list) {
|
|
297
|
|
- if(vo.getMediatorId()!=null&&vo.getMediatorId().equals(loginUserId)){
|
|
|
303
|
+ if(vo.getMediatorId()!=null&&vo.getMediatorId().equals(loginUser.getUserId())){
|
|
298
|
304
|
isMediatorRole=true;
|
|
|
305
|
+ vo.setMediatorFlag(1);
|
|
|
306
|
+ }else {
|
|
|
307
|
+ vo.setMediatorFlag(0);
|
|
|
308
|
+ }
|
|
|
309
|
+ // 第三方代理人标志
|
|
|
310
|
+ if(StrUtil.isNotEmpty(vo.getCreatBy())){
|
|
|
311
|
+ if(StrUtil.isEmpty(loginUser.getUsername())){
|
|
|
312
|
+ vo.setAgentFlag(0);
|
|
|
313
|
+ }else {
|
|
|
314
|
+ if(StrUtil.equals(loginUser.getUsername(),vo.getCreatBy()) && agentFlag){
|
|
|
315
|
+ vo.setAgentFlag(1);
|
|
|
316
|
+ }else {
|
|
|
317
|
+ vo.setAgentFlag(0);
|
|
|
318
|
+ }
|
|
|
319
|
+ }
|
|
|
320
|
+ }else {
|
|
|
321
|
+ vo.setAgentFlag(0);
|
|
299
|
322
|
}
|
|
300
|
323
|
// 设置申请人和被申请人
|
|
301
|
324
|
if(affiliateMap!=null && affiliateMap.containsKey(vo.getId())){
|
|
|
@@ -308,34 +331,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
308
|
331
|
if (affiliate.getUserId()!=null && affiliate.getRoleType() != null && affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) {
|
|
309
|
332
|
if (vo.getAppOperatorFlag() == null && (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 2)) {
|
|
310
|
333
|
// 申请人操作人
|
|
311
|
|
- if(affiliate.getUserId().equals(loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
|
|
|
334
|
+ if(affiliate.getUserId().equals(loginUser.getUserId()) &&!vo.getCaseStatusName().equals("待签名")){
|
|
312
|
335
|
vo.setAppOperatorFlag(1);
|
|
313
|
336
|
}else if(vo.getCaseStatusName().equals("待签名")) {
|
|
314
|
|
- if(affiliate.getUserId().equals(loginUserId)){
|
|
|
337
|
+ if(affiliate.getUserId().equals(loginUser.getUserId())){
|
|
315
|
338
|
vo.setAppOperatorFlag(1);
|
|
316
|
339
|
}else {
|
|
317
|
340
|
vo.setAppOperatorFlag(0);
|
|
318
|
341
|
}
|
|
319
|
342
|
}
|
|
320
|
343
|
// 签收按钮权限
|
|
321
|
|
- if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待申请人签收")){
|
|
|
344
|
+ if(affiliate.getUserId().equals(loginUser.getUserId()) &&vo.getCaseStatusName().equals("待申请人签收")){
|
|
322
|
345
|
vo.setSignFlag(1);
|
|
323
|
346
|
}
|
|
324
|
347
|
|
|
325
|
348
|
}
|
|
326
|
349
|
if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
|
|
327
|
350
|
// 被申请人操作人
|
|
328
|
|
- if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
|
|
|
351
|
+ if(Objects.equals(affiliate.getUserId(), loginUser.getUserId()) &&!vo.getCaseStatusName().equals("待签名")){
|
|
329
|
352
|
vo.setResOperatorFlag(1);
|
|
330
|
353
|
}else if(vo.getCaseStatusName().equals("待签名")) {
|
|
331
|
|
- if(Objects.equals(affiliate.getUserId(), loginUserId)){
|
|
|
354
|
+ if(Objects.equals(affiliate.getUserId(), loginUser.getUserId())){
|
|
332
|
355
|
vo.setResOperatorFlag(1);
|
|
333
|
356
|
}else {
|
|
334
|
357
|
vo.setResOperatorFlag(0);
|
|
335
|
358
|
}
|
|
336
|
359
|
}
|
|
337
|
360
|
// 签收按钮权限
|
|
338
|
|
- if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待被申请人签收")){
|
|
|
361
|
+ if(affiliate.getUserId().equals(loginUser.getUserId()) &&vo.getCaseStatusName().equals("待被申请人签收")){
|
|
339
|
362
|
vo.setSignFlag(1);
|
|
340
|
363
|
}
|
|
341
|
364
|
}
|
|
|
@@ -402,7 +425,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
402
|
425
|
if(StrUtil.contains(role.getRoleName(),"财务")
|
|
403
|
426
|
||StrUtil.contains(role.getRoleName(),"法律顾问")
|
|
404
|
427
|
||StrUtil.contains(role.getRoleName(),"部门长")
|
|
405
|
|
- ||StrUtil.contains(role.getRoleName(),"调解员")
|
|
|
428
|
+// ||StrUtil.contains(role.getRoleName(),"调解员")
|
|
406
|
429
|
){
|
|
407
|
430
|
vo.setOtherFlag(1);
|
|
408
|
431
|
}
|
|
|
@@ -483,6 +506,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
483
|
506
|
// 查询案件列表
|
|
484
|
507
|
|
|
485
|
508
|
for (SysRole role : roles) {
|
|
|
509
|
+ if (StrUtil.isEmpty(role.getRoleName())) {
|
|
|
510
|
+ continue;
|
|
|
511
|
+ }
|
|
486
|
512
|
if(StrUtil.contains(role.getRoleName(),"财务")
|
|
487
|
513
|
||StrUtil.contains(role.getRoleName(),"法律顾问")
|
|
488
|
514
|
||StrUtil.contains(role.getRoleName(),"部门长")
|
|
|
@@ -491,14 +517,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
491
|
517
|
roleIds=null;
|
|
492
|
518
|
|
|
493
|
519
|
}
|
|
494
|
|
- if (StrUtil.isNotEmpty(role.getRoleName())) {
|
|
|
520
|
+
|
|
495
|
521
|
if (StrUtil.equals(role.getRoleName(), "调解员")) {
|
|
496
|
522
|
req.setMediatorId(String.valueOf(sysUser.getUserId()));
|
|
497
|
523
|
|
|
498
|
524
|
}
|
|
499
|
|
- }
|
|
|
525
|
+ if(StrUtil.contains(role.getRoleName(),"代理")) {
|
|
|
526
|
+ req.setCreateBy(String.valueOf(sysUser.getUserName()));
|
|
|
527
|
+ }
|
|
|
528
|
+
|
|
500
|
529
|
}
|
|
501
|
|
- // 如果多个角色中有财务,顾问,部门长,则调解员查询所有
|
|
|
530
|
+ // 如果多个角色中有财务,顾问,部门长查询所有
|
|
502
|
531
|
if(!isSelectAll){
|
|
503
|
532
|
req.setUserId(loginUser.getUserId());
|
|
504
|
533
|
}
|
|
|
@@ -2464,8 +2493,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2464
|
2493
|
}
|
|
2465
|
2494
|
application.setRejectReason(reason);
|
|
2466
|
2495
|
if(application.getCaseFlowId()!=null && application.getCaseFlowId()==4){
|
|
2467
|
|
- // todo 超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
|
|
2468
|
|
- // 申请人不受理分配通知 // todo 短信异步
|
|
|
2496
|
+ // 超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
|
|
|
2497
|
+ // 申请人不受理分配通知 // 短信异步
|
|
2469
|
2498
|
ExecutorService executor = ThreadUtil.createThreadPool();
|
|
2470
|
2499
|
CompletableFuture.runAsync(() -> {
|
|
2471
|
2500
|
String rejectReason = application.getRejectReason() == null ? "" : application.getRejectReason();
|
|
|
@@ -2588,6 +2617,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2588
|
2617
|
if (CollectionUtil.isEmpty(affiliates)) {
|
|
2589
|
2618
|
throw new ServiceException("未找到案件人员");
|
|
2590
|
2619
|
}
|
|
|
2620
|
+ // 签名时取用户为申请人角色并且是申请操作人
|
|
2591
|
2621
|
// 申请操作人
|
|
2592
|
2622
|
Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst();
|
|
2593
|
2623
|
// 被申请操作人
|