diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index e3baad780..d89b9e63f 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -669,7 +669,7 @@ namespace IRaCIS.Core.Application.Service public async Task UserFeedBackMail(Guid feedBackId) { - var feedBack = await _userFeedBackRepository.Where(t => t.Id == feedBackId).Include(t => t.CreateUserRole).ThenInclude(t => t.UserTypeRole).FirstNotNullAsync(); + var feedBack = await _userFeedBackRepository.Where(t => t.Id == feedBackId).Include(t => t.CreateUserRole.UserTypeRole).Include(t => t.CreateUserRole.IdentityUser).FirstNotNullAsync(); var messageToSend = new MimeMessage(); //发件地址 @@ -686,7 +686,7 @@ namespace IRaCIS.Core.Application.Service var userTypeEnumList = emailConfigInfo.EmailNoticeUserTypeList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList(); var emailList = await _userRoleRepository.Where(t => userTypeEnumList.Contains(t.UserTypeEnum) && - (isHaveTrialId ? t.UserRoleTrials.Any(t => t.TrialId == feedBack.TrialId) : true)).Select(t => new { t.EMail, t.UserTypeEnum, t.FullName }).ToListAsync(); + (isHaveTrialId ? t.UserRoleTrials.Any(t => t.TrialId == feedBack.TrialId) : true)).Select(t => new { t.IdentityUser.EMail, t.UserTypeEnum, t.IdentityUser.FullName }).ToListAsync(); foreach (var email in emailList) @@ -715,7 +715,7 @@ namespace IRaCIS.Core.Application.Service info.SubejctCode, info.VisitName, feedBack.CreateUserRole.UserTypeRole.UserTypeShortName, - feedBack.CreateUserRole.FullName, + feedBack.CreateUserRole.IdentityUser.FullName, emailType, feedBack.QuestionDescription, _systemEmailConfig.SiteUrl @@ -745,7 +745,7 @@ namespace IRaCIS.Core.Application.Service info.SubejctCode, info.VisitName, feedBack.CreateUserRole.UserTypeRole.UserTypeShortName, - feedBack.CreateUserRole.FullName, + feedBack.CreateUserRole.IdentityUser.FullName, emailType, feedBack.QuestionDescription, _systemEmailConfig.SiteUrl @@ -774,7 +774,7 @@ namespace IRaCIS.Core.Application.Service userNames, info.TrialCode, feedBack.CreateUserRole.UserTypeRole.UserTypeShortName, - feedBack.CreateUserRole.FullName, + feedBack.CreateUserRole.IdentityUser.FullName, emailType, feedBack.QuestionDescription, _systemEmailConfig.SiteUrl @@ -799,7 +799,7 @@ namespace IRaCIS.Core.Application.Service var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr), userNames, feedBack.CreateUserRole.UserTypeRole.UserTypeShortName, - feedBack.CreateUserRole.FullName, + feedBack.CreateUserRole.IdentityUser.FullName, feedBack.QuestionDescription, _systemEmailConfig.SiteUrl ); diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs index 5858be3db..b36834bbf 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs @@ -17,7 +17,7 @@ namespace IRaCIS.Core.Application.ViewModel public string? ActionUserName { get; set; } - public string ActionUserRoleShortName { get; set; } + //public string ActionUserRoleShortName { get; set; } public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index 47a4784be..dff9c1309 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -123,7 +123,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() - .ForMember(d => d.ActionUserRoleShortName, c => c.MapFrom(t => t.CreateUserRole.UserTypeRole.UserTypeShortName)) + //.ForMember(d => d.ActionUserRoleShortName, c => c.MapFrom(t => t.CreateUserRole.UserTypeRole.UserTypeShortName)) .ForMember(d => d.TargetIdentityUserName, c => c.MapFrom(t => t.TargetIdentityUser.UserName)); @@ -133,8 +133,8 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.SubjectCode, c => c.MapFrom(t => t.Subject.Code)) .ForMember(d => d.TrialSiteCode, c => c.MapFrom(t => t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindTrialSiteCode : t.TrialSite.TrialSiteCode)) .ForMember(d => d.SubjectVisitName, c => c.MapFrom(t => t.SubjectVisit.VisitName)) - .ForMember(d => d.FeedBackUserName, c => c.MapFrom(t => t.CreateUserRole.UserName)) - .ForMember(d => d.FeedBackFullName, c => c.MapFrom(t => t.CreateUserRole.FullName)) + .ForMember(d => d.FeedBackUserName, c => c.MapFrom(t => t.CreateUserRole.IdentityUser.UserName)) + .ForMember(d => d.FeedBackFullName, c => c.MapFrom(t => t.CreateUserRole.IdentityUser.FullName)) .ForMember(d => d.UserTypeEnum, c => c.MapFrom(t => t.CreateUserRole.UserTypeEnum)) .ForMember(d => d.ScreenshotList, c => c.MapFrom(t => t.FeedBackScreenshotList)) ; diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 3a4852d10..973b69a9d 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -873,7 +873,7 @@ namespace IRaCIS.Core.Application.Contracts saveItem.IsZhiZhun = false; saveItem.Code = _identityUserRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1; - saveItem.UserCode = AppSettings.GetCodeStr(saveItem.Code, nameof(UserRole)); + saveItem.UserCode = AppSettings.GetCodeStr(saveItem.Code, nameof(IdentityUser)); saveItem.UserName = saveItem.UserCode; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs index 792d29b82..a886d11d6 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs @@ -38,6 +38,8 @@ namespace IRaCIS.Application.Contracts public DateTime? DeletedTime { get; set; } public DateTime UpdateTime { get; set; } public DateTime CreateTime { get; set; } + + public Guid TrialSiteId { get; set; } } public class UserTrialDTO : UserTrialCommand diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs index a5f4c409b..e0d77bd2c 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs @@ -132,7 +132,7 @@ namespace IRaCIS.Core.Application.Service generateUser.Code = _identityUserRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1; - generateUser.UserCode = AppSettings.GetCodeStr(generateUser.Code, nameof(UserRole)); + generateUser.UserCode = AppSettings.GetCodeStr(generateUser.Code, nameof(IdentityUser)); generateUser.UserName = generateUser.UserCode; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs index 6e3cdc5e9..e6697c018 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs @@ -27,7 +27,14 @@ namespace IRaCIS.Core.Application.Services var query = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == siteId).IgnoreQueryFilters() .ProjectTo(_mapper.ConfigurationProvider); - return await query.ToListAsync(); + var list = await query.ToListAsync(); + + foreach (var item in list) + { + item.TrialSiteId = siteId; + } + + return list; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs index e6af9ea2a..cb7c43c50 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs @@ -92,13 +92,13 @@ namespace IRaCIS.Core.Application.Service CreateMap(); var trialSiteId = Guid.Empty; - CreateMap().IncludeMembers(t => t.UserRole) - .ForMember(d => d.UserRealName, u => u.MapFrom(s => s.UserRole.FullName)) + CreateMap().IncludeMembers(t => t.UserRole.IdentityUser) + .ForMember(d => d.UserRealName, u => u.MapFrom(s => s.UserRole.IdentityUser.FullName)) .ForMember(d => d.TrialSiteId, u => u.MapFrom(t => trialSiteId)) .ForMember(d => d.UserType, u => u.MapFrom(t => t.UserRole.UserTypeRole.UserTypeShortName)) .ForMember(d => d.IsSelect, u => u.MapFrom(t => t.Trial.TrialSiteUserList.Any(k => k.UserId == t.UserId && k.TrialSiteId== trialSiteId))); - CreateMap(); + CreateMap(); var trialId = Guid.Empty; diff --git a/IRaCIS.Core.Domain/Management/User.cs b/IRaCIS.Core.Domain/Management/User.cs index cb8e7f51f..3aa94f1dc 100644 --- a/IRaCIS.Core.Domain/Management/User.cs +++ b/IRaCIS.Core.Domain/Management/User.cs @@ -48,9 +48,6 @@ public class UserRole : BaseFullAuditEntity public string UserCode { get; set; } - - - public string Password { get; set; }