|
|
@@ -72,25 +72,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
72
|
72
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
73
|
73
|
Map<String, Long> deptMap =new HashMap<>();
|
|
74
|
74
|
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
75
|
|
- if(StrUtil.isNotEmpty(caseApplication.getName())) {
|
|
76
|
75
|
// 查询所有的组织机构,组装成map
|
|
77
|
76
|
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
|
78
|
77
|
if (CollectionUtil.isEmpty(deptList)) {
|
|
79
|
78
|
deptList = new ArrayList<>();
|
|
80
|
79
|
}
|
|
81
|
|
- deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId));
|
|
82
|
|
- }
|
|
|
80
|
+ deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
|
|
|
81
|
+
|
|
83
|
82
|
for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
|
84
|
83
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
85
|
|
- if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseApplication.getName())) {
|
|
|
84
|
+ if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
86
|
85
|
// 将组织机构id设为申请人名称
|
|
87
|
86
|
if (deptMap.containsKey(caseApplication.getName())) {
|
|
88
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
|
|
|
87
|
+ caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
89
|
88
|
} else {
|
|
90
|
89
|
// 如果不存在则新增
|
|
91
|
90
|
SysDept dept = new SysDept();
|
|
92
|
91
|
dept.setParentId(0L);
|
|
93
|
|
- dept.setDeptName(caseApplication.getName());
|
|
|
92
|
+ dept.setDeptName(caseAffiliate.getName());
|
|
94
|
93
|
dept.setAncestors("0");
|
|
95
|
94
|
dept.setOrderNum(1);
|
|
96
|
95
|
dept.setStatus("0");
|
|
|
@@ -227,12 +226,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
227
|
226
|
|
|
228
|
227
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
229
|
228
|
if(caseAffiliatListeselect!=null){
|
|
|
229
|
+ // 查询组织机构
|
|
|
230
|
+ List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
|
231
|
+ Map<String,String> deptMap=new HashMap<>();
|
|
|
232
|
+ if(CollectionUtil.isNotEmpty(sysDepts)){
|
|
|
233
|
+ for (SysDept sysDept : sysDepts) {
|
|
|
234
|
+ deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
|
|
235
|
+ }
|
|
|
236
|
+ }
|
|
230
|
237
|
StringBuffer applicantName = new StringBuffer();
|
|
231
|
238
|
StringBuffer respondentName = new StringBuffer();
|
|
232
|
239
|
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
|
233
|
240
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
|
234
|
241
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
235
|
242
|
if(identityType==1){
|
|
|
243
|
+ if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
|
244
|
+ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
|
245
|
+ }
|
|
236
|
246
|
applicantName.append(caseAffiliateselect.getName()).append(",");;
|
|
237
|
247
|
}else if(identityType==2){
|
|
238
|
248
|
respondentName.append(caseAffiliateselect.getName()).append(",");;
|
|
|
@@ -258,7 +268,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
258
|
268
|
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
|
259
|
269
|
Map<String, Long> deptMap =new HashMap<>();
|
|
260
|
270
|
if(CollectionUtil.isNotEmpty(deptList)) {
|
|
261
|
|
- deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId));
|
|
|
271
|
+ deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
|
|
262
|
272
|
}
|
|
263
|
273
|
List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
|
|
264
|
274
|
for (int i = 0; i < caseApplicationList.size(); i++){
|