修改账号角色禁用
continuous-integration/drone/push Build is passing Details

Uat_IRC_Net8
hang 2024-12-31 13:12:39 +08:00
parent bfed24028a
commit bf2b439ce1
1 changed files with 13 additions and 2 deletions

View File

@ -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();
}