|
|
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
|
3
|
3
|
|
|
4
|
4
|
import cn.hutool.core.collection.CollectionUtil;
|
|
5
|
5
|
import cn.hutool.core.util.StrUtil;
|
|
|
6
|
+import com.ruoyi.common.annotation.CaseLog;
|
|
6
|
7
|
import com.ruoyi.common.annotation.DataScope;
|
|
7
|
8
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
8
|
9
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
@@ -113,9 +114,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
113
|
114
|
caseAttach.setCaseAppliId(caseApplication.getId());
|
|
114
|
115
|
caseAttachMapper.updateCaseAttach(caseAttach);
|
|
115
|
116
|
}
|
|
116
|
|
-
|
|
117
|
117
|
}
|
|
118
|
|
-
|
|
119
|
118
|
return rows;
|
|
120
|
119
|
}
|
|
121
|
120
|
|
|
|
@@ -156,10 +155,38 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
156
|
155
|
int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
|
|
157
|
156
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
158
|
157
|
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
|
|
158
|
+ // 查询所有的组织机构,组装成map
|
|
|
159
|
+ List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
|
|
160
|
+ if (CollectionUtil.isEmpty(deptList)) {
|
|
|
161
|
+ deptList = new ArrayList<>();
|
|
|
162
|
+ }
|
|
|
163
|
+ Map<String, Long> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
|
|
159
|
164
|
for (CaseAffiliate caseAffiliate : caseAffiliates){
|
|
160
|
165
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
|
166
|
+ if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
|
167
|
+ // 将组织机构id设为申请人名称
|
|
|
168
|
+ if (deptMap.containsKey(caseApplication.getName())) {
|
|
|
169
|
+ caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
170
|
+ } else {
|
|
|
171
|
+ // 如果不存在则新增
|
|
|
172
|
+ SysDept dept = new SysDept();
|
|
|
173
|
+ dept.setParentId(0L);
|
|
|
174
|
+ dept.setDeptName(caseAffiliate.getName());
|
|
|
175
|
+ dept.setAncestors("0");
|
|
|
176
|
+ dept.setOrderNum(1);
|
|
|
177
|
+ dept.setStatus("0");
|
|
|
178
|
+ dept.setDelFlag("0");
|
|
|
179
|
+ dept.setCreateBy(getUsername());
|
|
|
180
|
+ dept.setUpdateBy(getUsername());
|
|
|
181
|
+ sysDeptMapper.insertDept(dept);
|
|
|
182
|
+ deptMap.put(dept.getDeptName(), dept.getDeptId());
|
|
|
183
|
+ caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
184
|
+
|
|
|
185
|
+ }
|
|
|
186
|
+ }
|
|
161
|
187
|
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
|
162
|
188
|
}
|
|
|
189
|
+
|
|
163
|
190
|
}
|
|
164
|
191
|
List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
|
165
|
192
|
if(caseAttachList!=null&&caseAttachList.size()>0){
|
|
|
@@ -458,11 +485,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
458
|
485
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
459
|
486
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
460
|
487
|
if(caseAffiliatListeselect!=null){
|
|
|
488
|
+ // 查询组织机构
|
|
|
489
|
+ List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
|
490
|
+ Map<String,String> deptMap=new HashMap<>();
|
|
|
491
|
+ if(CollectionUtil.isNotEmpty(sysDepts)){
|
|
|
492
|
+ for (SysDept sysDept : sysDepts) {
|
|
|
493
|
+ deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
|
|
494
|
+ }
|
|
|
495
|
+ }
|
|
461
|
496
|
StringBuffer applicantName = new StringBuffer();
|
|
462
|
497
|
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
|
463
|
498
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
|
464
|
499
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
465
|
500
|
if(identityType==1){
|
|
|
501
|
+ if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
|
502
|
+ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
|
503
|
+ }
|
|
466
|
504
|
applicantName.append(caseAffiliateselect.getName()).append(",");;
|
|
467
|
505
|
}
|
|
468
|
506
|
}
|
|
|
@@ -543,9 +581,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
543
|
581
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
544
|
582
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
545
|
583
|
if(caseAffiliatListeselect!=null) {
|
|
|
584
|
+ // 查询组织机构
|
|
|
585
|
+ List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
|
586
|
+ Map<String,String> deptMap=new HashMap<>();
|
|
|
587
|
+ if(CollectionUtil.isNotEmpty(sysDepts)){
|
|
|
588
|
+ for (SysDept sysDept : sysDepts) {
|
|
|
589
|
+ deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
|
|
590
|
+ }
|
|
|
591
|
+ }
|
|
546
|
592
|
for (int j = 0; j < caseAffiliatListeselect.size(); j++) {
|
|
547
|
593
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
|
|
548
|
594
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
|
595
|
+ if(identityType==1){
|
|
|
596
|
+ if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
|
597
|
+ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
|
598
|
+ }
|
|
|
599
|
+ caseAffiliateselect.setName(caseAffiliateselect.getName());;
|
|
|
600
|
+ }
|
|
549
|
601
|
//给申请人、被申请人发送短信通知
|
|
550
|
602
|
request.setPhone(caseAffiliateselect.getContactTelphone());
|
|
551
|
603
|
// 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|