...
|
...
|
@@ -209,11 +209,13 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
209
|
209
|
List<Map<String,String>> userOrgList = getUserOrgMap(getUserByOrganizationIds(parentId),getUserByOrganizationIds(sourceParentOrganizationId));
|
210
|
210
|
baseMapper.updateById(organization);
|
211
|
211
|
//组织修改过后更新原上级与目标上级用户绑定的组织
|
212
|
|
- for (Map<String,String> userOrg:userOrgList){
|
213
|
|
- String user = userOrg.get("userId");
|
214
|
|
- String org = userOrg.get("orgId");
|
215
|
|
- List<String>orgIds = organizationAllIds(tenantId, org);
|
216
|
|
- addOrUpdateUserOrganizationMapping(user,orgIds);
|
|
212
|
+ if(null!=userOrgList){
|
|
213
|
+ for (Map<String,String> userOrg:userOrgList){
|
|
214
|
+ String user = userOrg.get("userId");
|
|
215
|
+ String org = userOrg.get("orgId");
|
|
216
|
+ List<String>orgIds = organizationAllIds(tenantId, org);
|
|
217
|
+ addOrUpdateUserOrganizationMapping(user,orgIds);
|
|
218
|
+ }
|
217
|
219
|
}
|
218
|
220
|
return organizationDTO;
|
219
|
221
|
}
|
...
|
...
|
@@ -240,17 +242,21 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
240
|
242
|
//目标上级原本绑定的用户 newUserIds
|
241
|
243
|
//原上级原本绑定的用户 oldUserIds
|
242
|
244
|
List<Map<String,String>> userOrgList = new ArrayList<>();
|
243
|
|
- for (String oldUserId:oldUserIds) {
|
244
|
|
- Map<String,String> map = new HashMap<>();
|
245
|
|
- map.put("userId",oldUserId);
|
246
|
|
- map.put("orgId", getOrganizationIdsByUser(oldUserId).get(0));
|
247
|
|
- userOrgList.add(map);
|
|
245
|
+ if(null!=newUserIds){
|
|
246
|
+ for (String newUserId:newUserIds) {
|
|
247
|
+ Map<String,String> map = new HashMap<>();
|
|
248
|
+ map.put("userId",newUserId);
|
|
249
|
+ map.put("orgId", getOrganizationIdsByUser(newUserId).get(0));
|
|
250
|
+ userOrgList.add(map);
|
|
251
|
+ }
|
248
|
252
|
}
|
249
|
|
- for (String newUserId:newUserIds) {
|
250
|
|
- Map<String,String> map = new HashMap<>();
|
251
|
|
- map.put("userId",newUserId);
|
252
|
|
- map.put("orgId", getOrganizationIdsByUser(newUserId).get(0));
|
253
|
|
- userOrgList.add(map);
|
|
253
|
+ if(null!=oldUserIds){
|
|
254
|
+ for (String oldUserId:oldUserIds) {
|
|
255
|
+ Map<String,String> map = new HashMap<>();
|
|
256
|
+ map.put("userId",oldUserId);
|
|
257
|
+ map.put("orgId", getOrganizationIdsByUser(oldUserId).get(0));
|
|
258
|
+ userOrgList.add(map);
|
|
259
|
+ }
|
254
|
260
|
}
|
255
|
261
|
return userOrgList;
|
256
|
262
|
}
|
...
|
...
|
|