Commit eb177719 authored by 赵啸非's avatar 赵啸非

添加资源自动刷新获取

parent 2bb24a82
......@@ -315,11 +315,14 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override
public void updateUserList(List<UserPdu> list) {
//更新本地用户信息,并且更新用户站点树 //todo 将站点分组后 分组同步更新
List<String> loginNames = list.parallelStream().map(user -> user.getLoginName()).collect(Collectors.toList());
/* List<String> loginNames = list.parallelStream().map(user -> user.getLoginName()).collect(Collectors.toList());
UserQuery userQuery = new UserQuery();
userQuery.setLoginNameList(loginNames);
List<UserEntity> existUsers = this.find(userQuery);
List<UserEntity> existUsers = this.find(userQuery);*/
List<UserEntity> existUsers = list.parallelStream().map(item -> this.getExtCache(item.getLoginName())).filter(f -> f != null).collect(Collectors.toList());
Map<String, UserEntity> existUserMap = existUsers.parallelStream().collect(Collectors.toMap(x -> x.getLoginName(), y -> y, (o, n) -> n));
//分组查找存在的与不存在的用户
Map<Boolean, List<UserPdu>> collect = list.parallelStream().collect(Collectors.partitioningBy(x -> existUserMap.containsKey(x.getLoginName())));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment