From 9239cc490b758b94adce2a131b25b36fc8b50668 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 15 Jul 2025 15:02:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/AuditingData.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 07727f137..8d5c3ffee 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -3229,6 +3229,37 @@ namespace IRaCIS.Core.Infra.EFCore.Common } + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer))) + { + if (_userInfo.RequestUrl == "saveTableQuestionMark/-10") + { + var type = GetEntityAuditOpt(item); + + var entity = item.Entity as ReadingTableQuestionAnswer; + + var tableQuestionName = await _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync(); + var questionName = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync(); + var generalId = IdentifierHelper.CreateGuid(entity.VisitTaskId.ToString(), entity.QuestionId.ToString(), entity.RowId.ToString(), entity.TableQuestionId.ToString(), "ReadingTableQuestionAnswer"); + var rowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(x => x.Id == entity.RowId).Select(x => x.RowMark).FirstOrDefaultAsync(); + + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + VisitTaskId = entity.VisitTaskId, + GeneralId = generalId, + ObjectRelationParentId = entity.VisitTaskId, + + + }, new + { + QuestionName = questionName, + RowMark = rowMark, + TableQuestionName = tableQuestionName, + }, _userInfo.AuditIdentification); + } + + } + + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionMark))) { var type = GetEntityAuditOpt(item); @@ -3283,6 +3314,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common { generalId = entity.Id; } + else if(entity.MarkId!=null) + { + generalId= entity.MarkId.Value; + } else { generalId = IdentifierHelper.CreateGuid(entity.VisitTaskId.ToString(), entity.QuestionId.ToString(), entity.RowId.ToString(), entity.TableQuestionId.ToString(), "ReadingTaskQuestionMark");