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);