From 05be768188401a25b6461fc2a9131edad80049f6 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Tue, 9 Sep 2025 17:07:05 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E7=BF=BB=E8=AF=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Common/AuditingData.cs | 40 ++++++++++++++++---
1 file changed, 35 insertions(+), 5 deletions(-)
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 520d5bab0..78b5d4f3b 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -72,6 +72,35 @@ 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 "❄❅❆❇❈❉❊" + answer;
+ }
+
+ if (unit == ValueUnit.Custom)
+ {
+ return answer + string.Empty + customUnit;
+ }
+
+ return answer + string.Empty + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty();
+ }
+
// 修改为删除
private List UpdateIsDelete
{
@@ -250,7 +279,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
ClinicalDataSetNames = string.Join(",", clinicalDataSetNameList.Union(memoryClinicalDataSetNameList).Distinct().OrderBy(t => t)),
- }); ;
+ });
}
#region 已修改
@@ -2808,6 +2837,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
QuestionId = t.Id,
t.DictionaryCode,
t.Unit,
+ t.CustomUnit,
t.ShowOrder,
AnswerType = t.Type,
}).OrderBy(t => t.ShowOrder).ToListAsync();
@@ -2855,7 +2885,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
new
{
//如果问题类型是附件 特殊处理 方便前端解析
- Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer,
+ Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
+
u.QuestionName,
u.QuestionEnName,
u.DictionaryCode,
@@ -2886,8 +2917,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
(t, u) =>
new
{
- Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()
- ,
+ Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
u.DictionaryCode,
u.QuestionName,
u.QuestionEnName,
@@ -2990,7 +3020,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
new
{
//如果问题类型是附件 特殊处理 方便前端解析
- Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty(),
+ Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
u.QuestionName,
u.QuestionEnName,