From 538cfa279a02899f58fabe0cf19c19094f5f9ef1 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 13 Jan 2025 16:55:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=B4=E6=8A=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 2 +- IRaCIS.Core.Application/TestService.cs | 29 ++++++++++++------- .../Common/AuditingData.cs | 27 ++++++++++------- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index deb8964da..e60ae1639 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -928,7 +928,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType) .WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate) .WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate) - .WhereIf(inQuery.IsLoginUncommonly != null, t => t.IsLoginUncommonly == inQuery.IsLoginUncommonly) + .WhereIf(inQuery.IsLoginUncommonly != null, t => t.IsLoginUncommonly == inQuery.IsLoginUncommonly) .WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.ActionUserName.Contains(inQuery.LoginUserName!)) .WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.ActionUserName.Contains(inQuery.LoginFaildName!)) .WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!)) diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 40637ab18..02ce983d3 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -173,7 +173,14 @@ namespace IRaCIS.Core.Application.Service var identityUserId = NewId.NextSequentialGuid(); - var identityUser = _mapper.Map(item.FirstOrDefault()); + var selectUser = item.OrderByDescending(t => t.Status).FirstOrDefault(); + + var identityUser = _mapper.Map(selectUser); + + if (identityUser.IsFirstAdd) + { + identityUser.UserName = ""; + } identityUser.Id = identityUserId; @@ -185,15 +192,15 @@ namespace IRaCIS.Core.Application.Service await _identityUserRepository.SaveChangesAsync(); } - // UPDATE[User] - //SET - // UserName = IdentityUser.UserName, - // FirstName = IdentityUser.FirstName, - //LastName = IdentityUser.LastName, - // EMail = IdentityUser.EMail - //FROM[User] - //INNER JOIN IdentityUser - //ON[User].IdentityUserId = IdentityUser.Id + // UPDATE[User] + //SET + // UserName = IdentityUser.UserName, + // FirstName = IdentityUser.FirstName, + //LastName = IdentityUser.LastName, + // EMail = IdentityUser.EMail + //FROM[User] + //INNER JOIN IdentityUser + //ON[User].IdentityUserId = IdentityUser.Id @@ -365,7 +372,7 @@ namespace IRaCIS.Core.Application.Service ConfirmTime = confirm.ConfirmTime, RealName = confirm.ConfirmUser.FullName, UserName = confirm.ConfirmUser.UserName, - + FullFilePath = sysDoc.Path }; diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index d67cd6206..5b26cc019 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1729,16 +1729,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common }); } - foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(UserRole))) + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(IdentityUser))) { var type = GetEntityAuditOpt(item); - var entity = item.Entity as UserRole; - //var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId); - await InsertInspection(entity, type, x => new InspectionConvertDTO + var entity = item.Entity as IdentityUser; + + if (!_userInfo.IsNotNeedInspection) { - IsDistinctionInterface = type == AuditOpt.Update ? true : false, - }); + await InsertInspection(entity, type, x => new InspectionConvertDTO + { + IsDistinctionInterface = type == AuditOpt.Update ? true : false, + }); + } } // 项目参与人员 @@ -1764,7 +1767,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId = x.TrialId, ExtraIndentification = extraIndentification, //ObjectRelationParentId2 = x.IdentityUserId, - },new { + }, new + { identityUser.FullName, identityUser.EMail, @@ -1797,8 +1801,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId = x.TrialId, ExtraIndentification = extraIndentification, ObjectRelationParentId2 = x.UserId, - }, new { - UserTypeEnum= userTypeEnum, + }, new + { + UserTypeEnum = userTypeEnum, }); } @@ -3061,7 +3066,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as ReadingTaskQuestionMark; var answer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(x => x.Entity as ReadingTableQuestionAnswer) - .Where(x => x.RowId == entity.RowId&&x.TableQuestionId== entity.TableQuestionId).Select(x => x.Answer).FirstOrDefault(); + .Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).Select(x => x.Answer).FirstOrDefault(); var liverSegmentation = await _dbContext.ReadingTableQuestionAnswer.Where(x => x.RowId == entity.RowId && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.liverSegmentation).Select(x => x.Answer).FirstOrDefaultAsync(); @@ -3402,7 +3407,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common }; var extraIdentification = string.Empty; - var isDistinctionInterface = true ; + var isDistinctionInterface = true; #region 标识区分 if (type == AuditOpt.Add)