|
|
@@ -35,10 +35,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
|
35
|
35
|
import com.ruoyi.wisdomarbitrate.domain.dto.template.FatchRule;
|
|
36
|
36
|
import com.ruoyi.wisdomarbitrate.domain.dto.template.TemplateManage;
|
|
37
|
37
|
import com.ruoyi.wisdomarbitrate.domain.entity.dept.MsSealSignRecord;
|
|
38
|
|
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
|
39
|
|
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
|
40
|
|
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
|
41
|
|
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseMediator;
|
|
|
38
|
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.*;
|
|
42
|
39
|
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
|
|
43
|
40
|
import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
|
|
44
|
41
|
import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
|
|
|
@@ -54,6 +51,7 @@ import org.apache.pdfbox.pdmodel.PDDocument;
|
|
54
|
51
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
55
|
52
|
import org.springframework.beans.BeanUtils;
|
|
56
|
53
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
54
|
+import org.springframework.beans.factory.annotation.Value;
|
|
57
|
55
|
import org.springframework.stereotype.Service;
|
|
58
|
56
|
import org.springframework.transaction.annotation.Transactional;
|
|
59
|
57
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
@@ -85,6 +83,11 @@ import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
85
|
83
|
*/
|
|
86
|
84
|
@Service
|
|
87
|
85
|
public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
|
86
|
+ /**
|
|
|
87
|
+ * 调解机构代码
|
|
|
88
|
+ */
|
|
|
89
|
+ @Value("${organizeConfig.creditCode}")
|
|
|
90
|
+ private long creditCode;
|
|
88
|
91
|
@Autowired
|
|
89
|
92
|
MsCaseApplicationService caseApplicationService;
|
|
90
|
93
|
@Autowired
|
|
|
@@ -177,12 +180,24 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
177
|
180
|
if (CollectionUtil.isEmpty(caseFlows)) {
|
|
178
|
181
|
throw new ServiceException("该角色为绑定案件流程");
|
|
179
|
182
|
}
|
|
180
|
|
- Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
|
|
|
183
|
+ // Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
|
|
181
|
184
|
List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
|
|
|
185
|
+ // 如果是申请人,可以看见申请人为自己(即自然人)或者委托代理人为自己的案件(即机构)
|
|
182
|
186
|
for (SysRole role : roles) {
|
|
183
|
187
|
if(StrUtil.isNotEmpty(role.getRoleName())){
|
|
184
|
188
|
if(StrUtil.equals(role.getRoleName(),"申请人")) {
|
|
|
189
|
+ List<Long> applicationOrganIds=new ArrayList<>();
|
|
|
190
|
+ applicationOrganIds.add(sysUser.getUserId());
|
|
185
|
191
|
caseStatusNames.add("待调解");
|
|
|
192
|
+ req.setApplicantFlag(1);
|
|
|
193
|
+ // 根据用户查询部门ids
|
|
|
194
|
+ List<SysDept> deptList = sysDeptMapper.selectDeptByUserId(loginUser.getUserId());
|
|
|
195
|
+ if(CollectionUtil.isNotEmpty(deptList)) {
|
|
|
196
|
+ List<Long> deptIds = deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList());
|
|
|
197
|
+ applicationOrganIds.addAll(deptIds);
|
|
|
198
|
+
|
|
|
199
|
+ }
|
|
|
200
|
+ req.setApplicationOrganIds(applicationOrganIds);
|
|
186
|
201
|
break;
|
|
187
|
202
|
}
|
|
188
|
203
|
if(StrUtil.equals(role.getRoleName(),"被申请人")){
|
|
|
@@ -232,11 +247,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
232
|
247
|
if (CollectionUtil.isEmpty(caseFlows)) {
|
|
233
|
248
|
throw new ServiceException("该角色为绑定案件流程");
|
|
234
|
249
|
}
|
|
|
250
|
+ // 设置模板id,根据机构代码查询模板
|
|
|
251
|
+ Long templateId = templateManageMapper.selectByCreditCode(creditCode);
|
|
|
252
|
+ caseApplication.setTemplateId(templateId);
|
|
|
253
|
+
|
|
235
|
254
|
MsCaseFlow caseFlow = caseFlows.get(0);
|
|
236
|
255
|
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
237
|
256
|
caseApplication.setCaseFlowId(caseFlow.getId());
|
|
238
|
257
|
caseApplication.setCreateTime(new Date());
|
|
239
|
|
- // 计算仲裁费用
|
|
|
258
|
+ // todo 暂时写死,费用300元
|
|
|
259
|
+ caseApplication.setCaseSubjectAmount(new BigDecimal("30000"));
|
|
240
|
260
|
setFeePayableMethod(caseApplication);
|
|
241
|
261
|
// 设置批号
|
|
242
|
262
|
if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
|
|
|
@@ -260,7 +280,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
260
|
280
|
// 新增申请机构和代理人
|
|
261
|
281
|
caseApplicationService.insertAgentUser(affiliate);
|
|
262
|
282
|
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
|
263
|
|
- // todo 申请人为自然人,如果系统不存在申请人和代理人用户,分别新增用户,新增完用户需要发送短信
|
|
264
|
283
|
// 查询申请人角色id
|
|
265
|
284
|
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
|
266
|
285
|
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
|
|
@@ -306,8 +325,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
306
|
325
|
req.setBatchNumber(caseApplication.getBatchNumber());
|
|
307
|
326
|
}
|
|
308
|
327
|
// 生成调解申请书
|
|
309
|
|
- req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
|
310
|
|
- // todo 部署放开
|
|
|
328
|
+ req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
|
|
329
|
+
|
|
311
|
330
|
caseApplicationService.generateApplication(req);
|
|
312
|
331
|
// 保存案件附件
|
|
313
|
332
|
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
|
|
@@ -329,7 +348,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
329
|
348
|
}
|
|
330
|
349
|
columnValueMapper.batchSave(columnValueList);
|
|
331
|
350
|
}
|
|
332
|
|
- // todo 发送短信
|
|
333
|
351
|
CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
|
|
334
|
352
|
return 1;
|
|
335
|
353
|
}
|
|
|
@@ -359,7 +377,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
359
|
377
|
}
|
|
360
|
378
|
if(StrUtil.isNotEmpty(phone) && StrUtil.isNotEmpty(name)){
|
|
361
|
379
|
// 查询用户是否存在
|
|
362
|
|
- SysUser sysUser = sysUserMapper.selectUserByUserName(name);
|
|
|
380
|
+ SysUser sysUser = sysUserMapper.selectUserByPhone(phone);
|
|
363
|
381
|
if(sysUser==null){
|
|
364
|
382
|
// 新增用户
|
|
365
|
383
|
sysUser = new SysUser();
|
|
|
@@ -446,6 +464,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
446
|
464
|
@Override
|
|
447
|
465
|
public AjaxResult update(MsCaseApplicationVO caseApplication) {
|
|
448
|
466
|
// 计算仲裁费用
|
|
|
467
|
+ caseApplication.setCaseSubjectAmount(new BigDecimal("30000"));
|
|
449
|
468
|
setFeePayableMethod(caseApplication);
|
|
450
|
469
|
caseApplication.setUpdateBy(SecurityUtils.getUsername());
|
|
451
|
470
|
caseApplication.setUpdateTime(new Date());
|
|
|
@@ -461,7 +480,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
461
|
480
|
// 新增申请机构代理人
|
|
462
|
481
|
caseApplicationService.insertAgentUser(affiliate);
|
|
463
|
482
|
}else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
|
464
|
|
- // todo 申请人为自然人,如果系统不存在申请人和代理人用户,分别新增用户,新增完用户需要发送短信
|
|
465
|
483
|
// 查询申请人角色id
|
|
466
|
484
|
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
|
467
|
485
|
caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
|
|
@@ -873,10 +891,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
873
|
891
|
MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
|
|
874
|
892
|
|
|
875
|
893
|
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
|
|
876
|
|
- String sendContent = "尊敬的" + affiliate.getNameAgent() + "用户,您的" + application.getCaseNum() + "仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信";
|
|
|
894
|
+ String sendContent = "尊敬的" + affiliate.getNameAgent() + "用户,您的" + application.getCaseNum() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信";
|
|
877
|
895
|
// 给申请人发送案件受理短信 尊敬的{1}用户,您的{2}仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信
|
|
878
|
|
- Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2049503", affiliate.getContactTelphoneAgent(), new String[]{affiliate.getNameAgent(), application.getCaseNum()});
|
|
879
|
|
- CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向申请人发送短信," + sendContent);
|
|
|
896
|
+ Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2073601", affiliate.getContactTelphoneAgent(), new String[]{affiliate.getNameAgent(), application.getCaseNum()});
|
|
|
897
|
+ // CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向申请人发送短信," + sendContent);
|
|
880
|
898
|
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getContactTelphoneAgent(), new Date(), sendContent);
|
|
881
|
899
|
if (smsFlag) {
|
|
882
|
900
|
// 发送成功
|
|
|
@@ -891,7 +909,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
891
|
909
|
String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件已经受理,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信";
|
|
892
|
910
|
// 给被申请人发送案件受理短信 2068468 待缴费通知 尊敬的用户,您编号为{1}的案件已经受理,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信
|
|
893
|
911
|
Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2068468", affiliate.getRespondentPhone(), new String[]{ application.getCaseNum()});
|
|
894
|
|
- CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向被申请人发送短信," + sendContent);
|
|
|
912
|
+ // CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向被申请人发送短信," + sendContent);
|
|
895
|
913
|
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getRespondentPhone(), new Date(), sendContent);
|
|
896
|
914
|
if (smsFlag) {
|
|
897
|
915
|
// 发送成功
|
|
|
@@ -918,17 +936,74 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
918
|
936
|
}
|
|
919
|
937
|
for (MsCaseApplication application : list) {
|
|
920
|
938
|
MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
|
921
|
|
- // todo 发送短信
|
|
922
|
|
-// CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
|
|
939
|
+
|
|
|
940
|
+ CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
|
923
|
941
|
}
|
|
924
|
942
|
}else {
|
|
925
|
943
|
MsCaseFlow caseFlow = caseApplicationService.nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
|
|
926
|
|
- // todo 发送短信
|
|
927
|
|
-// CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
|
|
944
|
+
|
|
|
945
|
+ CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
|
|
928
|
946
|
|
|
929
|
947
|
}
|
|
930
|
948
|
return AjaxResult.success("提交成功");
|
|
931
|
949
|
}
|
|
|
950
|
+ @Transactional
|
|
|
951
|
+ @Override
|
|
|
952
|
+ public AjaxResult delete(MsCaseApplication req) {
|
|
|
953
|
+ if(req.getCaseFlowId()>1){
|
|
|
954
|
+ return AjaxResult.error("已提交的案件无法删除!");
|
|
|
955
|
+ }
|
|
|
956
|
+
|
|
|
957
|
+ if(StrUtil.isNotEmpty(req.getBatchNumber())){
|
|
|
958
|
+ // 批量删除
|
|
|
959
|
+ List<MsCaseApplication> list = listByBatchNumber(req.getBatchNumber(), req.getCaseFlowId());
|
|
|
960
|
+ if(CollectionUtil.isEmpty(list)){
|
|
|
961
|
+ return AjaxResult.error("该批次号下未找到案件");
|
|
|
962
|
+ }
|
|
|
963
|
+ List<Long> ids = list.stream().map(MsCaseApplication::getId).collect(Collectors.toList());
|
|
|
964
|
+ // 删除主表
|
|
|
965
|
+ Example caseExample = new Example(MsCaseApplication.class);
|
|
|
966
|
+ Example.Criteria caseCriteria = caseExample.createCriteria();
|
|
|
967
|
+ caseCriteria.andIn("id", ids);
|
|
|
968
|
+ msCaseApplicationMapper.deleteByExample(caseExample);
|
|
|
969
|
+ // 删除相关人员表
|
|
|
970
|
+ Example affiliateExample = new Example(MsCaseAffiliate.class);
|
|
|
971
|
+ Example.Criteria affiliateCriteria = affiliateExample.createCriteria();
|
|
|
972
|
+ affiliateCriteria.andIn("caseAppliId", ids);
|
|
|
973
|
+ msCaseAffiliateMapper.deleteByExample(affiliateExample);
|
|
|
974
|
+ // 删除附件表
|
|
|
975
|
+ msCaseAttachMapper.batchDelete(ids);
|
|
|
976
|
+ // 删除预约调解员表
|
|
|
977
|
+ Example reservationExample = new Example(MsCaseMediator.class);
|
|
|
978
|
+ Example.Criteria reservationCriteria = reservationExample.createCriteria();
|
|
|
979
|
+ reservationCriteria.andIn("caseAppliId", ids);
|
|
|
980
|
+ msCaseMediatorMapper.deleteByExample(reservationExample);
|
|
|
981
|
+ // 删除日志表
|
|
|
982
|
+ Example caseLogExample = new Example(MsCaseLogRecord.class);
|
|
|
983
|
+ Example.Criteria caseLogCriteria = caseLogExample.createCriteria();
|
|
|
984
|
+ caseLogCriteria.andIn("caseAppliId", ids);
|
|
|
985
|
+ caseLogRecordMapper.deleteByExample(reservationExample);
|
|
|
986
|
+ }else {
|
|
|
987
|
+ // 删除主表
|
|
|
988
|
+ msCaseApplicationMapper.deleteByPrimaryKey(req.getId());
|
|
|
989
|
+ // 删除相关人员表
|
|
|
990
|
+ msCaseAffiliateMapper.deleteByPrimaryKey(req.getId());
|
|
|
991
|
+ // 删除附件表
|
|
|
992
|
+ msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(),null);
|
|
|
993
|
+ // 删除预约调解员表
|
|
|
994
|
+ Example reservationExample = new Example(MsCaseMediator.class);
|
|
|
995
|
+ Example.Criteria reservationCriteria = reservationExample.createCriteria();
|
|
|
996
|
+ reservationCriteria.andEqualTo("caseAppliId", req.getId());
|
|
|
997
|
+ msCaseMediatorMapper.deleteByExample(reservationExample);
|
|
|
998
|
+ // 删除日志表
|
|
|
999
|
+ Example caseLogExample = new Example(MsCaseLogRecord.class);
|
|
|
1000
|
+ Example.Criteria caseLogCriteria = caseLogExample.createCriteria();
|
|
|
1001
|
+ caseLogCriteria.andEqualTo("caseAppliId", req.getId());
|
|
|
1002
|
+ caseLogRecordMapper.deleteByExample(reservationExample);
|
|
|
1003
|
+
|
|
|
1004
|
+ }
|
|
|
1005
|
+ return AjaxResult.success("删除成功");
|
|
|
1006
|
+ }
|
|
932
|
1007
|
|
|
933
|
1008
|
/**
|
|
934
|
1009
|
* 查询调解员
|
|
|
@@ -1024,9 +1099,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1024
|
1099
|
// 被申请人预约
|
|
1025
|
1100
|
// 新增日志
|
|
1026
|
1101
|
CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
|
|
1027
|
|
- if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())|| StrUtil.isEmpty(msCaseAffiliate.getApplicationPhone())) {
|
|
1028
|
|
- return AjaxResult.error("申请代理人手机号为空");
|
|
1029
|
|
- }
|
|
|
1102
|
+// if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())|| StrUtil.isEmpty(msCaseAffiliate.getApplicationPhone())) {
|
|
|
1103
|
+// return AjaxResult.error("申请代理人手机号为空");
|
|
|
1104
|
+// }
|
|
1030
|
1105
|
// 判断申请人是否预约
|
|
1031
|
1106
|
caseApplicationService. isReservation( vo,userIds);
|
|
1032
|
1107
|
|
|
|
@@ -1115,7 +1190,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1115
|
1190
|
CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "被申请人选择调解员");
|
|
1116
|
1191
|
|
|
1117
|
1192
|
}
|
|
1118
|
|
- // todo 发送短信
|
|
|
1193
|
+
|
|
1119
|
1194
|
}
|
|
1120
|
1195
|
}
|
|
1121
|
1196
|
|
|
|
@@ -1207,7 +1282,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1207
|
1282
|
// 发送短信 2065809 案件不予受理通知 尊敬的用户,您编号为{1}的案件由于{2}所以不予受理,请知晓,如非本人操作,请忽略本短信。
|
|
1208
|
1283
|
Boolean smsFlag = SmsUtils.sendSms(id, "2065809", phone, new String[]{application.getCaseNum(),reason});
|
|
1209
|
1284
|
String sendContent = "尊敬的用户,您编号为" + application.getCaseNum() + "的案件由于"+reason+"所以不予受理,请知晓,如非本人操作,请忽略本短信。";
|
|
1210
|
|
- CaseLogUtils.insertCaseLog(application.getId(), application.getCaseFlowId(), application.getCaseStatusName(), sendContent);
|
|
|
1285
|
+ // CaseLogUtils.insertCaseLog(application.getId(), application.getCaseFlowId(), application.getCaseStatusName(), sendContent);
|
|
1211
|
1286
|
|
|
1212
|
1287
|
// 新增短信记录
|
|
1213
|
1288
|
SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), phone, new Date(), sendContent);
|
|
|
@@ -1229,6 +1304,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1229
|
1304
|
}
|
|
1230
|
1305
|
}
|
|
1231
|
1306
|
|
|
|
1307
|
+ @Override
|
|
|
1308
|
+ public SysUser getUserInfo() {
|
|
|
1309
|
+ SysUser sysUser =new SysUser();
|
|
|
1310
|
+
|
|
|
1311
|
+ if(StrUtil.isNotEmpty(SecurityUtils.getUsername())){
|
|
|
1312
|
+ sysUser = sysUserMapper.selectUserByUserName(getUsername());
|
|
|
1313
|
+
|
|
|
1314
|
+ }
|
|
|
1315
|
+ return sysUser;
|
|
|
1316
|
+ }
|
|
|
1317
|
+
|
|
1232
|
1318
|
/**
|
|
1233
|
1319
|
* 查询预约信息
|
|
1234
|
1320
|
* @param id
|
|
|
@@ -1252,7 +1338,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1252
|
1338
|
return AjaxResult.success(result);
|
|
1253
|
1339
|
}
|
|
1254
|
1340
|
Map<Integer, List<MsCaseMediator>> mediatorMap = msCaseMediators.stream().collect(Collectors.groupingBy(MsCaseMediator::getType));
|
|
1255
|
|
- // todo 申请人
|
|
1256
|
1341
|
result.setMediatorList(mediatorMap.get(MediatorTypeEnum.PC.getCode()));
|
|
1257
|
1342
|
result.setResMediatorList(mediatorMap.get(MediatorTypeEnum.MI_NI_PROGRESS.getCode()));
|
|
1258
|
1343
|
return AjaxResult.success(result);
|
|
|
@@ -1274,6 +1359,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1274
|
1359
|
if (StrUtil.isEmpty(application.getMediationMethod())) {
|
|
1275
|
1360
|
return AjaxResult.error("未选择调解方式");
|
|
1276
|
1361
|
}
|
|
|
1362
|
+ // 查询当前流程节点
|
|
|
1363
|
+ MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId());
|
|
|
1364
|
+ if (currentFlow == null) {
|
|
|
1365
|
+ throw new ServiceException("未找到当前流程节点");
|
|
|
1366
|
+ }
|
|
1277
|
1367
|
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
|
|
1278
|
1368
|
if (application.getMediationMethod().equals("1")) {
|
|
1279
|
1369
|
// 线上调解
|
|
|
@@ -1559,6 +1649,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1559
|
1649
|
if(caseFlow != null){
|
|
1560
|
1650
|
application.setCaseFlowId(caseFlow.getId());
|
|
1561
|
1651
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
|
1652
|
+ msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
|
1653
|
+ // 新增日志
|
|
|
1654
|
+ CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
1562
|
1655
|
}
|
|
1563
|
1656
|
|
|
1564
|
1657
|
application.setMediaResult(mediaResult);
|
|
|
@@ -1597,6 +1690,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1597
|
1690
|
flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
|
|
1598
|
1691
|
MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
|
|
1599
|
1692
|
if(caseFlow != null){
|
|
|
1693
|
+ // 新增日志
|
|
|
1694
|
+ CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
1600
|
1695
|
application.setCaseFlowId(caseFlow.getId());
|
|
1601
|
1696
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
1602
|
1697
|
msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
|
@@ -1615,6 +1710,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1615
|
1710
|
application.setCaseFlowId(caseFlow.getId());
|
|
1616
|
1711
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
1617
|
1712
|
msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
|
1713
|
+ // 新增日志
|
|
|
1714
|
+ CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
|
1715
|
+
|
|
1618
|
1716
|
}
|
|
1619
|
1717
|
|
|
1620
|
1718
|
application.setMediaResult(mediaResult);
|
|
|
@@ -1886,6 +1984,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1886
|
1984
|
application.setCaseFlowId(caseFlow.getId());
|
|
1887
|
1985
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
1888
|
1986
|
msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
|
1987
|
+ // 新增日志
|
|
|
1988
|
+ CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
1889
|
1989
|
}
|
|
1890
|
1990
|
return AjaxResult.success();
|
|
1891
|
1991
|
}
|