|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
5
|
5
|
import cn.hutool.core.util.StrUtil;
|
|
6
|
6
|
import cn.hutool.http.HttpRequest;
|
|
7
|
7
|
import cn.hutool.http.HttpResponse;
|
|
|
8
|
+import cn.hutool.http.HttpUtil;
|
|
8
|
9
|
import cn.hutool.json.JSONUtil;
|
|
9
|
10
|
import com.alibaba.fastjson.JSONArray;
|
|
10
|
11
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -47,7 +48,6 @@ import com.ruoyi.wisdomarbitrate.mapper.template.FatchRuleMapper;
|
|
47
|
48
|
import com.ruoyi.wisdomarbitrate.mapper.template.TemplateManageMapper;
|
|
48
|
49
|
import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
|
|
49
|
50
|
import com.ruoyi.wisdomarbitrate.utils.*;
|
|
50
|
|
-
|
|
51
|
51
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
|
52
|
52
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
53
|
53
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -92,6 +92,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
92
|
92
|
|
|
93
|
93
|
@Value("${arbitrateConfig.url}")
|
|
94
|
94
|
private String arbitrateUrl;
|
|
|
95
|
+ @Value("${onlyOfficeConfig.url}")
|
|
|
96
|
+ private String onlyOfficeUrl;
|
|
95
|
97
|
@Autowired
|
|
96
|
98
|
MsCaseApplicationService caseApplicationService;
|
|
97
|
99
|
@Autowired
|
|
|
@@ -158,22 +160,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
158
|
160
|
*/
|
|
159
|
161
|
@Override
|
|
160
|
162
|
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
|
|
161
|
|
- // admin查询所有案件
|
|
162
|
|
- if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
|
163
|
|
- startPage();
|
|
164
|
|
- List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
|
|
165
|
|
- for (MsCaseApplicationVO vo : list) {
|
|
166
|
|
- vo.setSignButtonFlag(0);
|
|
167
|
|
- }
|
|
168
|
|
- return list;
|
|
169
|
|
- }
|
|
|
163
|
+
|
|
170
|
164
|
// 根据用户查询角色
|
|
171
|
165
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
172
|
166
|
// 根据id查询用户
|
|
173
|
167
|
SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
|
|
174
|
168
|
List<SysRole> roles = loginUser.getUser().getRoles();
|
|
175
|
|
- if (CollectionUtil.isEmpty(roles)) {
|
|
176
|
|
- throw new ServiceException("该用户未指定角色");
|
|
|
169
|
+ if (StrUtil.equals(SecurityUtils.getUsername(), "admin")||CollectionUtil.isEmpty(roles)) {
|
|
|
170
|
+ // 如果角色为空,按admin处理,查所有案件
|
|
|
171
|
+ startPage();
|
|
|
172
|
+ List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
|
|
|
173
|
+ for (MsCaseApplicationVO vo : list) {
|
|
|
174
|
+ vo.setSignButtonFlag(0);
|
|
|
175
|
+ }
|
|
|
176
|
+ return list;
|
|
177
|
177
|
}
|
|
178
|
178
|
req.setUserName(SecurityUtils.getUsername());
|
|
179
|
179
|
req.setContactTelphoneAgent(sysUser.getPhonenumber());
|
|
|
@@ -353,10 +353,29 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
353
|
353
|
return vo;
|
|
354
|
354
|
}
|
|
355
|
355
|
|
|
|
356
|
+ /**
|
|
|
357
|
+ * 根据案件id或者案件编号查询详情
|
|
|
358
|
+ * @param id
|
|
|
359
|
+ * @param caseNum
|
|
|
360
|
+ * @param
|
|
|
361
|
+ * @return
|
|
|
362
|
+ */
|
|
356
|
363
|
@Override
|
|
357
|
|
- public MsCaseApplicationVO selectById(Long id) {
|
|
|
364
|
+ public MsCaseApplicationVO selectById(Long id,String caseNum ) {
|
|
|
365
|
+ // 根据案件id或者案件编号查询详情
|
|
358
|
366
|
MsCaseApplicationVO vo = new MsCaseApplicationVO();
|
|
359
|
|
- MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
|
|
367
|
+ MsCaseApplication caseApplication = null;
|
|
|
368
|
+ if(id!=null) {
|
|
|
369
|
+ caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
|
|
370
|
+ }else {
|
|
|
371
|
+ // 根据案件编号查
|
|
|
372
|
+ Example example = new Example(MsCaseApplication.class);
|
|
|
373
|
+ example.createCriteria().andEqualTo("caseNum", caseNum);
|
|
|
374
|
+ caseApplication = msCaseApplicationMapper.selectOneByExample(example);
|
|
|
375
|
+ }
|
|
|
376
|
+ if(caseApplication==null){
|
|
|
377
|
+ return vo;
|
|
|
378
|
+ }
|
|
360
|
379
|
BeanUtil.copyProperties(caseApplication, vo);
|
|
361
|
380
|
// 查询案件相关人员
|
|
362
|
381
|
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
|
|
|
@@ -369,6 +388,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
369
|
388
|
vo.setColumnValueList(columnValueVOS);
|
|
370
|
389
|
// 查询拒绝原因
|
|
371
|
390
|
vo.setReason(auditMapper.selectByCaseId(id,caseApplication.getCaseFlowId()));
|
|
|
391
|
+ // todo 在日志表查詢结束时间返回
|
|
|
392
|
+ vo.setEndTime(caseLogRecordMapper.selectEndTimeByCaseId(caseApplication.getId(),"结束"));
|
|
372
|
393
|
return vo;
|
|
373
|
394
|
}
|
|
374
|
395
|
|
|
|
@@ -380,21 +401,36 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
380
|
401
|
*/
|
|
381
|
402
|
@Transactional
|
|
382
|
403
|
@Override
|
|
383
|
|
- public int insert(MsCaseApplicationVO caseApplication) {
|
|
384
|
|
- if (caseApplication.getId() == null) {
|
|
385
|
|
- caseApplication.setId(IdWorkerUtil.getId());
|
|
386
|
|
- }
|
|
|
404
|
+ public String insert(MsCaseApplicationVO caseApplication) {
|
|
387
|
405
|
|
|
388
|
|
- // 根据角色获取案件流程
|
|
389
|
|
- List<MsCaseFlow> caseFlows= selectCaseFlows();
|
|
|
406
|
+
|
|
|
407
|
+ // todo 第三方调用该接口,未绑定角色,暂时不根据角色查询流程,根据角色获取案件流程
|
|
|
408
|
+ /** List<MsCaseFlow> caseFlows= selectCaseFlows();
|
|
390
|
409
|
if (CollectionUtil.isEmpty(caseFlows)) {
|
|
391
|
|
- throw new ServiceException("该角色为绑定案件流程");
|
|
|
410
|
+ throw new ServiceException("该角色未绑定案件流程");
|
|
392
|
411
|
}
|
|
|
412
|
+ */
|
|
393
|
413
|
// 设置模板id,根据机构代码查询模板
|
|
394
|
|
- Long templateId = templateManageMapper.selectByCreditCode(creditCode);
|
|
|
414
|
+ Long templateId = getTemplate();
|
|
395
|
415
|
caseApplication.setTemplateId(templateId);
|
|
|
416
|
+ // 获取第一个流程节点
|
|
|
417
|
+ MsCaseFlow caseFlow = getCaseFlow();
|
|
|
418
|
+ return insert(caseApplication,caseFlow);
|
|
396
|
419
|
|
|
397
|
|
- MsCaseFlow caseFlow = caseFlows.get(0);
|
|
|
420
|
+ }
|
|
|
421
|
+
|
|
|
422
|
+ /**
|
|
|
423
|
+ * 新增案件
|
|
|
424
|
+ * @param caseApplication
|
|
|
425
|
+ * @param caseFlow
|
|
|
426
|
+ * @return
|
|
|
427
|
+ */
|
|
|
428
|
+ @Transactional
|
|
|
429
|
+ @Override
|
|
|
430
|
+ public String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow) {
|
|
|
431
|
+ if (caseApplication.getId() == null) {
|
|
|
432
|
+ caseApplication.setId(IdWorkerUtil.getId());
|
|
|
433
|
+ }
|
|
398
|
434
|
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
399
|
435
|
caseApplication.setCaseFlowId(caseFlow.getId());
|
|
400
|
436
|
caseApplication.setCreateTime(new Date());
|
|
|
@@ -416,51 +452,51 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
416
|
452
|
if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
|
|
417
|
453
|
List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
|
418
|
454
|
// 保存案件相关人员
|
|
419
|
|
- // 设置申请机构
|
|
420
|
|
- if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
|
421
|
|
- // 组装申请机构
|
|
422
|
|
- // insertDept(affiliate);
|
|
423
|
|
- // 新增申请机构和代理人
|
|
424
|
|
- caseApplicationService.insertAgentUser(affiliate);
|
|
425
|
|
- }else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
|
426
|
|
- // 查询申请人角色id
|
|
427
|
|
- Long roleId = roleMapper.selectRoleIdByName("申请人");
|
|
428
|
|
- caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
|
429
|
|
- caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
|
|
455
|
+ // 设置申请机构
|
|
|
456
|
+ if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
|
|
|
457
|
+ // 组装申请机构
|
|
|
458
|
+ // insertDept(affiliate);
|
|
|
459
|
+ // 新增申请机构和代理人
|
|
|
460
|
+ caseApplicationService.insertAgentUser(affiliate);
|
|
|
461
|
+ }else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
|
|
|
462
|
+ // 查询申请人角色id
|
|
|
463
|
+ Long roleId = roleMapper.selectRoleIdByName("申请人");
|
|
|
464
|
+ caseApplicationService.insertApplicantUser(affiliate,false,roleId);
|
|
|
465
|
+ caseApplicationService.insertApplicantUser(affiliate,true,roleId);
|
|
430
|
466
|
|
|
431
|
467
|
|
|
432
|
|
- }
|
|
433
|
|
- // 压缩包导入,则根据身份证号获取性别和出生日期
|
|
434
|
|
- if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
|
|
435
|
|
- setBirthByIdentityNum(affiliate);
|
|
436
|
|
- }
|
|
437
|
|
- if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
|
438
|
|
- affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
|
439
|
|
- }
|
|
440
|
|
- if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
|
441
|
|
- affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
|
442
|
|
- }
|
|
443
|
|
- msCaseAffiliateMapper.insert(affiliate);
|
|
444
|
|
- // 批量生成调解申请书
|
|
445
|
|
- MsCaseApplicationReq req = new MsCaseApplicationReq();
|
|
446
|
|
- req.setCaseFlowId(caseFlow.getId());
|
|
447
|
|
- if(!caseApplication.isImportFlag()) {
|
|
448
|
|
- req.setId(caseApplication.getId());
|
|
449
|
|
- }else {
|
|
450
|
|
- // 压缩包导入
|
|
451
|
|
- req.setBatchNumber(caseApplication.getBatchNumber());
|
|
452
|
|
- }
|
|
453
|
|
- // 生成调解申请书
|
|
454
|
|
- if(affiliate.getOrganizeFlag()==0){
|
|
455
|
|
- // 自然人
|
|
456
|
|
- req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
|
|
457
|
|
- }else {
|
|
458
|
|
- // 机构
|
|
459
|
|
- req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
|
460
|
|
- }
|
|
461
|
|
- req.setTemplateId(String.valueOf(templateId));
|
|
462
|
|
-
|
|
463
|
|
- caseApplicationService.generateApplication(req);
|
|
|
468
|
+ }
|
|
|
469
|
+ // 压缩包导入,则根据身份证号获取性别和出生日期
|
|
|
470
|
+ if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
|
|
|
471
|
+ setBirthByIdentityNum(affiliate);
|
|
|
472
|
+ }
|
|
|
473
|
+ if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
|
|
|
474
|
+ affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
|
|
|
475
|
+ }
|
|
|
476
|
+ if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
|
|
|
477
|
+ affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
|
|
|
478
|
+ }
|
|
|
479
|
+ msCaseAffiliateMapper.insert(affiliate);
|
|
|
480
|
+ // 批量生成调解申请书
|
|
|
481
|
+ MsCaseApplicationReq req = new MsCaseApplicationReq();
|
|
|
482
|
+ req.setCaseFlowId(caseFlow.getId());
|
|
|
483
|
+ if(!caseApplication.isImportFlag()) {
|
|
|
484
|
+ req.setId(caseApplication.getId());
|
|
|
485
|
+ }else {
|
|
|
486
|
+ // 压缩包导入
|
|
|
487
|
+ req.setBatchNumber(caseApplication.getBatchNumber());
|
|
|
488
|
+ }
|
|
|
489
|
+ // 生成调解申请书
|
|
|
490
|
+ if(affiliate.getOrganizeFlag()==0){
|
|
|
491
|
+ // 自然人
|
|
|
492
|
+ req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
|
|
|
493
|
+ }else {
|
|
|
494
|
+ // 机构
|
|
|
495
|
+ req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
|
|
|
496
|
+ }
|
|
|
497
|
+ req.setTemplateId(String.valueOf(caseApplication.getTemplateId()));
|
|
|
498
|
+ // todo 部署放开
|
|
|
499
|
+ caseApplicationService.generateApplication(req);
|
|
464
|
500
|
// 保存案件附件
|
|
465
|
501
|
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
|
466
|
502
|
for (MsCaseAttach caseAttach : caseAttachList) {
|
|
|
@@ -482,10 +518,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
482
|
518
|
columnValueMapper.batchSave(columnValueList);
|
|
483
|
519
|
}
|
|
484
|
520
|
CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
|
|
485
|
|
- return 1;
|
|
|
521
|
+ return caseApplication.getCaseNum();
|
|
486
|
522
|
}
|
|
487
|
523
|
|
|
488
|
|
- return 0;
|
|
|
524
|
+ return "";
|
|
|
525
|
+ }
|
|
|
526
|
+
|
|
|
527
|
+ /**
|
|
|
528
|
+ * 获取第一个流程节点
|
|
|
529
|
+ * @return
|
|
|
530
|
+ */
|
|
|
531
|
+ private MsCaseFlow getCaseFlow() {
|
|
|
532
|
+
|
|
|
533
|
+ // 查询所有流程节点
|
|
|
534
|
+ Example flowExample = new Example(MsCaseFlow.class);
|
|
|
535
|
+ flowExample.setOrderByClause("sort asc");
|
|
|
536
|
+ List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
|
|
|
537
|
+ if (CollectionUtil.isEmpty(caseFlows)) {
|
|
|
538
|
+ throw new ServiceException("请先配置流程");
|
|
|
539
|
+ }
|
|
|
540
|
+ return caseFlows.get(0);
|
|
|
541
|
+ }
|
|
|
542
|
+
|
|
|
543
|
+ /**
|
|
|
544
|
+ * 获取模板id
|
|
|
545
|
+ * @return
|
|
|
546
|
+ */
|
|
|
547
|
+ private Long getTemplate() {
|
|
|
548
|
+
|
|
|
549
|
+ return templateManageMapper.selectByCreditCode(creditCode);
|
|
|
550
|
+ }
|
|
|
551
|
+
|
|
|
552
|
+ /**
|
|
|
553
|
+ * 批量新增
|
|
|
554
|
+ * @param vo
|
|
|
555
|
+ * @return
|
|
|
556
|
+ */
|
|
|
557
|
+ @Transactional
|
|
|
558
|
+ @Override
|
|
|
559
|
+ public AjaxResult batchInsert(MsCaseBatchInsertVO vo) {
|
|
|
560
|
+ if(CollectionUtil.isEmpty(vo.getList())){
|
|
|
561
|
+ return AjaxResult.error("案件不能为空");
|
|
|
562
|
+ }
|
|
|
563
|
+ // 设置模板id,根据机构代码查询模板
|
|
|
564
|
+ Long templateId = getTemplate();
|
|
|
565
|
+ // 获取第一个流程节点
|
|
|
566
|
+ MsCaseFlow caseFlow = getCaseFlow();
|
|
|
567
|
+ List<String> caseNumList = new ArrayList<>();
|
|
|
568
|
+ for (MsCaseApplicationVO caseApplicationVO : vo.getList()) {
|
|
|
569
|
+ caseApplicationVO.setTemplateId(templateId);
|
|
|
570
|
+ String caseNum = caseApplicationService.insert(caseApplicationVO, caseFlow);
|
|
|
571
|
+ caseNumList.add(caseNum);
|
|
|
572
|
+ }
|
|
|
573
|
+ AjaxResult success = AjaxResult.success();
|
|
|
574
|
+ success.put("caseNumList",caseNumList);
|
|
|
575
|
+ return success;
|
|
489
|
576
|
}
|
|
490
|
577
|
|
|
491
|
578
|
/**
|
|
|
@@ -518,6 +605,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
518
|
605
|
sysUser.setNickName(name);
|
|
519
|
606
|
sysUser.setPhonenumber(phone);
|
|
520
|
607
|
sysUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
|
|
608
|
+ sysUser.setIdType(affiliate.getIdType());
|
|
|
609
|
+ sysUser.setNationality(affiliate.getNationality());
|
|
521
|
610
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
|
522
|
611
|
userMapper.insertUser(sysUser);
|
|
523
|
612
|
userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
|
|
|
@@ -565,7 +654,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
565
|
654
|
example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
|
566
|
655
|
List<MsCaseFlowRoleRelated> caseFlowRoleRelatedList = caseFlowRoleRelatedMapper.selectByExample(example);
|
|
567
|
656
|
if (CollectionUtil.isEmpty(caseFlowRoleRelatedList)) {
|
|
568
|
|
- throw new ServiceException("该角色为绑定案件流程");
|
|
|
657
|
+ throw new ServiceException("该角色未绑定案件流程");
|
|
569
|
658
|
}
|
|
570
|
659
|
Example flowExample = new Example(MsCaseFlow.class);
|
|
571
|
660
|
flowExample.setOrderByClause("sort asc");
|
|
|
@@ -1461,7 +1550,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1461
|
1550
|
.annexType(annexType)
|
|
1462
|
1551
|
.useId(SecurityUtils.getUserId())
|
|
1463
|
1552
|
.useAccount(SecurityUtils.getUsername())
|
|
1464
|
|
- .isBatchUpload(1L)
|
|
1465
|
1553
|
.build();
|
|
1466
|
1554
|
int count = msCaseAttachMapper.save(caseAttach);
|
|
1467
|
1555
|
if (count > 0 ) {
|
|
|
@@ -1672,7 +1760,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1672
|
1760
|
if (CollectionUtil.isEmpty(users)) {
|
|
1673
|
1761
|
return AjaxResult.error("暂无调解员");
|
|
1674
|
1762
|
}
|
|
1675
|
|
- // todo 根据角色查询是否已经选择了调解员进行回显
|
|
|
1763
|
+ // 根据角色查询是否已经选择了调解员进行回显
|
|
1676
|
1764
|
List<Long> userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList());
|
|
1677
|
1765
|
// 状态为未结束的是待办数量,结束的是已办数量
|
|
1678
|
1766
|
Map<Long, List<MsCaseApplication>> caseMap=null;
|
|
|
@@ -1777,7 +1865,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1777
|
1865
|
// 申请人预约
|
|
1778
|
1866
|
if (vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
|
|
1779
|
1867
|
// 新增日志
|
|
1780
|
|
- CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人选择调解员");
|
|
|
1868
|
+ CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
|
|
1781
|
1869
|
|
|
1782
|
1870
|
if (StrUtil.isEmpty(msCaseAffiliate.getRespondentIdentityNum())) {
|
|
1783
|
1871
|
return AjaxResult.error("被申请人身份证为空");
|
|
|
@@ -1788,7 +1876,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1788
|
1876
|
} else {
|
|
1789
|
1877
|
// 被申请人预约
|
|
1790
|
1878
|
// 新增日志
|
|
1791
|
|
- CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
|
|
|
1879
|
+ CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
|
|
1792
|
1880
|
// 判断申请人是否预约
|
|
1793
|
1881
|
caseApplicationService. isReservation( vo,userIds);
|
|
1794
|
1882
|
|
|
|
@@ -2067,6 +2155,26 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2067
|
2155
|
public List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord) {
|
|
2068
|
2156
|
return smsRecordMapper.getSmsSendRecord(smsSendRecord);
|
|
2069
|
2157
|
}
|
|
|
2158
|
+ /**
|
|
|
2159
|
+ * 保存onlyOffice在线编辑的文件
|
|
|
2160
|
+ * @param
|
|
|
2161
|
+ * @return
|
|
|
2162
|
+ */
|
|
|
2163
|
+ @Transactional
|
|
|
2164
|
+ @Override
|
|
|
2165
|
+ public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) {
|
|
|
2166
|
+ if(StrUtil.isEmpty(caseAttach.getAnnexName())) {
|
|
|
2167
|
+ caseAttach.setAnnexName("调解书");
|
|
|
2168
|
+ }
|
|
|
2169
|
+ caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
|
2170
|
+ caseAttach.setUseId(getUserInfo().getUserId());
|
|
|
2171
|
+ caseAttach.setUseAccount(getUserInfo().getUserName());
|
|
|
2172
|
+ // 先删除之前的在新增
|
|
|
2173
|
+ msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType());
|
|
|
2174
|
+ msCaseAttachMapper.save(caseAttach);
|
|
|
2175
|
+
|
|
|
2176
|
+ return AjaxResult.success();
|
|
|
2177
|
+ }
|
|
2070
|
2178
|
|
|
2071
|
2179
|
/**
|
|
2072
|
2180
|
* 查询预约信息
|
|
|
@@ -2117,6 +2225,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2117
|
2225
|
if (currentFlow == null) {
|
|
2118
|
2226
|
throw new ServiceException("未找到当前流程节点");
|
|
2119
|
2227
|
}
|
|
|
2228
|
+ Integer mediaResult = req.getMediaResult();
|
|
2120
|
2229
|
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
|
|
2121
|
2230
|
if (application.getMediationMethod().equals("1")) {
|
|
2122
|
2231
|
// 线上调解
|
|
|
@@ -2129,18 +2238,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2129
|
2238
|
msCaseAttachMapper.updateCaseAttach(attach);
|
|
2130
|
2239
|
}
|
|
2131
|
2240
|
}
|
|
2132
|
|
- Integer mediaResult = req.getMediaResult();
|
|
2133
|
|
- if(mediaResult!=null){
|
|
2134
|
|
- if(mediaResult.intValue()==1){
|
|
|
2241
|
+ if(mediaResult ==1){
|
|
2135
|
2242
|
//达成调解
|
|
2136
|
2243
|
List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
|
|
2137
|
2244
|
if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
2138
|
2245
|
for (MsCaseAttach caseAttach : caseAttachList) {
|
|
2139
|
2246
|
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
|
2140
|
|
- String prefix = "/profile";
|
|
2141
|
|
- int startIndex = prefix.length();
|
|
|
2247
|
+ // String prefix = "/profile";
|
|
|
2248
|
+ // int startIndex = prefix.length();
|
|
2142
|
2249
|
String annexPath = caseAttach.getAnnexPath();
|
|
2143
|
|
- String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
|
|
2250
|
+ // String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
|
|
2251
|
+ String path = annexPath;
|
|
2144
|
2252
|
//获取文件上传地址
|
|
2145
|
2253
|
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
2146
|
2254
|
String body = response.getBody();
|
|
|
@@ -2485,11 +2593,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2485
|
2593
|
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
2486
|
2594
|
application.setCaseFlowId(caseFlow.getId());
|
|
2487
|
2595
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
|
2596
|
+ application.setMediaResult(mediaResult);
|
|
2488
|
2597
|
msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
2489
|
2598
|
}
|
|
2490
|
|
-
|
|
2491
|
|
- application.setMediaResult(mediaResult);
|
|
2492
|
|
- msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
2493
|
2599
|
return AjaxResult.success();
|
|
2494
|
2600
|
}else if(mediaResult.intValue()==3){
|
|
2495
|
2601
|
//未达成调解但不再争议
|
|
|
@@ -2500,14 +2606,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2500
|
2606
|
if(caseFlow != null){
|
|
2501
|
2607
|
application.setCaseFlowId(caseFlow.getId());
|
|
2502
|
2608
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
|
2609
|
+ application.setMediaResult(mediaResult);
|
|
2503
|
2610
|
msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
2504
|
2611
|
// 新增日志
|
|
2505
|
2612
|
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
2506
|
2613
|
|
|
2507
|
2614
|
}
|
|
2508
|
|
-
|
|
2509
|
|
- application.setMediaResult(mediaResult);
|
|
2510
|
|
- msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
2511
|
2615
|
return AjaxResult.success();
|
|
2512
|
2616
|
}else if(mediaResult.intValue()==4){
|
|
2513
|
2617
|
//未达成调解但同意引入仲裁
|
|
|
@@ -2532,6 +2636,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2532
|
2636
|
.header("signstr", signStr)
|
|
2533
|
2637
|
.body(paramsbody)
|
|
2534
|
2638
|
.execute();
|
|
|
2639
|
+ // 修改案件状态为结束
|
|
|
2640
|
+ Example flowExample = new Example(MsCaseFlow.class);
|
|
|
2641
|
+ flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
|
|
|
2642
|
+ MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
|
|
|
2643
|
+ if(caseFlow != null){
|
|
|
2644
|
+ // 新增日志
|
|
|
2645
|
+ CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
|
2646
|
+ application.setCaseFlowId(caseFlow.getId());
|
|
|
2647
|
+ application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
|
2648
|
+ application.setMediaResult(mediaResult);
|
|
|
2649
|
+ msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
|
2650
|
+ }
|
|
|
2651
|
+
|
|
2535
|
2652
|
return AjaxResult.success();
|
|
2536
|
2653
|
}else if(mediaResult.intValue()==5){
|
|
2537
|
2654
|
// 达成和解
|
|
|
@@ -2539,10 +2656,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2539
|
2656
|
if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
2540
|
2657
|
for (MsCaseAttach caseAttach : caseAttachList) {
|
|
2541
|
2658
|
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
|
2542
|
|
- String prefix = "/profile";
|
|
2543
|
|
- int startIndex = prefix.length();
|
|
|
2659
|
+ // String prefix = "/profile";
|
|
|
2660
|
+ // int startIndex = prefix.length();
|
|
2544
|
2661
|
String annexPath = caseAttach.getAnnexPath();
|
|
2545
|
|
- String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
|
|
2662
|
+// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
|
|
2663
|
+ String path = annexPath;
|
|
2546
|
2664
|
//获取文件上传地址
|
|
2547
|
2665
|
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
2548
|
2666
|
String body = response.getBody();
|
|
|
@@ -2779,7 +2897,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2779
|
2897
|
}
|
|
2780
|
2898
|
}
|
|
2781
|
2899
|
|
|
2782
|
|
- }
|
|
|
2900
|
+
|
|
2783
|
2901
|
} else {
|
|
2784
|
2902
|
// 线下调解
|
|
2785
|
2903
|
List<MsCaseAttach> attachList = req.getAttachList();
|
|
|
@@ -2792,14 +2910,45 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2792
|
2910
|
attach.setCaseAppliId(req.getId());
|
|
2793
|
2911
|
msCaseAttachMapper.updateCaseAttach(attach);
|
|
2794
|
2912
|
}
|
|
2795
|
|
- // msCaseAttachMapper.batchSave(attachList);
|
|
2796
|
2913
|
// 修改案件状态为待送达
|
|
2797
|
2914
|
Example flowExample = new Example(MsCaseFlow.class);
|
|
2798
|
|
- flowExample.createCriteria().andEqualTo("caseStatusName", "待送达");
|
|
|
2915
|
+ if(mediaResult ==1 || mediaResult == 5){
|
|
|
2916
|
+ // 达成调解,达成和解,案件状态改为待送达
|
|
|
2917
|
+ flowExample.createCriteria().andEqualTo("caseStatusName", "待送达");
|
|
|
2918
|
+ } else if(mediaResult == 2 || mediaResult == 3){
|
|
|
2919
|
+ // 未达成调解,未达成调解但不在争议改为结束状态
|
|
|
2920
|
+ flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
|
|
|
2921
|
+ }
|
|
|
2922
|
+ else if(mediaResult == 4){
|
|
|
2923
|
+ // 未达成调解但同意引入仲裁系统,改为结束状态,并调仲裁新增接口
|
|
|
2924
|
+ flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
|
|
|
2925
|
+ String accessSec = "mCFMA6ffe938v79m";
|
|
|
2926
|
+ MsCaseApplicationVO applicationVO = new MsCaseApplicationVO();
|
|
|
2927
|
+ BeanUtils.copyProperties(application,applicationVO);
|
|
|
2928
|
+
|
|
|
2929
|
+ CaseApplicationVO caseApplicationVO = new CaseApplicationVO();
|
|
|
2930
|
+ BeanUtils.copyProperties(applicationVO,caseApplicationVO);
|
|
|
2931
|
+ boolean importFlag = applicationVO.isImportFlag();
|
|
|
2932
|
+ if(importFlag==true){
|
|
|
2933
|
+ caseApplicationVO.setImportFlag(1);
|
|
|
2934
|
+ }else {
|
|
|
2935
|
+ caseApplicationVO.setImportFlag(0);
|
|
|
2936
|
+ }
|
|
|
2937
|
+ String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
|
|
|
2938
|
+ long timestamp = System.currentTimeMillis();
|
|
|
2939
|
+ String signStr = SignCheckUtils.getSign(paramsbody, accessSec, timestamp);
|
|
|
2940
|
+ String urlstr = arbitrateUrl;
|
|
|
2941
|
+ HttpResponse httpResponse = HttpRequest.post(urlstr)
|
|
|
2942
|
+ .header("timestampstr", String.valueOf(timestamp))
|
|
|
2943
|
+ .header("signstr", signStr)
|
|
|
2944
|
+ .body(paramsbody)
|
|
|
2945
|
+ .execute();
|
|
|
2946
|
+ }
|
|
2799
|
2947
|
MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
|
|
2800
|
2948
|
if(caseFlow != null){
|
|
2801
|
2949
|
application.setCaseFlowId(caseFlow.getId());
|
|
2802
|
2950
|
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
|
|
2951
|
+ application.setMediaResult(mediaResult);
|
|
2803
|
2952
|
msCaseApplicationMapper.updateByPrimaryKey(application);
|
|
2804
|
2953
|
// 新增日志
|
|
2805
|
2954
|
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
|
|
|
@@ -2808,7 +2957,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2808
|
2957
|
}
|
|
2809
|
2958
|
|
|
2810
|
2959
|
|
|
2811
|
|
- return AjaxResult.error();
|
|
|
2960
|
+ return AjaxResult.success();
|
|
2812
|
2961
|
}
|
|
2813
|
2962
|
|
|
2814
|
2963
|
/**
|
|
|
@@ -3633,15 +3782,68 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3633
|
3782
|
// 将word中的标签替换掉,生成新的word
|
|
3634
|
3783
|
wordChangeText(templatePath, bookmarkValueMap,saveFolderPath,resultFilePath);
|
|
3635
|
3784
|
|
|
3636
|
|
- MsCaseAttach caseAttach = MsCaseAttach.builder()
|
|
3637
|
|
- .caseAppliId(application.getId())
|
|
3638
|
|
- .annexName(orgFileName+".docx")
|
|
3639
|
|
- .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
|
|
3640
|
|
- .annexType(annexType)
|
|
3641
|
|
- .build();
|
|
|
3785
|
+ MsCaseAttach caseAttach = null;
|
|
|
3786
|
+ String annexPath=resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX);
|
|
|
3787
|
+ // 如果是调解书或者调解协议上传到onlyoffice服务器
|
|
|
3788
|
+ if(annexType != null && annexType.equals(AnnexTypeEnum.MEDIATE_BOOK.getCode())){
|
|
|
3789
|
+ JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,application.getId());
|
|
|
3790
|
+ if(jsonArray!=null && jsonArray.size() > 0){
|
|
|
3791
|
+ for (Object obj : jsonArray) {
|
|
|
3792
|
+ JSONObject jsonObject = (JSONObject) obj;
|
|
|
3793
|
+ caseAttach= MsCaseAttach.builder()
|
|
|
3794
|
+ .caseAppliId(application.getId())
|
|
|
3795
|
+ .annexName(jsonObject.getString("fileName"))
|
|
|
3796
|
+ .annexPath(jsonObject.getString("filePath"))
|
|
|
3797
|
+ .annexType(annexType)
|
|
|
3798
|
+ .onlyOfficeFileId(jsonObject.getString("fileId"))
|
|
|
3799
|
+ .build();
|
|
|
3800
|
+
|
|
|
3801
|
+ }
|
|
|
3802
|
+ }
|
|
|
3803
|
+
|
|
|
3804
|
+ }else {
|
|
|
3805
|
+ caseAttach = MsCaseAttach.builder()
|
|
|
3806
|
+ .caseAppliId(application.getId())
|
|
|
3807
|
+ .annexName(orgFileName+".docx")
|
|
|
3808
|
+ .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
|
|
|
3809
|
+ .annexType(annexType)
|
|
|
3810
|
+ .build();
|
|
|
3811
|
+ }
|
|
3642
|
3812
|
//保存到附件表里,先删除之前的在保存
|
|
3643
|
|
- msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
|
3644
|
|
- msCaseAttachMapper.save(caseAttach);
|
|
|
3813
|
+ if(caseAttach != null) {
|
|
|
3814
|
+ msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
|
|
3815
|
+ msCaseAttachMapper.save(caseAttach);
|
|
|
3816
|
+ }
|
|
|
3817
|
+ }
|
|
|
3818
|
+
|
|
|
3819
|
+ /**
|
|
|
3820
|
+ * 调解书上传到onlyoffice服务器
|
|
|
3821
|
+ * @param annexPath
|
|
|
3822
|
+ */
|
|
|
3823
|
+ @Override
|
|
|
3824
|
+ @Transactional
|
|
|
3825
|
+ public JSONArray uploadOnlyOffice(String annexPath,Long caseId) {
|
|
|
3826
|
+ annexPath=annexPath.replace("/profile","/home/ruoyi/uploadPath");
|
|
|
3827
|
+ File file = new File(annexPath);
|
|
|
3828
|
+ if (file.exists()) {
|
|
|
3829
|
+ // 调用onlyoffice
|
|
|
3830
|
+ try {
|
|
|
3831
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
3832
|
+ params.put("file", file);
|
|
|
3833
|
+ String postResult = HttpUtil.post(onlyOfficeUrl+ "/"+String.valueOf(caseId), params);
|
|
|
3834
|
+ if(StrUtil.isNotEmpty(postResult)){
|
|
|
3835
|
+ // 转为jsonArray
|
|
|
3836
|
+ JSONArray jsonArray = JSONArray.parseArray(postResult);
|
|
|
3837
|
+
|
|
|
3838
|
+ return jsonArray;
|
|
|
3839
|
+ }
|
|
|
3840
|
+ } catch (Exception e) {
|
|
|
3841
|
+ throw new ServiceException("上传OnlyOffice服务器失败");
|
|
|
3842
|
+ }
|
|
|
3843
|
+ }else {
|
|
|
3844
|
+ throw new ServiceException("文件不存在");
|
|
|
3845
|
+ }
|
|
|
3846
|
+ return null;
|
|
3645
|
3847
|
}
|
|
3646
|
3848
|
|
|
3647
|
3849
|
/**
|
|
|
@@ -3878,6 +4080,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3878
|
4080
|
agentUser.setNickName(affiliate.getNameAgent());
|
|
3879
|
4081
|
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
|
|
3880
|
4082
|
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
|
|
|
4083
|
+ agentUser.setNationality(affiliate.getNationality());
|
|
|
4084
|
+ agentUser.setIdType(affiliate.getIdType());
|
|
3881
|
4085
|
// agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
|
|
3882
|
4086
|
userMapper.insertUser(agentUser);
|
|
3883
|
4087
|
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
|