|
|
@@ -293,7 +293,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
293
|
293
|
}
|
|
294
|
294
|
|
|
295
|
295
|
for (MsCaseApplicationVO vo : list) {
|
|
296
|
|
- if(vo.getMediatorId()!=null&&vo.getMediatorId()==loginUserId){
|
|
|
296
|
+ if(vo.getMediatorId()!=null&&vo.getMediatorId().equals(loginUserId)){
|
|
297
|
297
|
isMediatorRole=true;
|
|
298
|
298
|
}
|
|
299
|
299
|
// 设置申请人和被申请人
|
|
|
@@ -317,7 +317,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
317
|
317
|
}
|
|
318
|
318
|
}
|
|
319
|
319
|
// 签收按钮权限
|
|
320
|
|
- if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
|
|
|
320
|
+ if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待申请人签收")){
|
|
321
|
321
|
vo.setSignFlag(1);
|
|
322
|
322
|
}
|
|
323
|
323
|
|
|
|
@@ -334,7 +334,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
334
|
334
|
}
|
|
335
|
335
|
}
|
|
336
|
336
|
// 签收按钮权限
|
|
337
|
|
- if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
|
|
|
337
|
+ if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待被申请人签收")){
|
|
338
|
338
|
vo.setSignFlag(1);
|
|
339
|
339
|
}
|
|
340
|
340
|
}
|
|
|
@@ -683,26 +683,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
683
|
683
|
// 保存案件基本信息
|
|
684
|
684
|
if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
|
|
685
|
685
|
List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
|
|
686
|
+ int appOperatorCount=0;
|
|
|
687
|
+ int resOperatorCount=0;
|
|
686
|
688
|
// 保存案件相关人员
|
|
687
|
689
|
List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
|
|
688
|
690
|
List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
|
|
689
|
691
|
if(CollectionUtil.isNotEmpty(applicant)){
|
|
690
|
692
|
for (int i = 0; i < applicant.size(); i++) {
|
|
691
|
693
|
// 申请人
|
|
692
|
|
- setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i);
|
|
|
694
|
+ appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
|
|
693
|
695
|
// 申请人代理人
|
|
694
|
|
- setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i);
|
|
|
696
|
+ appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
|
|
695
|
697
|
}
|
|
696
|
698
|
}
|
|
697
|
699
|
if(CollectionUtil.isNotEmpty(res)){
|
|
698
|
700
|
for (int i = 0; i < res.size(); i++) {
|
|
699
|
701
|
// 申请人
|
|
700
|
|
- setCaseAfflicate(caseApplication, res.get(i).getRes(),i);
|
|
|
702
|
+ resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
|
|
701
|
703
|
// 申请人代理人
|
|
702
|
|
- setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i);
|
|
|
704
|
+ resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
|
|
703
|
705
|
}
|
|
704
|
706
|
}
|
|
705
|
|
-
|
|
|
707
|
+ if (appOperatorCount < 1 && resOperatorCount < 1) {
|
|
|
708
|
+ throw new ServiceException("未设置申请操作人和被申请操作人");
|
|
|
709
|
+ } else if (appOperatorCount < 1) {
|
|
|
710
|
+ throw new ServiceException("未设置申请操作人");
|
|
|
711
|
+ } else if (resOperatorCount < 1) {
|
|
|
712
|
+ throw new ServiceException("未设置被申请操作人");
|
|
|
713
|
+ }
|
|
706
|
714
|
|
|
707
|
715
|
// 批量生成调解申请书
|
|
708
|
716
|
MsCaseApplicationReq req = new MsCaseApplicationReq();
|
|
|
@@ -753,13 +761,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
753
|
761
|
* @param affiliate
|
|
754
|
762
|
*/
|
|
755
|
763
|
@Transactional
|
|
756
|
|
- public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder) {
|
|
|
764
|
+ public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount) {
|
|
757
|
765
|
if(affiliate==null){
|
|
758
|
|
- return;
|
|
|
766
|
+ return operatorCount;
|
|
759
|
767
|
}
|
|
|
768
|
+
|
|
760
|
769
|
boolean b = affiliate.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1||affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail());
|
|
761
|
770
|
if(b|| StrUtil.isEmpty(affiliate.getName())){
|
|
762
|
|
- return;
|
|
|
771
|
+ return operatorCount;
|
|
763
|
772
|
}
|
|
764
|
773
|
affiliate.setGroupOrder(groupOrder);
|
|
765
|
774
|
// 获取角色缓存
|
|
|
@@ -858,6 +867,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
858
|
867
|
}
|
|
859
|
868
|
// 保存人员
|
|
860
|
869
|
msCaseAffiliateMapper.insert(affiliate);
|
|
|
870
|
+ if(affiliate.getOperatorFlag()!=null && affiliate.getOperatorFlag()==1){
|
|
|
871
|
+ operatorCount++;
|
|
|
872
|
+ }
|
|
|
873
|
+ return operatorCount;
|
|
861
|
874
|
}
|
|
862
|
875
|
|
|
863
|
876
|
/**
|
|
|
@@ -1048,27 +1061,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1048
|
1061
|
Example affliateExample = new Example(MsCaseAffiliate.class);
|
|
1049
|
1062
|
affliateExample.createCriteria().andEqualTo("caseAppliId", caseApplication.getId());
|
|
1050
|
1063
|
msCaseAffiliateMapper.deleteByExample(affliateExample);
|
|
1051
|
|
-
|
|
|
1064
|
+ int appOperatorCount=0;
|
|
|
1065
|
+ int resOperatorCount=0;
|
|
1052
|
1066
|
|
|
1053
|
1067
|
List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
|
|
1054
|
1068
|
List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
|
|
1055
|
1069
|
if(CollectionUtil.isNotEmpty(applicant)){
|
|
1056
|
1070
|
for (int i = 0; i < applicant.size(); i++) {
|
|
1057
|
1071
|
// 申请人
|
|
1058
|
|
- setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i);
|
|
|
1072
|
+ appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
|
|
1059
|
1073
|
// 申请人代理人
|
|
1060
|
|
- setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i);
|
|
|
1074
|
+ appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
|
|
1061
|
1075
|
}
|
|
1062
|
1076
|
}
|
|
1063
|
1077
|
if(CollectionUtil.isNotEmpty(res)){
|
|
1064
|
1078
|
for (int i = 0; i < res.size(); i++) {
|
|
1065
|
1079
|
// 申请人
|
|
1066
|
|
- setCaseAfflicate(caseApplication, res.get(i).getRes(),i);
|
|
|
1080
|
+ resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
|
|
1067
|
1081
|
// 申请人代理人
|
|
1068
|
|
- setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i);
|
|
|
1082
|
+ resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
|
|
1069
|
1083
|
}
|
|
1070
|
1084
|
}
|
|
1071
|
|
-
|
|
|
1085
|
+ if (appOperatorCount < 1 && resOperatorCount < 1) {
|
|
|
1086
|
+ throw new ServiceException("未设置申请操作人和被申请操作人");
|
|
|
1087
|
+ } else if (appOperatorCount < 1) {
|
|
|
1088
|
+ throw new ServiceException("未设置申请操作人");
|
|
|
1089
|
+ } else if (resOperatorCount < 1) {
|
|
|
1090
|
+ throw new ServiceException("未设置被申请操作人");
|
|
|
1091
|
+ }
|
|
1072
|
1092
|
if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
|
|
1073
|
1093
|
for (MsCaseAttach caseAttach : caseApplication.getCaseAttachList()) {
|
|
1074
|
1094
|
caseAttach.setCaseAppliId(caseApplication.getId());
|
|
|
@@ -2543,22 +2563,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2543
|
2563
|
if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
|
|
2544
|
2564
|
throw new ServiceException("未找到案件操作人员");
|
|
2545
|
2565
|
}
|
|
|
2566
|
+ // 更新附件
|
|
|
2567
|
+ List<MsCaseAttach> attachList = req.getAttachList();
|
|
|
2568
|
+ if (CollectionUtil.isNotEmpty(attachList)) {
|
|
|
2569
|
+ Map<Integer, List<MsCaseAttach>> annexTypeMap = attachList.stream().filter(attach -> attach.getAnnexType() != null).collect(Collectors.groupingBy(MsCaseAttach::getAnnexType));
|
|
|
2570
|
+ for (Map.Entry<Integer, List<MsCaseAttach>> entry : annexTypeMap.entrySet()) {
|
|
|
2571
|
+ if(entry.getKey()!=null && entry.getValue().size()>1){
|
|
|
2572
|
+ return AjaxResult.error("同一案件同一类型附件只能上传一个");
|
|
|
2573
|
+ }
|
|
|
2574
|
+ }
|
|
|
2575
|
+ // 先删除已存在的调解书
|
|
|
2576
|
+ List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndTypes(req.getId(), new ArrayList<>(annexTypeMap.keySet()));
|
|
|
2577
|
+ if (CollectionUtil.isNotEmpty(existAttach)) {
|
|
|
2578
|
+ // 对接北明,同步案件状态,删除
|
|
|
2579
|
+ for (MsCaseAttach msCaseAttach : existAttach) {
|
|
|
2580
|
+ if (StrUtil.isEmpty(msCaseAttach.getOtherSysFileId()) || StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
|
|
|
2581
|
+ continue;
|
|
|
2582
|
+ }
|
|
|
2583
|
+ beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
|
|
2584
|
+ }
|
|
|
2585
|
+ }
|
|
|
2586
|
+
|
|
|
2587
|
+ for (MsCaseAttach attach : attachList) {
|
|
|
2588
|
+ // 先删除已经存在的调解书
|
|
2546
|
2589
|
|
|
|
2590
|
+ attach.setCaseAppliId(req.getId());
|
|
|
2591
|
+ msCaseAttachMapper.updateCaseAttach(attach);
|
|
|
2592
|
+ }
|
|
|
2593
|
+ // 对接北明,调用上传附件接口
|
|
|
2594
|
+ List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
|
2595
|
+ if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
|
|
|
2596
|
+ for (MsCaseAttach msCaseAttach : msCaseAttaches) {
|
|
|
2597
|
+ if (StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
|
|
|
2598
|
+ continue;
|
|
|
2599
|
+ }
|
|
|
2600
|
+
|
|
|
2601
|
+ String replacePath = msCaseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
|
|
|
2602
|
+ File file = new File(replacePath);
|
|
|
2603
|
+ MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
|
|
|
2604
|
+ // 更新附件表
|
|
|
2605
|
+ if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
|
|
|
2606
|
+ msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
|
2607
|
+ msCaseAttachMapper.updateCaseAttach(msCaseAttach);
|
|
|
2608
|
+ }
|
|
|
2609
|
+
|
|
|
2610
|
+
|
|
|
2611
|
+ }
|
|
|
2612
|
+ }
|
|
|
2613
|
+ }
|
|
|
2614
|
+ // 线上调解
|
|
2547
|
2615
|
if (application.getMediationMethod().equals("1")) {
|
|
2548
|
2616
|
Integer mediaResult = application.getMediaResult();
|
|
2549
|
2617
|
if (mediaResult == null) {
|
|
2550
|
2618
|
return AjaxResult.error("请选择调解结果");
|
|
2551
|
2619
|
}
|
|
2552
|
|
- // 线上调解
|
|
2553
|
|
- List<MsCaseAttach> attachList = req.getAttachList();
|
|
2554
|
|
- if (CollectionUtil.isNotEmpty(attachList)) {
|
|
2555
|
|
- // 先删除已经存在的调解书
|
|
2556
|
|
- msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
2557
|
|
- for (MsCaseAttach attach : attachList) {
|
|
2558
|
|
- attach.setCaseAppliId(req.getId());
|
|
2559
|
|
- msCaseAttachMapper.updateCaseAttach(attach);
|
|
2560
|
|
- }
|
|
2561
|
|
- }
|
|
|
2620
|
+
|
|
2562
|
2621
|
if (mediaResult == 1) {
|
|
2563
|
2622
|
//达成调解
|
|
2564
|
2623
|
List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
|
|
|
@@ -3075,53 +3134,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3075
|
3134
|
}
|
|
3076
|
3135
|
}
|
|
3077
|
3136
|
} else {
|
|
|
3137
|
+ // 线下调解
|
|
3078
|
3138
|
Integer mediaResult=req.getMediaResult();
|
|
3079
|
3139
|
if(mediaResult==null){
|
|
3080
|
3140
|
return AjaxResult.error("请选择调解结果");
|
|
3081
|
3141
|
}
|
|
3082
|
|
- // 线下调解
|
|
3083
|
|
- List<MsCaseAttach> attachList = req.getAttachList();
|
|
3084
|
|
- if (CollectionUtil.isEmpty(attachList)) {
|
|
3085
|
|
- return AjaxResult.error("请上传调解资料");
|
|
3086
|
|
- }
|
|
3087
|
|
- // 先删除已经存在的调解书
|
|
3088
|
|
- if (StrUtil.isEmpty(application.getCaseSource())) {
|
|
3089
|
|
- List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
3090
|
|
- if (CollectionUtil.isNotEmpty(existAttach)) {
|
|
3091
|
|
- // 对接北明,同步案件状态,删除
|
|
3092
|
|
- for (MsCaseAttach msCaseAttach : existAttach) {
|
|
3093
|
|
- if (StrUtil.isEmpty(msCaseAttach.getOtherSysFileId()) || StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
|
|
3094
|
|
- continue;
|
|
3095
|
|
- }
|
|
3096
|
|
- beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
|
3097
|
|
- }
|
|
3098
|
|
- }
|
|
3099
|
|
- }
|
|
3100
|
|
- msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
3101
|
|
- for (MsCaseAttach attach : attachList) {
|
|
3102
|
|
- attach.setCaseAppliId(req.getId());
|
|
3103
|
|
- msCaseAttachMapper.updateCaseAttach(attach);
|
|
3104
|
|
- }
|
|
3105
|
|
- // 对接北明,调用上传附件接口
|
|
3106
|
|
- List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
3107
|
|
- if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
|
|
3108
|
|
- for (MsCaseAttach msCaseAttach : msCaseAttaches) {
|
|
3109
|
|
- if (StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
|
|
3110
|
|
- continue;
|
|
3111
|
|
- }
|
|
3112
|
|
-
|
|
3113
|
|
- String replacePath = msCaseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
|
|
3114
|
|
- File file = new File(replacePath);
|
|
3115
|
|
- MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
|
|
3116
|
|
- // 更新附件表
|
|
3117
|
|
- if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
|
|
3118
|
|
- msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
3119
|
|
- msCaseAttachMapper.updateCaseAttach(msCaseAttach);
|
|
3120
|
|
- }
|
|
3121
|
|
-
|
|
3122
|
|
-
|
|
3123
|
|
- }
|
|
3124
|
|
- }
|
|
3125
|
3142
|
// 修改案件状态为待送达
|
|
3126
|
3143
|
Example flowExample = new Example(MsCaseFlow.class);
|
|
3127
|
3144
|
if (mediaResult == 1 || mediaResult == 5) {
|