|
@@ -55,6 +55,11 @@ namespace GxPress.Service.Implement.AdminVerify
|
|
|
var users = await _userRepository.GetAllAsync(Q.WhereIn(nameof(Entity.User.Id), request.UserIds));
|
|
|
var departmentUsers = await departmentUserRepository.GetDepartmentUsersByUserIdsAsync(request.UserIds);
|
|
|
var departments = await _departmentRepository.GetAllAsync(Q.WhereIn(nameof(Entity.Department.Id), departmentUsers.Select(n => n.DepartmentId)));
|
|
|
+ //获取小组
|
|
|
+ var group = await _groupRepository.GetAsync(request.SourceId);
|
|
|
+ var ids = new List<int> { GroupUserRoleTyeConst.Admin.GetHashCode(), GroupUserRoleTyeConst.SuperAdmin.GetHashCode() };
|
|
|
+ //创建人
|
|
|
+ var groupUsers = await _groupUserRepository.GetAllAsync(Q.Where(nameof(GroupUser.GroupId), group.Id).WhereIn(nameof(GroupUser.GroupUserRoleId), ids));
|
|
|
foreach (var userId in request.UserIds)
|
|
|
{
|
|
|
var adminVerify = new Entity.AdminVerify();
|
|
@@ -68,7 +73,7 @@ namespace GxPress.Service.Implement.AdminVerify
|
|
|
{
|
|
|
department = departments.FirstOrDefault(m => m.Id == departmentUsers.FirstOrDefault(n => n.UserId == user.Id).DepartmentId);
|
|
|
}
|
|
|
- var group = await _groupRepository.GetAsync(request.SourceId);
|
|
|
+
|
|
|
var query = Q.NewQuery();
|
|
|
query.Where(nameof(Entity.AdminVerify.AdminId), userId);
|
|
|
query.Where(nameof(Entity.AdminVerify.SourceType), request.SourceType);
|
|
@@ -82,13 +87,10 @@ namespace GxPress.Service.Implement.AdminVerify
|
|
|
//申请
|
|
|
if (request.SourceType == 1)
|
|
|
{
|
|
|
- var ids = new List<int> { GroupUserRoleTyeConst.Admin.GetHashCode(), GroupUserRoleTyeConst.SuperAdmin.GetHashCode() };
|
|
|
- //创建人
|
|
|
- var groupUsers = await _groupUserRepository.GetAllAsync(Q.Where(nameof(GroupUser.GroupId), group.Id).WhereIn(nameof(GroupUser.GroupUserRoleId), ids));
|
|
|
foreach (var groupUser in groupUsers)
|
|
|
{
|
|
|
//设置群主验证
|
|
|
- await InsertMiddleVerify(groupUser.UserId);
|
|
|
+ //await InsertMiddleVerify(groupUser.UserId);
|
|
|
adminVerifyDto.AvatarUrl = StringUtils.RemoveDomain(user.AvatarUrl);
|
|
|
adminVerifyDto.SourceName = group.Name;
|
|
|
adminVerifyDto.Name = user.Name;
|
|
@@ -125,7 +127,7 @@ namespace GxPress.Service.Implement.AdminVerify
|
|
|
adminVerify.Remark = department.Name + "-" + userDto.Name;
|
|
|
//await _adminVerifyRepository.InsertAsync(adminVerify);
|
|
|
adminVerifys.Add(adminVerify);
|
|
|
- await InsertMiddleVerify(userId);
|
|
|
+ //await InsertMiddleVerify(userId);
|
|
|
}
|
|
|
}
|
|
|
await _adminVerifyRepository.InsertAsync(adminVerifys);
|