From a7ed38f03beaa7b462113c21038c80c6e5e69ddf Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Sun, 28 Sep 2025 12:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8F=AF=E6=8F=92?= =?UTF-8?q?=E5=85=A5null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ReadingCalculate/PCWG3CalculateService.cs | 2 +- .../Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs | 2 +- .../Interceptor/AuditEntityInterceptor.cs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) 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) {