diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index d1035429d..3bd92ef01 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -153,9 +153,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.IdentityUserId, c => c.MapFrom(t => t.Id)); CreateMap(); - CreateMap(); - + CreateMap ().ReverseMap(); + CreateMap() .ForMember(d => d.UserTypeShortName, c => c.MapFrom(t => t.UserTypeRole.UserTypeShortName)); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs index 8a01e2a3c..9a4eddcaf 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs @@ -250,12 +250,15 @@ namespace IRaCIS.Core.Application.Service var userId = userInfo.SystemUserId; var userTypeId = userInfo.UserTypeId; + var findTrialUser = await _trialIdentityUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.IdentityUserId == userId); //判断TrialUser中是否存在 不存在就插入 注意退出了,也不能再加进来 - if (!await _trialIdentityUserRepository.AnyAsync(t => t.TrialId == trialId && t.IdentityUserId == userId, true)) + if (!await _trialUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.UserRole.IdentityUserId == userId && t.UserRole.UserTypeId==userTypeId, true)) { + + await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now }); await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new UserRole() { Status = UserStateEnum.Enable }); diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 15d4c4cbe..36b1f6f31 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -2656,7 +2656,30 @@ namespace IRaCIS.Core.Infra.EFCore.Common } ); } + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(IdentityUser))) + { + var type = GetEntityAuditOpt(item); + var entity = item.Entity as IdentityUser; + + var extraIdentification = string.Empty; + + //保存其他个性化配置 + if (_userInfo.RequestUrl == "UserWLTemplate/setAutoCutNextTask") + { + extraIdentification = "/Personalization"; + } + + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + IsDistinctionInterface = false, + ExtraIndentification = extraIdentification + }, new + { + UserRealName = entity.FullName, + } + ); + } //分配规则