From 7189ea563ce7900b422cc1b48f5b196e6725eeae Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 10 Jul 2025 10:50:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E7=AD=94=E6=A1=88=E4=BF=AE?= =?UTF-8?q?=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, 34 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 87f8e09e0..08bebd02a 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -101,6 +101,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List unitDataList, string? answer) { + if (answer == null|| answer==string.Empty) + { + return string.Empty; + } + if (answerType == "upload") { return "❄❅❆❇❈❉❊"; @@ -3234,9 +3239,37 @@ namespace IRaCIS.Core.Infra.EFCore.Common .Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).FirstOrDefault(); var answer = string.Empty; + + + if (tableQuestionAnswer != null) { - answer = tableQuestionAnswer.Answer; + + + 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(); + + 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(); + + answer = Translationunit(tableQuesionList.AnswerType, tableQuesionList.Unit, tableQuesionList.CustomUnit, unitDataList, tableQuestionAnswer.Answer) ; } var rowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(x => x.Id == entity.RowId).Select(x => x.RowMark).FirstOrDefaultAsync();