|
|
@@ -168,7 +168,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
168
|
168
|
throw new ServiceException("该用户未指定角色");
|
|
169
|
169
|
}
|
|
170
|
170
|
req.setUserName(SecurityUtils.getUsername());
|
|
171
|
|
-
|
|
|
171
|
+ req.setContactTelphoneAgent(sysUser.getPhonenumber());
|
|
172
|
172
|
// 根据角色查询关联的案件状态
|
|
173
|
173
|
Example example = new Example(MsCaseFlowRoleRelated.class);
|
|
174
|
174
|
example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
|
|
@@ -491,7 +491,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
491
|
491
|
// 为null则不更新
|
|
492
|
492
|
msCaseApplicationMapper.updateByPrimaryKeySelective(caseApplication);
|
|
493
|
493
|
MsCaseAffiliate affiliate = caseApplication.getAffiliate();
|
|
494
|
|
- if (affiliate != null) {
|
|
|
494
|
+ if (affiliate == null) {
|
|
|
495
|
+ return AjaxResult.error("案件相关人员未填写");
|
|
|
496
|
+ }
|
|
495
|
497
|
affiliate.setCaseAppliId(caseApplication.getId());
|
|
496
|
498
|
// 设置申请人
|
|
497
|
499
|
if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
|
|
@@ -510,7 +512,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
510
|
512
|
affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
|
511
|
513
|
}
|
|
512
|
514
|
msCaseAffiliateMapper.updateByPrimaryKeySelective(affiliate);
|
|
513
|
|
- }
|
|
|
515
|
+
|
|
514
|
516
|
if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
|
|
515
|
517
|
for (MsCaseAttach caseAttach : caseApplication.getCaseAttachList()) {
|
|
516
|
518
|
caseAttach.setCaseAppliId(caseApplication.getId());
|
|
|
@@ -521,14 +523,29 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
521
|
523
|
columnValueMapper.batchUpdate(caseApplication.getColumnValueList());
|
|
522
|
524
|
}
|
|
523
|
525
|
|
|
524
|
|
- Integer caseFlowId = caseApplication.getCaseFlowId();
|
|
525
|
|
- // 查询当前流程节点
|
|
526
|
|
- MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseFlowId);
|
|
527
|
|
- if (currentFlow == null) {
|
|
528
|
|
- throw new ServiceException("未找到当前流程节点");
|
|
|
526
|
+ // 生成调解申请书
|
|
|
527
|
+ // 根据角色获取案件流程
|
|
|
528
|
+ List<MsCaseFlow> caseFlows= selectCaseFlows();
|
|
|
529
|
+ if (CollectionUtil.isEmpty(caseFlows)) {
|
|
|
530
|
+ throw new ServiceException("该角色为绑定案件流程");
|
|
529
|
531
|
}
|
|
|
532
|
+ MsCaseFlow caseFlow = caseFlows.get(0);
|
|
|
533
|
+ MsCaseApplication selectByPrimaryKey = msCaseApplicationMapper.selectByPrimaryKey(caseApplication.getId());
|
|
|
534
|
+ MsCaseApplicationReq req = new MsCaseApplicationReq();
|
|
|
535
|
+ req.setCaseFlowId(caseFlow.getId());
|
|
|
536
|
+ req.setId(caseApplication.getId());
|
|
|
537
|
+ if(affiliate.getOrganizeFlag()==0){
|
|
|
538
|
+ // 自然人
|
|
|
539
|
+ req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
|
|
|
540
|
+ }else {
|
|
|
541
|
+ // 机构
|
|
|
542
|
+ req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
|
|
543
|
+ }
|
|
|
544
|
+ req.setTemplateId(String.valueOf(selectByPrimaryKey.getTemplateId()));
|
|
|
545
|
+
|
|
|
546
|
+ caseApplicationService.generateApplication(req);
|
|
530
|
547
|
// 新增日志
|
|
531
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"修改案件");
|
|
|
548
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "修改案件",null);
|
|
532
|
549
|
|
|
533
|
550
|
return AjaxResult.success("修改成功");
|
|
534
|
551
|
}
|
|
|
@@ -937,14 +954,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
937
|
954
|
}
|
|
938
|
955
|
for (MsCaseApplication application : list) {
|
|
939
|
956
|
MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
|
940
|
|
-
|
|
941
|
|
- CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
|
942
|
957
|
}
|
|
943
|
958
|
}else {
|
|
944
|
959
|
MsCaseFlow caseFlow = caseApplicationService.nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
|
945
|
960
|
|
|
946
|
|
- CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
|
947
|
|
-
|
|
948
|
961
|
}
|
|
949
|
962
|
return AjaxResult.success("提交成功");
|
|
950
|
963
|
}
|
|
|
@@ -1105,15 +1118,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1105
|
1118
|
return AjaxResult.error("被申请人身份证为空");
|
|
1106
|
1119
|
}
|
|
1107
|
1120
|
// 判断被申请人信息查询案件预约表
|
|
1108
|
|
- isReservation( vo,userIds);
|
|
|
1121
|
+ caseApplicationService. isReservation( vo,userIds);
|
|
1109
|
1122
|
|
|
1110
|
1123
|
} else {
|
|
1111
|
1124
|
// 被申请人预约
|
|
1112
|
1125
|
// 新增日志
|
|
1113
|
1126
|
CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
|
|
1114
|
|
-// if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())|| StrUtil.isEmpty(msCaseAffiliate.getApplicationPhone())) {
|
|
1115
|
|
-// return AjaxResult.error("申请代理人手机号为空");
|
|
1116
|
|
-// }
|
|
1117
|
1127
|
// 判断申请人是否预约
|
|
1118
|
1128
|
caseApplicationService. isReservation( vo,userIds);
|
|
1119
|
1129
|
|
|
|
@@ -1194,13 +1204,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1194
|
1204
|
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
1195
|
1205
|
application.setLockStatus(null);
|
|
1196
|
1206
|
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
1197
|
|
- // 新增日志
|
|
1198
|
|
-// if(vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
|
|
1199
|
|
-// CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "申请人选择调解员");
|
|
1200
|
|
-// }else {
|
|
1201
|
|
-// CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "被申请人选择调解员");
|
|
1202
|
|
-//
|
|
1203
|
|
-// }
|
|
1204
|
1207
|
|
|
1205
|
1208
|
}
|
|
1206
|
1209
|
}
|
|
|
@@ -1221,12 +1224,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1221
|
1224
|
return AjaxResult.error("该批次号下未找到案件");
|
|
1222
|
1225
|
}
|
|
1223
|
1226
|
for (MsCaseApplication application : list) {
|
|
1224
|
|
- verifyMediator(application,vo);
|
|
|
1227
|
+ caseApplicationService.verifyMediator(application,vo);
|
|
1225
|
1228
|
}
|
|
1226
|
1229
|
}else {
|
|
1227
|
1230
|
MsCaseApplication application = new MsCaseApplication();
|
|
1228
|
1231
|
application.setId(vo.getId());
|
|
1229
|
|
- verifyMediator(application,vo);
|
|
|
1232
|
+ caseApplicationService.verifyMediator(application,vo);
|
|
1230
|
1233
|
}
|
|
1231
|
1234
|
return AjaxResult.success();
|
|
1232
|
1235
|
}
|
|
|
@@ -1271,19 +1274,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1271
|
1274
|
}else {
|
|
1272
|
1275
|
phone=affiliate.getContactTelphoneAgent();
|
|
1273
|
1276
|
}
|
|
1274
|
|
-
|
|
|
1277
|
+ caseApplication.setHearDate(application.getHearDate());
|
|
1275
|
1278
|
// 申请人发送开庭日期短信
|
|
1276
|
|
- sendHearDateSms(application,phone);
|
|
|
1279
|
+ sendHearDateSms(caseApplication,phone);
|
|
1277
|
1280
|
// 被申发送开庭日期短信
|
|
1278
|
|
- sendHearDateSms(application,affiliate.getRespondentPhone());
|
|
|
1281
|
+ sendHearDateSms(caseApplication,affiliate.getRespondentPhone());
|
|
1279
|
1282
|
// 调解员发送短信
|
|
1280
|
1283
|
// 根据调解员id查询用户
|
|
1281
|
|
- if(application.getMediatorId()!=null) {
|
|
1282
|
|
- SysUser sysUser = sysUserMapper.selectUserById(application.getMediatorId());
|
|
1283
|
|
- sendHearDateSms(application, sysUser.getPhonenumber());
|
|
|
1284
|
+ if(caseApplication.getMediatorId()!=null) {
|
|
|
1285
|
+ SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
|
|
|
1286
|
+ sendHearDateSms(caseApplication, sysUser.getPhonenumber());
|
|
1284
|
1287
|
}
|
|
1285
|
1288
|
// 新增日志
|
|
1286
|
|
- CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
|
|
|
1289
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
|
|
1287
|
1290
|
|
|
1288
|
1291
|
}
|
|
1289
|
1292
|
|
|
|
@@ -1319,6 +1322,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1319
|
1322
|
if(StrUtil.isEmpty(caseId)){
|
|
1320
|
1323
|
return;
|
|
1321
|
1324
|
}
|
|
|
1325
|
+ // todo
|
|
1322
|
1326
|
Long id = Long.valueOf(caseId);
|
|
1323
|
1327
|
// 根据案件id查询案件
|
|
1324
|
1328
|
MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(id);
|
|
|
@@ -2082,7 +2086,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2082
|
2086
|
req.setTemplateType(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode());
|
|
2083
|
2087
|
|
|
2084
|
2088
|
}
|
|
2085
|
|
- AjaxResult result = generateApplication(req);
|
|
|
2089
|
+ AjaxResult result = caseApplicationService.generateApplication(req);
|
|
2086
|
2090
|
return AjaxResult.success();
|
|
2087
|
2091
|
}
|
|
2088
|
2092
|
|
|
|
@@ -2854,13 +2858,22 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2854
|
2858
|
|
|
2855
|
2859
|
String month = String.format("%02d", now.getMonthValue());
|
|
2856
|
2860
|
String day = String.format("%02d", now.getDayOfMonth());
|
|
2857
|
|
- // todo
|
|
2858
|
2861
|
String saveFolderPath = RuoYiConfig.getUploadPath()+"/"+ year + "/" + month + "/" + day;
|
|
2859
|
|
- Integer annexType = AnnexTypeEnum.MEDIATION_APPLICATION.getCode();
|
|
|
2862
|
+ Integer annexType = null;
|
|
|
2863
|
+ if(templateType==null
|
|
|
2864
|
+ || templateType.equals(TemplateTypeEnum.MEDIATION_APPLICATION.getCode())
|
|
|
2865
|
+ || templateType.equals(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode()) ){
|
|
|
2866
|
+ // 调解申请书
|
|
|
2867
|
+ annexType = AnnexTypeEnum.MEDIATION_APPLICATION.getCode();
|
|
|
2868
|
+ }else if(templateType.equals(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode())
|
|
|
2869
|
+ || templateType.equals(TemplateTypeEnum.MEDIATE_BOOK.getCode()) ){
|
|
|
2870
|
+ // 调解书和解协议
|
|
|
2871
|
+ annexType = AnnexTypeEnum.MEDIATE_BOOK.getCode();
|
|
|
2872
|
+ }
|
|
|
2873
|
+
|
|
2860
|
2874
|
String orgFileName = "调解申请书";
|
|
2861
|
|
- if(templateType!=null&&templateType==3) {
|
|
|
2875
|
+ if (annexType != null && annexType.equals(AnnexTypeEnum.MEDIATE_BOOK.getCode())) {
|
|
2862
|
2876
|
orgFileName = "调解书";
|
|
2863
|
|
- annexType=AnnexTypeEnum.MEDIATE_BOOK.getCode();
|
|
2864
|
2877
|
}
|
|
2865
|
2878
|
String fileName = UUID.randomUUID().toString().replace("-", "")+orgFileName + ".docx";
|
|
2866
|
2879
|
String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
@@ -2874,10 +2887,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2874
|
2887
|
.annexType(annexType)
|
|
2875
|
2888
|
.build();
|
|
2876
|
2889
|
//保存到附件表里,先删除之前的在保存
|
|
2877
|
|
- msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), AnnexTypeEnum.MEDIATION_APPLICATION.getCode());
|
|
2878
|
|
- if (templateType!=null&&templateType==3) {
|
|
2879
|
|
- msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
2880
|
|
- }
|
|
|
2890
|
+ msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
|
2881
|
2891
|
msCaseAttachMapper.save(caseAttach);
|
|
2882
|
2892
|
}
|
|
2883
|
2893
|
|