|
|
@@ -2561,7 +2561,89 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2561
|
2561
|
|
|
2562
|
2562
|
@Override
|
|
2563
|
2563
|
public List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication) {
|
|
2564
|
|
- List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
|
|
|
2564
|
+ // 获取登录用户
|
|
|
2565
|
+ LoginUser loginUser = getLoginUser();
|
|
|
2566
|
+ SysUser user = loginUser.getUser();
|
|
|
2567
|
+ Long userId = user.getUserId();
|
|
|
2568
|
+ SysUser sysUser = sysUserMapper.selectUserById(userId);
|
|
|
2569
|
+ List<SysRole> roles = sysUser.getRoles();
|
|
|
2570
|
+ // 没有角色不能查看案件列表
|
|
|
2571
|
+ if (CollectionUtil.isEmpty(roles)) {
|
|
|
2572
|
+ throw new ServiceException("该用户没有角色权限");
|
|
|
2573
|
+ }
|
|
|
2574
|
+ for (SysRole role : roles) {
|
|
|
2575
|
+ if (StrUtil.isEmpty(role.getRoleName())) {
|
|
|
2576
|
+ continue;
|
|
|
2577
|
+ }
|
|
|
2578
|
+ if ("超级管理员".equals(role.getRoleName())) {
|
|
|
2579
|
+ List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
|
|
|
2580
|
+ if(caseApplicationlist!=null&&caseApplicationlist.size()>0){
|
|
|
2581
|
+ for(CaseApplication caseApplicationselect : caseApplicationlist){
|
|
|
2582
|
+ Integer batchNumber = caseApplicationselect.getBatchNumber();
|
|
|
2583
|
+ CaseApplication caseApplicationsel = new CaseApplication();
|
|
|
2584
|
+ caseApplicationsel.setBatchNumber(batchNumber);
|
|
|
2585
|
+ List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
|
|
|
2586
|
+ if (caseApplications != null && caseApplications.size() > 0) {
|
|
|
2587
|
+ List<Integer> caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList());
|
|
|
2588
|
+ List<String> caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList());
|
|
|
2589
|
+ List<Integer> caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList());
|
|
|
2590
|
+ List<String> caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList());
|
|
|
2591
|
+ String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(","));
|
|
|
2592
|
+ String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(","));
|
|
|
2593
|
+ caseApplicationselect.setCaseStatusName(caseStatusName);
|
|
|
2594
|
+ caseApplicationselect.setCaseStatusstr(caseStatusstr);
|
|
|
2595
|
+ }
|
|
|
2596
|
+ }
|
|
|
2597
|
+ }
|
|
|
2598
|
+ return caseApplicationlist;
|
|
|
2599
|
+
|
|
|
2600
|
+ }
|
|
|
2601
|
+
|
|
|
2602
|
+ if ("仲裁委".equals(role.getRoleName())
|
|
|
2603
|
+ || "部门长".equals(role.getRoleName())) {
|
|
|
2604
|
+ List<Integer> caseStatusList = new ArrayList<>();
|
|
|
2605
|
+ caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
|
|
|
2606
|
+ caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
|
|
|
2607
|
+ // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
|
2608
|
+ caseApplication.setDeptHeadStatus(caseStatusList);
|
|
|
2609
|
+ caseApplication.setIsOtherRole(1);
|
|
|
2610
|
+ }
|
|
|
2611
|
+ if ("仲裁员".equals(role.getRoleName())) {
|
|
|
2612
|
+ caseApplication.setUserId(String.valueOf(userId));
|
|
|
2613
|
+ caseApplication.setIsOtherRole(1);
|
|
|
2614
|
+ }
|
|
|
2615
|
+ if ("财务".equals(role.getRoleName())) {
|
|
|
2616
|
+ caseApplication.setIsOtherRole(1);
|
|
|
2617
|
+ caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
|
|
2618
|
+ }
|
|
|
2619
|
+ if ("法律顾问".equals(role.getRoleName())) {
|
|
|
2620
|
+ // 秘书查看所有案件
|
|
|
2621
|
+ // 查询角色有关的用户部门
|
|
|
2622
|
+ List<Long> deptIds = new ArrayList<>();
|
|
|
2623
|
+ deptIds.add(sysUser.getDeptId());
|
|
|
2624
|
+ caseApplication.setDeptIds(deptIds);
|
|
|
2625
|
+ }
|
|
|
2626
|
+ if ("申请人".equals(role.getRoleName())) {
|
|
|
2627
|
+ // caseApplication.setIsOtherRole(1);
|
|
|
2628
|
+ // 查询有关的用户部门
|
|
|
2629
|
+ caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
|
2630
|
+ }
|
|
|
2631
|
+ if ("被申请人".equals(role.getRoleName())) {
|
|
|
2632
|
+ caseApplication.setIsOtherRole(1);
|
|
|
2633
|
+ //
|
|
|
2634
|
+ caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
|
|
|
2635
|
+ }
|
|
|
2636
|
+ if ("代理人".equals(role.getRoleName())) {
|
|
|
2637
|
+ caseApplication.setIsOtherRole(1);
|
|
|
2638
|
+ // 查询角色有关的用户部门
|
|
|
2639
|
+ // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
|
2640
|
+ List<Long> agentDeptIds = new ArrayList<>();
|
|
|
2641
|
+ agentDeptIds.add(sysUser.getDeptId());
|
|
|
2642
|
+ caseApplication.setAgentDeptIds(agentDeptIds);
|
|
|
2643
|
+ }
|
|
|
2644
|
+
|
|
|
2645
|
+ }
|
|
|
2646
|
+ List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch1(caseApplication);
|
|
2565
|
2647
|
if(caseApplicationlist!=null&&caseApplicationlist.size()>0){
|
|
2566
|
2648
|
for(CaseApplication caseApplicationselect : caseApplicationlist){
|
|
2567
|
2649
|
Integer batchNumber = caseApplicationselect.getBatchNumber();
|
|
|
@@ -2895,18 +2977,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2895
|
2977
|
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
|
|
2896
|
2978
|
} else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
|
|
2897
|
2979
|
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
|
|
2898
|
|
- ArbitrateRecord arbitrateRecordnew = caseApplicationse.getArbitrateRecord();
|
|
|
2980
|
+
|
|
|
2981
|
+ ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord();
|
|
|
2982
|
+ arbitrateRecordsel.setCaseAppliId(caseApplicationse.getId());
|
|
|
2983
|
+ ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel);
|
|
2899
|
2984
|
if(arbitrateRecordnew!=null){
|
|
2900
|
2985
|
arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
|
|
2901
|
2986
|
arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
|
|
2902
|
|
- arbitrateRecordnew.setCaseAppliId(caseApplicationse.getId());
|
|
2903
|
2987
|
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew);
|
|
2904
|
2988
|
}else {
|
|
2905
|
|
- ArbitrateRecord arbitrateRecordnew1 = new ArbitrateRecord();
|
|
2906
|
|
- arbitrateRecordnew1.setCheckOpinion(arbitrateRecord.getCheckOpinion());
|
|
2907
|
|
- arbitrateRecordnew1.setArbitrateReject(arbitrateRecord.getArbitrateReject());
|
|
2908
|
|
- arbitrateRecordnew1.setCaseAppliId(caseApplicationse.getId());
|
|
2909
|
|
- arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordnew1);
|
|
|
2989
|
+ arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
|
|
|
2990
|
+ arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
|
|
|
2991
|
+ arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel);
|
|
2910
|
2992
|
}
|
|
2911
|
2993
|
caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
|
2912
|
2994
|
|