From 14499009b6df6b864e807c53716cef93b70db9de Mon Sep 17 00:00:00 2001 From: Hewt <109787524@qq.com> Date: Tue, 24 Mar 2026 10:18:37 +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 | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 4322faad7..e14ac344c 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -3654,8 +3654,93 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as SegmentBinding; + var tableQuestionAnswer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(x => x.Entity as ReadingTableQuestionAnswer) + .Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).FirstOrDefault(); + var answer = string.Empty; + + List unitDataList = (await _dbContext.Dictionary.Where(x => x.Parent.Code == "ValueUnit").Where(x => x.Code != "0").ToListAsync()).Select(x => new UnitData() + { + + Unit = (ValueUnit)int.Parse(x.Code), + UnitName = x.Value.ToString(), + }).ToList(); + if (tableQuestionAnswer != null) + { + + + var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => t.Id == tableQuestionAnswer.TableQuestionId).Select(t => + new + { + TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id + Type = t.ReadingQuestionTrial.QuestionName, //病灶类型 + t.Unit, + t.CustomUnit, + t.DictionaryCode, + t.QuestionName, + t.QuestionEnName, + QuestionId = t.Id, + t.ShowOrder, + AnswerType = t.Type, + }) + .OrderBy(t => t.ShowOrder).FirstOrDefaultAsync(); + + + answer = Translationunit(tableQuesionList.AnswerType, tableQuesionList.Unit, tableQuesionList.CustomUnit, unitDataList, tableQuestionAnswer.Answer); + } + else + { + var questionAnswer= entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(x => x.Entity as ReadingTaskQuestionAnswer) + .Where(x => x.VisitTaskId == entity.VisitTaskId && x.ReadingQuestionTrialId == entity.QuestionId).FirstOrDefault(); + + var quesionInfo = await _dbContext.ReadingQuestionTrial.Where(t => t.Id == questionAnswer.ReadingQuestionTrialId).Select(t => + new + { + + t.Unit, + t.CustomUnit, + t.DictionaryCode, + t.QuestionName, + t.QuestionEnName, + QuestionId = t.Id, + t.ShowOrder, + AnswerType = t.Type, + }) + .OrderBy(t => t.ShowOrder).FirstOrDefaultAsync(); + + answer = Translationunit(quesionInfo.AnswerType, quesionInfo.Unit, quesionInfo.CustomUnit, unitDataList, questionAnswer.Answer); + } + + var rowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(x => x.Id == entity.RowId).Select(x => x.RowMark).FirstOrDefaultAsync(); + + + + + var segmentation = await _dbContext.Segmentation.Where(x => x.Id == entity.SegmentationId).FirstOrDefaultAsync()?? new Segmentation() { }; + + var segment= await _dbContext.Segment.Where(x => x.Id == entity.SegmentId).FirstOrDefaultAsync()?? new Segment() { }; + + 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(); + + + + + + await InsertInspection(entity, type, x => new InspectionConvertDTO() { + },new + { + segmentation.SegmentationName, + segmentation.SEGUrl, + segment.SegmentName, + segment.SegmentMumber, + segment.ColorRgb, + + QuestionName = questionName, + RowMark = rowMark, + TableQuestionName = tableQuestionName, + Answer = answer, }); }