|
|
@@ -259,6 +259,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
259
|
259
|
if(CollectionUtil.isEmpty(list)){
|
|
260
|
260
|
return;
|
|
261
|
261
|
}
|
|
|
262
|
+ isMediatorRole=false;
|
|
262
|
263
|
// 查询申请人和被申请人
|
|
263
|
264
|
List<Long> caseIds = list.stream().map(MsCaseApplicationVO::getId).collect(Collectors.toList());
|
|
264
|
265
|
|
|
|
@@ -271,6 +272,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
271
|
272
|
}
|
|
272
|
273
|
|
|
273
|
274
|
for (MsCaseApplicationVO vo : list) {
|
|
|
275
|
+ if(vo.getMediatorId()!=null&&vo.getMediatorId()==loginUserId){
|
|
|
276
|
+ isMediatorRole=true;
|
|
|
277
|
+ }
|
|
274
|
278
|
// 设置申请人和被申请人
|
|
275
|
279
|
if(affiliateMap!=null && affiliateMap.containsKey(vo.getId())){
|
|
276
|
280
|
List<MsCaseAffiliate> affiliates = affiliateMap.get(vo.getId());
|
|
|
@@ -291,12 +295,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
291
|
295
|
|
|
292
|
296
|
}
|
|
293
|
297
|
}
|
|
294
|
|
- if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人")
|
|
295
|
|
- && affiliate.getRoleType()!=null && affiliate.getRoleType()==1){
|
|
296
|
|
- applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
|
|
|
298
|
+ if(vo.getOrganizeFlag()==null || vo.getOrganizeFlag()!=1) {
|
|
|
299
|
+ if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人")
|
|
|
300
|
+ && affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getName())) {
|
|
|
301
|
+ applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
|
|
|
302
|
+ }
|
|
|
303
|
+ }else {
|
|
|
304
|
+ // 组织机构
|
|
|
305
|
+ if ( affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getApplicantOrgName())) {
|
|
|
306
|
+ applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA);
|
|
|
307
|
+ }
|
|
297
|
308
|
}
|
|
298
|
309
|
if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人")
|
|
299
|
|
- && affiliate.getRoleType()!=null && affiliate.getRoleType()==3){
|
|
|
310
|
+ && affiliate.getRoleType()!=null && affiliate.getRoleType()==3&&StrUtil.isNotEmpty(affiliate.getName())){
|
|
300
|
311
|
respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
|
|
301
|
312
|
}
|
|
302
|
313
|
|
|
|
@@ -585,6 +596,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
585
|
596
|
if (caseApplication.getId() == null) {
|
|
586
|
597
|
caseApplication.setId(IdWorkerUtil.getId());
|
|
587
|
598
|
}
|
|
|
599
|
+ if(caseApplication.getOrganizeFlag()==null){
|
|
|
600
|
+ caseApplication.setOrganizeFlag(0);
|
|
|
601
|
+ }
|
|
588
|
602
|
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
589
|
603
|
caseApplication.setCaseFlowId(caseFlow.getId());
|
|
590
|
604
|
caseApplication.setCreateTime(new Date());
|
|
|
@@ -680,7 +694,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
680
|
694
|
*/
|
|
681
|
695
|
@Transactional
|
|
682
|
696
|
public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder) {
|
|
683
|
|
- if(affiliate==null || StrUtil.isEmpty(affiliate.getEmail()) || StrUtil.isEmpty(affiliate.getName())){
|
|
|
697
|
+ boolean b = caseApplication.getOrganizeFlag() != 1 && affiliate.getRoleType() == 1 && StrUtil.isEmpty(affiliate.getEmail());
|
|
|
698
|
+ if(affiliate==null ||b|| StrUtil.isEmpty(affiliate.getName())){
|
|
684
|
699
|
return;
|
|
685
|
700
|
}
|
|
686
|
701
|
affiliate.setGroupOrder(groupOrder);
|
|
|
@@ -739,6 +754,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
739
|
754
|
} else {
|
|
740
|
755
|
// 申请机构
|
|
741
|
756
|
if (affiliate.getRoleType() == 1) {
|
|
|
757
|
+ affiliate.setOperatorFlag(0);
|
|
742
|
758
|
// 申请人,从缓存中判断部门是否存在
|
|
743
|
759
|
Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
|
|
744
|
760
|
if (ObjectUtil.isEmpty(deptCache)) {
|
|
|
@@ -751,12 +767,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
751
|
767
|
dept.setStatus("0");
|
|
752
|
768
|
dept.setDelFlag("0");
|
|
753
|
769
|
dept.setCode(affiliate.getCode());
|
|
|
770
|
+ dept.setHome(affiliate.getHome());
|
|
|
771
|
+ dept.setAddress(affiliate.getAddress());
|
|
754
|
772
|
dept.setCompLegalPerson(affiliate.getCompLegalPerson());
|
|
755
|
773
|
dept.setCreateBy(getUsername());
|
|
756
|
|
- dept.setUpdateBy(getUsername());
|
|
|
774
|
+ dept.setCreateTime(new Date());
|
|
|
775
|
+ dept.setNationality(affiliate.getNationality());
|
|
757
|
776
|
sysDeptMapper.insertDept(dept);
|
|
758
|
777
|
// 更新缓存
|
|
759
|
778
|
redisCache.setCacheObject(CacheConstants.DEPT_KEY + dept.getDeptName(), dept.getDeptId());
|
|
|
779
|
+ }else {
|
|
|
780
|
+ // 更新部门
|
|
|
781
|
+ SysDept dept = new SysDept();
|
|
|
782
|
+ dept.setDeptId((Long) deptCache);
|
|
|
783
|
+ dept.setCode(affiliate.getCode());
|
|
|
784
|
+ dept.setCompLegalPerson(affiliate.getCompLegalPerson());
|
|
|
785
|
+ dept.setUpdateBy(getUsername());
|
|
|
786
|
+ dept.setUpdateTime(new Date());
|
|
|
787
|
+ dept.setNationality(affiliate.getNationality());
|
|
|
788
|
+ dept.setHome(affiliate.getHome());
|
|
|
789
|
+ dept.setAddress(affiliate.getAddress());
|
|
|
790
|
+ sysDeptMapper.updateDept(dept);
|
|
760
|
791
|
}
|
|
761
|
792
|
affiliate.setApplicantDeptId(redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName()));
|
|
762
|
793
|
} else {
|
|
|
@@ -779,13 +810,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
779
|
810
|
if(StrUtil.isEmpty(affiliate.getEmail())){
|
|
780
|
811
|
return;
|
|
781
|
812
|
}
|
|
782
|
|
- Object userEmailCache = redisCache.getCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail());
|
|
|
813
|
+ // Object userEmailCache = redisCache.getCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail());
|
|
783
|
814
|
SysUser user=null;
|
|
784
|
|
- if(ObjectUtil.isEmpty(userEmailCache)){
|
|
|
815
|
+ // if(ObjectUtil.isEmpty(userEmailCache)){
|
|
785
|
816
|
user = sysUserMapper.selectUserByUserName(affiliate.getEmail());
|
|
786
|
|
- }else {
|
|
787
|
|
- user=(SysUser)userEmailCache;
|
|
788
|
|
- }
|
|
|
817
|
+ // }else {
|
|
|
818
|
+ // user=(SysUser)userEmailCache;
|
|
|
819
|
+ // }
|
|
789
|
820
|
|
|
790
|
821
|
|
|
791
|
822
|
// 判断该用户是否存在
|
|
|
@@ -951,6 +982,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
951
|
982
|
if (msCaseAffiliateVO==null) {
|
|
952
|
983
|
return AjaxResult.error("案件相关人员未填写");
|
|
953
|
984
|
}
|
|
|
985
|
+ if(caseApplication.getOrganizeFlag()==null){
|
|
|
986
|
+ caseApplication.setOrganizeFlag(0);
|
|
|
987
|
+ }
|
|
954
|
988
|
// 计算仲裁费用
|
|
955
|
989
|
caseApplication.setCaseSubjectAmount(new BigDecimal("30000"));
|
|
956
|
990
|
setFeePayableMethod(caseApplication);
|
|
|
@@ -1507,7 +1541,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1507
|
1541
|
}
|
|
1508
|
1542
|
String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
|
|
1509
|
1543
|
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
|
1510
|
|
- MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(),AttachmentOperateTypeEnum.ADD);
|
|
|
1544
|
+ MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(),AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_METERIAL);
|
|
1511
|
1545
|
// 更新附件表
|
|
1512
|
1546
|
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
|
1513
|
1547
|
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
|
@@ -1905,7 +1939,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1905
|
1939
|
// selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
|
|
1906
|
1940
|
// }
|
|
1907
|
1941
|
for (MsCaseAffiliate affiliate : affiliates) {
|
|
1908
|
|
- if(affiliate.getUserId().equals(loginUser.getUser().getUserId())){
|
|
|
1942
|
+ if(affiliate.getUserId()!=null && affiliate.getUserId().equals(loginUser.getUser().getUserId())){
|
|
1909
|
1943
|
if( affiliate.getRoleType()==null){
|
|
1910
|
1944
|
continue;
|
|
1911
|
1945
|
}
|
|
|
@@ -1971,7 +2005,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1971
|
2005
|
return AjaxResult.error("未找到案件相关人员");
|
|
1972
|
2006
|
}
|
|
1973
|
2007
|
for (MsCaseAffiliate affiliate : affiliates) {
|
|
1974
|
|
- if(affiliate.getUserId().equals(user.getUserId())){
|
|
|
2008
|
+ if((affiliate.getUserId()!=null && affiliate.getUserId().equals(user.getUserId()))){
|
|
1975
|
2009
|
if( affiliate.getRoleType()==null){
|
|
1976
|
2010
|
continue;
|
|
1977
|
2011
|
}
|
|
|
@@ -2370,8 +2404,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2370
|
2404
|
public SysUser getUserInfo() {
|
|
2371
|
2405
|
SysUser sysUser =new SysUser();
|
|
2372
|
2406
|
|
|
2373
|
|
- if(StrUtil.isNotEmpty(SecurityUtils.getUsername())){
|
|
2374
|
|
- sysUser = sysUserMapper.selectUserByUserName(getUsername());
|
|
|
2407
|
+ if(SecurityUtils.getUserId()!=null){
|
|
|
2408
|
+ sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
|
|
2375
|
2409
|
|
|
2376
|
2410
|
}
|
|
2377
|
2411
|
return sysUser;
|
|
|
@@ -2671,7 +2705,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2671
|
2705
|
|
|
2672
|
2706
|
//发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
|
|
2673
|
2707
|
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
2674
|
|
- request.setTemplateId("2115975");
|
|
|
2708
|
+ request.setTemplateId("2116857");
|
|
2675
|
2709
|
// todo
|
|
2676
|
2710
|
// 申请人发送短信
|
|
2677
|
2711
|
request.setPhone(applicantAffiliateOpt.get().getPhone());
|
|
|
@@ -2698,7 +2732,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2698
|
2732
|
String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/") + 1);
|
|
2699
|
2733
|
|
|
2700
|
2734
|
SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
|
|
2701
|
|
- request1.setTemplateId("2115975");
|
|
|
2735
|
+ request1.setTemplateId("2116857");
|
|
2702
|
2736
|
request1.setPhone(resAffiliateOpt.get().getPhone());
|
|
2703
|
2737
|
request1.setTemplateParamSet(new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew});
|
|
2704
|
2738
|
Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
|
|
@@ -2722,7 +2756,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2722
|
2756
|
String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/") + 1);
|
|
2723
|
2757
|
|
|
2724
|
2758
|
SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
|
|
2725
|
|
- requestMedi.setTemplateId("2115975");
|
|
|
2759
|
+ requestMedi.setTemplateId("2116857");
|
|
2726
|
2760
|
requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
|
|
2727
|
2761
|
requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), application.getCaseNum(), urlResponnewMedi});
|
|
2728
|
2762
|
Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
|
|
|
@@ -3104,7 +3138,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3104
|
3138
|
for (MsCaseAttach msCaseAttach : msCaseAttaches) {
|
|
3105
|
3139
|
String templatePath = "/home/ruoyi" + msCaseAttach.getAnnexPath();
|
|
3106
|
3140
|
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
|
3107
|
|
- MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(),AttachmentOperateTypeEnum.ADD);
|
|
|
3141
|
+ MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(),AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
|
|
3108
|
3142
|
// 更新附件表
|
|
3109
|
3143
|
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
|
3110
|
3144
|
msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
|
@@ -3363,6 +3397,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3363
|
3397
|
.build();
|
|
3364
|
3398
|
|
|
3365
|
3399
|
}
|
|
|
3400
|
+ //保存到附件表里,先删除之前的在保存
|
|
|
3401
|
+ msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
|
|
3402
|
+ msCaseAttachMapper.save(caseAttach);
|
|
3366
|
3403
|
}
|
|
3367
|
3404
|
|
|
3368
|
3405
|
}else {
|
|
|
@@ -3372,12 +3409,32 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3372
|
3409
|
.annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
|
|
3373
|
3410
|
.annexType(annexType)
|
|
3374
|
3411
|
.build();
|
|
3375
|
|
- }
|
|
3376
|
|
- //保存到附件表里,先删除之前的在保存
|
|
3377
|
|
- if(caseAttach != null) {
|
|
3378
|
|
- msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
|
|
3412
|
+ // 查找已经存在的附件
|
|
|
3413
|
+ List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(application.getId(), annexType);
|
|
|
3414
|
+ if(CollectionUtil.isNotEmpty(existAttach)){
|
|
|
3415
|
+ // todo 对接北明,同步案件状态,删除
|
|
|
3416
|
+ for (MsCaseAttach msCaseAttach : existAttach) {
|
|
|
3417
|
+ if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
|
|
3418
|
+ continue;
|
|
|
3419
|
+ }
|
|
|
3420
|
+ beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
|
|
3421
|
+ }
|
|
|
3422
|
+ }
|
|
|
3423
|
+ msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
|
|
3424
|
+ if(StrUtil.isEmpty(application.getCaseSource())) {
|
|
|
3425
|
+ // 北明推送
|
|
|
3426
|
+ String path = "/home/ruoyi" + caseAttach.getAnnexPath();
|
|
|
3427
|
+ File file = new File(path.replace("/profile", "/uploadPath"));
|
|
|
3428
|
+ MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_APPLY_BOOK);
|
|
|
3429
|
+
|
|
|
3430
|
+ // 更新附件表
|
|
|
3431
|
+ if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
|
|
|
3432
|
+ caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
|
3433
|
+ }
|
|
|
3434
|
+ }
|
|
3379
|
3435
|
msCaseAttachMapper.save(caseAttach);
|
|
3380
|
3436
|
}
|
|
|
3437
|
+
|
|
3381
|
3438
|
}
|
|
3382
|
3439
|
|
|
3383
|
3440
|
/**
|