From fa3df97dab4e2a01ac03f64db22084774c50c1ea Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 1 Sep 2025 11:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/FrontAuditConfigService.cs | 8 +++++++- IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 8f567fe36..7cea438a1 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.Service IRepository _dictionaryRepository, IRepository _trialRepository, IRepository _userRoleRepository, - + IRepository _identityUserRepository, IRepository _checkChallengeDialogRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IFrontAuditConfigService { @@ -364,12 +364,18 @@ namespace IRaCIS.Core.Application.Service var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.IdentityUser.FullName, t.IdentityUser.Phone, t.IdentityUser.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.UserTypeEnum, t.IdentityUser.EMail, t.IdentityUser.OrganizationName }).FirstOrDefaultAsync(); + var identityUserObj = await _identityUserRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.FullName, t.Phone, t.UserName, }).FirstOrDefaultAsync(); + // 为什么要查用户 因为表dataInspection 中有用户的稽查 但是用户名为空 if (userObj != null) { objectLsit.Add(userObj); } + else if (identityUserObj != null) + { + objectLsit.Add(identityUserObj); + } else if (relationParentInspection != null) { diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 3a9b5b22f..e00f18952 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1587,7 +1587,20 @@ namespace IRaCIS.Core.Infra.EFCore.Common }); } + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialIdentityUser))) + { + var type = GetEntityAuditOpt(item); + var entity = item.Entity as TrialIdentityUser; + //var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId); + await InsertInspection(entity, type, x => new InspectionConvertDTO + { + IsDistinctionInterface = type == AuditOpt.Update ? true : false, + TrialId = x.TrialId, + ObjectRelationParentId = x.TrialId, + ObjectRelationParentId2 = x.IdentityUserId, + }); + } // 项目人员 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialUserRole)))