|
@@ -43,9 +43,11 @@ namespace GxPress.Service.Implement
|
|
|
private readonly IWaitHandleRepository waitHandleRepository;
|
|
|
private readonly IDepartmentUserRepository departmentUserRepository;
|
|
|
private readonly IFriendsRepository friendsRepository;
|
|
|
+ private readonly IGroupChatUserRepository groupChatUserRepository;
|
|
|
+ private readonly IGroupUserRepository groupUserRepository;
|
|
|
public UserService(IUserRepository userRepository, IDepartmentRepository departmentRepository,
|
|
|
IAddressBookGroupRepository addressBookGroupRepository, IBlacklistUserRepository blacklistUserRepository,
|
|
|
- IMapper mapper, IWebHostEnvironment webHostEnvironment, IRoleRepository roleRepository, IIMService imService, IFlowRepository flowRepository, IFlowTodoRepository flowTodoRepository, IWaitHandleRepository waitHandleRepository, IDepartmentUserRepository departmentUserRepository, IFriendsRepository friendsRepository)
|
|
|
+ IMapper mapper, IWebHostEnvironment webHostEnvironment, IRoleRepository roleRepository, IIMService imService, IFlowRepository flowRepository, IFlowTodoRepository flowTodoRepository, IWaitHandleRepository waitHandleRepository, IDepartmentUserRepository departmentUserRepository, IFriendsRepository friendsRepository, IGroupChatUserRepository groupChatUserRepository, IGroupUserRepository groupUserRepository)
|
|
|
{
|
|
|
|
|
|
_userRepository = userRepository;
|
|
@@ -61,6 +63,8 @@ namespace GxPress.Service.Implement
|
|
|
this.waitHandleRepository = waitHandleRepository;
|
|
|
this.departmentUserRepository = departmentUserRepository;
|
|
|
this.friendsRepository = friendsRepository;
|
|
|
+ this.groupChatUserRepository = groupChatUserRepository;
|
|
|
+ this.groupUserRepository = groupUserRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -530,5 +534,31 @@ namespace GxPress.Service.Implement
|
|
|
var userIds = await departmentUserRepository.GetUserIdsAsync(departent.Select(n => n.Id));
|
|
|
return await _userRepository.GetUserInfoResultsAsync(userIds);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 获取群聊和小组的用户
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="typeValue"></param>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <param name="keyword"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<IEnumerable<UserInfoResult>> GetGroupOrGroupChatUserInfosResult(int typeValue, int id, string keyword)
|
|
|
+ {
|
|
|
+ //群聊
|
|
|
+ if (typeValue == 1)
|
|
|
+ {
|
|
|
+ var groupChatUsers = await groupChatUserRepository.GetAllAsync(Q.Where(nameof(Entity.GroupChatUser.GroupChatId), id));
|
|
|
+ var result = await _userRepository.GetSearchUserInfoResults(keyword, groupChatUsers.Select(n => n.UserId));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ //小组
|
|
|
+ if (typeValue == 2)
|
|
|
+ {
|
|
|
+ var groupUsers = await groupUserRepository.GetAllAsync(Q.Where(nameof(Entity.GroupUser.GroupId), id));
|
|
|
+ var result = await _userRepository.GetSearchUserInfoResults(keyword, groupUsers.Select(n => n.UserId));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|