|
|
@@ -150,7 +150,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
150
|
150
|
}
|
|
151
|
151
|
// 根据用户查询角色
|
|
152
|
152
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
153
|
|
- List<SysRole> roles = loginUser.getUser().getRoles();
|
|
|
153
|
+ SysUser sysUser = loginUser.getUser();
|
|
|
154
|
+ List<SysRole> roles = sysUser.getRoles();
|
|
154
|
155
|
if (CollectionUtil.isEmpty(roles)) {
|
|
155
|
156
|
throw new ServiceException("该用户未指定角色");
|
|
156
|
157
|
}
|
|
|
@@ -169,6 +170,18 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
169
|
170
|
if (CollectionUtil.isEmpty(caseFlows)) {
|
|
170
|
171
|
throw new ServiceException("该角色为绑定案件流程");
|
|
171
|
172
|
}
|
|
|
173
|
+ for (SysRole role : roles) {
|
|
|
174
|
+ if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){
|
|
|
175
|
+ if(loginUser.getDeptId()!=null) {
|
|
|
176
|
+ req.setApplicationOrganId(String.valueOf(loginUser.getDeptId()));
|
|
|
177
|
+ }
|
|
|
178
|
+ req.setApplicantFlag(1);
|
|
|
179
|
+ }
|
|
|
180
|
+ if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"被申请人")){
|
|
|
181
|
+ // todo 被申请人案件根据被申请人身份证号查询案件列表
|
|
|
182
|
+ req.setRespondentIdentityNum(sysUser.getIdCard());
|
|
|
183
|
+ }
|
|
|
184
|
+ }
|
|
172
|
185
|
startPage();
|
|
173
|
186
|
// 查询案件列表
|
|
174
|
187
|
List<MsCaseApplicationVO> caseApplicationList = msCaseApplicationMapper.list(req, caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList()));
|
|
|
@@ -264,7 +277,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
264
|
277
|
}
|
|
265
|
278
|
affiliate.setCaseAppliId(caseApplication.getId());
|
|
266
|
279
|
msCaseAffiliateMapper.insert(affiliate);
|
|
267
|
|
- // 生成调解申请书
|
|
268
|
280
|
// 查询调解申请书模板id
|
|
269
|
281
|
TemplateManage templateManage=templateManageMapper.selectByType(2);
|
|
270
|
282
|
if(templateManage!=null) {
|
|
|
@@ -277,6 +289,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
277
|
289
|
// 压缩包导入
|
|
278
|
290
|
req.setBatchNumber(caseApplication.getBatchNumber());
|
|
279
|
291
|
}
|
|
|
292
|
+ // 生成调解申请书
|
|
280
|
293
|
req.setTemplateId(String.valueOf(templateManage.getId()));
|
|
281
|
294
|
generateApplication(req);
|
|
282
|
295
|
|
|
|
@@ -589,7 +602,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
589
|
602
|
List<Long> caseIds = caseApplicationList.stream().map(MsCaseApplication::getId).collect(Collectors.toList());
|
|
590
|
603
|
// 根据ids查询案件关联人员
|
|
591
|
604
|
Example afflicateExample = new Example(MsCaseAffiliate.class);
|
|
592
|
|
- afflicateExample.createCriteria().andIn("case_appli_id", caseIds);
|
|
|
605
|
+ afflicateExample.createCriteria().andIn("caseAppliId", caseIds);
|
|
593
|
606
|
List<MsCaseAffiliate> affiliateList = msCaseAffiliateMapper.selectByExample(afflicateExample);
|
|
594
|
607
|
if(CollectionUtil.isEmpty(affiliateList)){
|
|
595
|
608
|
throw new ServiceException("该批次号下未找到案件关联人员");
|
|
|
@@ -712,7 +725,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
712
|
725
|
}
|
|
713
|
726
|
// 查询案件关联人员
|
|
714
|
727
|
Example example = new Example(MsCaseAffiliate.class);
|
|
715
|
|
- example.createCriteria().andIn("case_appli_id", applicationList.stream().map(MsCaseApplication::getId).collect(Collectors.toList()));
|
|
|
728
|
+ example.createCriteria().andIn("caseAppliId", applicationList.stream().map(MsCaseApplication::getId).collect(Collectors.toList()));
|
|
716
|
729
|
List<MsCaseAffiliate> affiliateList = msCaseAffiliateMapper.selectByExample(example);
|
|
717
|
730
|
if (CollectionUtil.isEmpty(affiliateList)) {
|
|
718
|
731
|
return AjaxResult.error("该批次号下未找到案件");
|
|
|
@@ -841,10 +854,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
841
|
854
|
// 查询日志中是否有该节点的被申请人操作
|
|
842
|
855
|
Example example = new Example(MsCaseLogRecord.class);
|
|
843
|
856
|
Example.Criteria criteria = example.createCriteria();
|
|
844
|
|
- criteria.andEqualTo("case_appli_id", vo.getId());
|
|
845
|
|
- criteria.andEqualTo("case_node", nextFlow.getNodeId());
|
|
846
|
|
- criteria.andEqualTo("case_status_name", nextFlow.getCaseStatusName());
|
|
847
|
|
- criteria.andEqualTo("create_by", user.getUserName());
|
|
|
857
|
+ criteria.andEqualTo("caseAppliId", vo.getId());
|
|
|
858
|
+ criteria.andEqualTo("caseNode", nextFlow.getNodeId());
|
|
|
859
|
+ criteria.andEqualTo("caseStatusName", nextFlow.getCaseStatusName());
|
|
|
860
|
+ criteria.andEqualTo("createBy", user.getUserName());
|
|
848
|
861
|
int count = caseLogRecordMapper.selectCountByExample(example);
|
|
849
|
862
|
if(count>0){
|
|
850
|
863
|
// 被申请人已预约,更新流程节点
|
|
|
@@ -1092,8 +1105,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1092
|
1105
|
// 查询调解书模板是否存在
|
|
1093
|
1106
|
Example example = new Example(MsCaseApplication.class);
|
|
1094
|
1107
|
Example.Criteria criteria = example.createCriteria();
|
|
1095
|
|
- criteria.andEqualTo("batch_number", req.getBatchNumber());
|
|
1096
|
|
- criteria.andIsNotNull("template_id");
|
|
|
1108
|
+ criteria.andEqualTo("batchNumber", req.getBatchNumber());
|
|
|
1109
|
+ criteria.andIsNotNull("templateId");
|
|
1097
|
1110
|
MsCaseApplication caseApplication = msCaseApplicationMapper.selectOneByExample(example);
|
|
1098
|
1111
|
if(caseApplication==null||caseApplication.getTemplateId()==null){
|
|
1099
|
1112
|
return AjaxResult.error("未找到模板");
|
|
|
@@ -1558,9 +1571,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1558
|
1571
|
// todo
|
|
1559
|
1572
|
String saveFolderPath = RuoYiConfig.getUploadPath()+"/"+ year + "/" + month + "/" + day;
|
|
1560
|
1573
|
Integer annexType = AnnexTypeEnum.MEDIATION_APPLICATION.getCode();
|
|
1561
|
|
- String orgFileName = "调解申请书.docx";
|
|
|
1574
|
+ String orgFileName = "调解申请书";
|
|
1562
|
1575
|
if(templateType!=null&&templateType==1) {
|
|
1563
|
|
- orgFileName = "调解书.docx";
|
|
|
1576
|
+ orgFileName = "调解书";
|
|
1564
|
1577
|
annexType=AnnexTypeEnum.MEDIATE_BOOK.getCode();
|
|
1565
|
1578
|
}
|
|
1566
|
1579
|
String fileName = UUID.randomUUID().toString().replace("-", "")+orgFileName + ".docx";
|
|
|
@@ -1570,7 +1583,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1570
|
1583
|
|
|
1571
|
1584
|
MsCaseAttach caseAttach = MsCaseAttach.builder()
|
|
1572
|
1585
|
.caseAppliId(application.getId())
|
|
1573
|
|
- .annexName(orgFileName)
|
|
|
1586
|
+ .annexName(orgFileName+".docx")
|
|
1574
|
1587
|
.annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
|
|
1575
|
1588
|
.annexType(annexType)
|
|
1576
|
1589
|
.build();
|
|
|
@@ -1653,7 +1666,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1653
|
1666
|
// String filePath = RuoYiConfig.getUploadPath();
|
|
1654
|
1667
|
MsCaseAttach caseAttach = new MsCaseAttach();
|
|
1655
|
1668
|
caseAttach.setCaseAppliId(caseApplication.getId());
|
|
1656
|
|
- caseAttach.setAnnexPath(entry.getValue());
|
|
|
1669
|
+ caseAttach.setAnnexPath(fileUrl.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX));
|
|
1657
|
1670
|
caseAttach.setAnnexName(entry.getKey());
|
|
1658
|
1671
|
// todo
|
|
1659
|
1672
|
// if (StrUtil.isNotEmpty(fileUrl)) {
|