diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index bf0071dc..e2bde77f 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -1112,7 +1112,10 @@ namespace IRaCIS.Core.Application.Image.QA var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException(); - VerifyIsCanQC(dbSubjectVisit); + if (dbSubjectVisit.PreliminaryAuditUserId != null) + { + throw new BusinessValidationFailedException("当前访视已审核通过,不允许操作"); + } var trialConfig = await _trialRepository .Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification }) diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 9f39b731..30ab7b05 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -23,7 +23,9 @@ namespace IRaCIS.Application.Services public string Get(testModel testModel) { - var tt= _dicRepository.UpdateFromQueryAsync(Guid.Parse("e2b97a6c-35a6-4aa3-7f27-08da13ab33ff"), t => new Dictionary() { Description = "xxxxx"}, true).Result; + var waitModifyEntity= _dicRepository.FirstOrDefaultAsync(t=>t.Id== Guid.Parse("e2b97a6c-35a6-4aa3-7f27-08da13ab33ff")).GetAwaiter().GetResult(); + + var tt= _dicRepository.UpdateAsync(waitModifyEntity, t => new Dictionary() { Description = "xxxxx"}, true).Result; //var d = _repository.Where(t => t.FullName.Contains("cc")).Select(t => t.FullName).FirstOrDefault(); diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index c1ccc8cd..e4050c9a 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -387,14 +387,6 @@ namespace IRaCIS.Core.Infra.EFCore updateEntity1.UpdateUserId = _userInfo.Id; } - if (t.Entity is ISoftDelete updateEntity2) - { - if (updateEntity2.IsDeleted == true) - { - updateEntity2.DeletedTime = DateTime.UtcNow.AddHours(8); - } - } - break; //添加的时候,更新审计字段也赋值 diff --git a/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditUpdateTrigger.cs b/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditUpdateTrigger.cs index 4a57c64f..496a6013 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditUpdateTrigger.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditUpdateTrigger.cs @@ -7,7 +7,7 @@ using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Triggers { - public class AuditUpdateTrigger: IBeforeSaveTrigger + public class AuditUpdateTrigger : IBeforeSaveTrigger { private readonly IUserInfo _userInfo; @@ -18,10 +18,12 @@ namespace IRaCIS.Core.Application.Triggers public Task BeforeSave(ITriggerContext context, CancellationToken cancellationToken) { - if (context.ChangeType == ChangeType.Modified|| context.ChangeType == ChangeType.Added) + if (context.ChangeType == ChangeType.Modified || context.ChangeType == ChangeType.Added) { + context.Entity.UpdateTime = DateTime.UtcNow.AddHours(8); + context.Entity.UpdateUserId = _userInfo.Id; - context.Entity.UpdateTime=DateTime.UtcNow.AddHours(8); + } return Task.CompletedTask;