From ba2965e29563b6cfc6ee7b9706fb8a5a43612d68 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 27 Dec 2024 12:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=96=E9=83=A8=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E9=82=80=E8=AF=B7=E9=82=AE=E4=BB=B6=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/UserService.cs | 2 +- .../Service/TrialSiteUser/TrialExternalUserService.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index f9e8742d9..84d779701 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -479,7 +479,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime) .WhereIf(inQuery.BeginLastLoginTime != null, t => t.LastLoginTime >= inQuery.BeginLastLoginTime) .WhereIf(inQuery.EndLastLoginTime != null, t => t.LastLoginTime <= inQuery.EndLastLoginTime) - .WhereIf(inQuery.BeginLastChangePassWordTime != null, t => t.LastChangePassWordTime >= inQuery.BeginLastChangePassWordTime) + .WhereIf(inQuery.BeginLastChangePassWordTime != null, t => t.LastChangePassWordTime >= inQuery.BeginLastChangePassWordTime) .WhereIf(inQuery.EndLastChangePassWordTime != null, t => t.LastChangePassWordTime <= inQuery.EndLastChangePassWordTime) .WhereIf(inQuery.UserType != null, t => t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserType)) .WhereIf(inQuery.UserState != null, t => t.Status == inQuery.UserState) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs index cb615917e..df25aa2e2 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs @@ -325,10 +325,11 @@ namespace IRaCIS.Core.Application.Service IdentityUserId = identityUserId, TrialId = trialId, JoinTime = DateTime.Now, + TrialUserRoleList = userTypeIdList.Select(u => new TrialUserRole() { TrialId = trialId, - UserId = u, + UserId = existSysUser.UserRoleList.FirstOrDefault(t=>t.UserTypeId==u).Id, }).ToList() }); @@ -346,7 +347,7 @@ namespace IRaCIS.Core.Application.Service if (findTrialUserRole == null) { //添加该角色 - findTrialUser.TrialUserRoleList.Add(new TrialUserRole() { TrialUserId = findTrialUser.Id, TrialId = trialId, UserId = userTypeId }); + findTrialUser.TrialUserRoleList.Add(new TrialUserRole() { TrialUserId = findTrialUser.Id, TrialId = trialId, UserId = existSysUser.UserRoleList.FirstOrDefault(t => t.UserTypeId == userTypeId).Id }); } else { @@ -361,8 +362,9 @@ namespace IRaCIS.Core.Application.Service } } + await _trialIdentityUserRepository.SaveChangesAsync(); - var usertyps = string.Join(',', userTypeList.Select(t => t.UserTypeShortName)); + var usertyps = string.Join(',', userTypeList.Where(t=> userTypeIdList.Contains(t.UserTypeId)).Select(t => t.UserTypeShortName)); await _mailVerificationService.ExternalUserJoinEmail(trialId, identityUserId, usertyps, sendEmail.BaseUrl, sendEmail.RouteUrl);