From 1fd2c01612d461240d63b8e8844f2dc96c6ed3b3 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 26 Aug 2025 13:06:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index fa3e91e48..e21617596 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -607,7 +607,7 @@ namespace IRaCIS.Core.Application.Service //await VerifyUserPhoneAsync(model.Id, model.UserTypeId, model.Phone); - var user = await _identityUserRepository.Where(t => t.Id == model.Id, true).Include(t => t.UserRoleList)/*.Include(t => t.IdentityUserHospitalGroupList)*/.FirstOrDefaultAsync(); + var user = await _identityUserRepository.Where(t => t.Id == model.Id, true).Include(t => t.UserRoleList).Include(t => t.IdentityUserHospitalGroupList).FirstOrDefaultAsync(); if (user == null) return Null404NotFound(user); @@ -657,15 +657,15 @@ namespace IRaCIS.Core.Application.Service } - //var existHospitalGroupIdList = user.IdentityUserHospitalGroupList.Select(t => t.HospitalGroupId).ToList(); + var existHospitalGroupIdList = user.IdentityUserHospitalGroupList.Select(t => t.HospitalGroupId).ToList(); - //var removeIdList = existHospitalGroupIdList.Except(model.HospitalGroupIdList).ToList(); + var removeIdList = existHospitalGroupIdList.Except(model.HospitalGroupIdList).ToList(); - //user.IdentityUserHospitalGroupList = user.IdentityUserHospitalGroupList.Where(t => !removeIdList.Contains(t.HospitalGroupId)).ToList(); + user.IdentityUserHospitalGroupList = user.IdentityUserHospitalGroupList.Where(t => !removeIdList.Contains(t.HospitalGroupId)).ToList(); - //var addIdList = model.HospitalGroupIdList.Except(existHospitalGroupIdList).ToList(); + var addIdList = model.HospitalGroupIdList.Except(existHospitalGroupIdList).ToList(); - //user.IdentityUserHospitalGroupList.AddRange(addIdList.Select(t => new HospitalGroupIdentityUser() { HospitalGroupId = t, IsManager = false, IdentityUserId = user.Id })); + user.IdentityUserHospitalGroupList.AddRange(addIdList.Select(t => new HospitalGroupIdentityUser() { HospitalGroupId = t, IsManager = false, IdentityUserId = user.Id })); var success = await _identityUserRepository.SaveChangesAsync();