修改账号角色禁用
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
bfed24028a
commit
bf2b439ce1
|
@ -595,13 +595,24 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
|
||||
await _userRoleRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
sysUserInfo = (await _identityUserRepository.Where(t => t.UserRoleList.Any(t => t.DoctorId == doctorId || t.IdentityUser.EMail == doctor.EMail)).Include(t => t.UserRoleList).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
sysUserInfo = (await _identityUserRepository.Where(t => t.UserRoleList.Any(t => t.DoctorId == doctorId || t.IdentityUser.EMail == doctor.EMail), true).Include(t => t.UserRoleList).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//不存在该角色,那么就加入该角色
|
||||
if (!sysUserInfo.UserRoleList.Any(t => t.UserTypeId == userType.Id))
|
||||
{
|
||||
sysUserInfo.UserRoleList.Add(new UserRole() { DoctorId = doctorId, UserTypeEnum = UserTypeEnum.IndependentReviewer, UserTypeId = userType.Id });
|
||||
}
|
||||
|
||||
sysUserInfo.Status = UserStateEnum.Enable;
|
||||
|
||||
}
|
||||
|
||||
//保证能有userRoleId
|
||||
await _userRoleRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue