修改筛选用户角色启用
continuous-integration/drone/push Build is passing Details

Uat_IRC_Net8
hang 2024-12-31 16:49:17 +08:00
parent 86236e865e
commit 8b3dd419b7
1 changed files with 7 additions and 1 deletions

View File

@ -605,11 +605,17 @@ namespace IRaCIS.Core.Application.Service
{
sysUserInfo = (await _identityUserRepository.Where(t => t.UserRoleList.Any(t => t.DoctorId == doctorId || t.IdentityUser.EMail == doctor.EMail), true).Include(t => t.UserRoleList).FirstOrDefaultAsync()).IfNullThrowException();
var findRole = sysUserInfo.UserRoleList.FirstOrDefault(t => t.UserTypeId == userType.Id);
//不存在该角色,那么就加入该角色
if (!sysUserInfo.UserRoleList.Any(t => t.UserTypeId == userType.Id))
if (findRole == null)
{
sysUserInfo.UserRoleList.Add(new UserRole() { DoctorId = doctorId, UserTypeEnum = UserTypeEnum.IndependentReviewer, UserTypeId = userType.Id });
}
else
{
findRole.IsUserRoleDisabled = false;
}
sysUserInfo.Status = UserStateEnum.Enable;