From 3f6ec5b7ea9840ac2eaefbdc8a77f9f60cb2e280 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 5 Jun 2024 17:13:13 +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 --- .../Reading/Dto/ReadingQuestionViewModel.cs | 4 ++ .../Common/AuditingData.cs | 38 ++++++++++++++++--- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 49b94f3ca..e7cada86e 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -328,6 +328,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public CustomCalculateMark? CustomCalculateMark { get; set; } + /// + /// TrialId + /// + public Guid TrialId { get; set; } /// /// IsDepend diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index e088c3be6..167b1f98b 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -76,15 +76,36 @@ namespace IRaCIS.Core.Infra.EFCore.Common } } + // 修改为删除 + private List UpdateIsDelete + { + get + { + return new List() + { + typeof(TrialDocument) + }; + } + } - public string GetEntityAuditOpt(EntityEntry entityEntry) + + public string GetEntityAuditOpt(EntityEntry entityEntry) { if (entityEntry.State == EntityState.Added) { return AuditOpt.Add; } + else if ( + UpdateIsDelete.Contains(entityEntry.Entity.GetType()) + && entityEntry.State == EntityState.Modified + && (bool)entityEntry.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(entityEntry.Entity) - else if (entityEntry.State == EntityState.Deleted || + ) + { + return AuditOpt.Deleted; + } + + else if (entityEntry.State == EntityState.Deleted || (entityEntry.State == EntityState.Modified && typeof(ISoftDelete).IsAssignableFrom(entityEntry.Entity.GetType()) && (bool)entityEntry.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(entityEntry.Entity) @@ -224,8 +245,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common //项目流程确认 || _userInfo.RequestUrl == "configTrialBasicInfo/ConfigTrialProcessInfoConfirm" - //阅片单元 保存阅片规则 - || _userInfo.RequestUrl == "TrialConfig/setCriterionReadingInfo" + //确认医学审核问题 + || _userInfo.RequestUrl == "ReadingMedicineQuestion/ConfirmReadingMedicineQuestion" + + //阅片单元 保存阅片规则 + || _userInfo.RequestUrl == "TrialConfig/setCriterionReadingInfo" || _userInfo.RequestUrl == "configTrialBasicInfo/TrialReadingInfoSign") { @@ -447,10 +471,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common dependQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.DependParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync(); } - await InsertInspection(entity, type, x => new InspectionConvertDTO() + + + await InsertInspection(entity, type, x => new InspectionConvertDTO() { IsDistinctionInterface = false, + TrialId=x.TrialId, + TrialReadingCriterionId = entity.TrialCriterionId, ObjectRelationParentId = x.TrialId,