diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index 13aaf92d1..2d1800819 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -933,7 +933,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate needAddList.Add(new ReadingTaskQuestionAnswer() { Answer = item.Answer, - PCWGInterimAnswer=null, + ReadingQuestionTrialId = item.QuestionId, }); } diff --git a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs index 44ed242fb..d65ba823c 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs @@ -38,5 +38,5 @@ public class ReadingTaskQuestionAnswer : BaseAddAuditEntity /// /// PCWG 临时Answer /// - public string? PCWGInterimAnswer { get; set; } = null; + public string? PCWGInterimAnswer { get; set; } } diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs index 4a01ad4e7..451863fdd 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs @@ -87,12 +87,14 @@ public class AuditEntityInterceptor(IUserInfo _userInfo, //} // 检查属性是否为string类型,并且值为null - foreach (var property in entry.Properties.Where(t => t.Metadata.ClrType == typeof(string) && t.CurrentValue == null)) + + foreach (var property in entry.Properties.Where(t => t.Metadata.ClrType == typeof(string) && !t.Metadata.IsNullable && t.CurrentValue == null)) { property.CurrentValue = string.Empty; } + switch (entry.State) {