From d63af2ed2038f6baa89827a428b6a5aaf649f55c Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Thu, 19 Jun 2025 16:33:21 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=BD=E6=9F=A5=E7=9A=84?=
=?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 | 30 ++++++++++++++++---
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 4f4436c74..10dfbb2a4 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -83,7 +83,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
}
+ ///
+ /// 翻译单位
+ ///
+ /// 答案类型
+ /// 单位
+ /// 自定义单位
+ /// 单位字典
+ /// 答案
+ ///
+ public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List unitDataList,string? answer)
+ {
+ if (answerType == "upload")
+ {
+ return "❄❅❆❇❈❉❊";
+ }
+ if (unit == ValueUnit.Custom)
+ {
+ return answer + customUnit;
+ }
+
+ return answer + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty();
+ }
public string GetEntityAuditOpt(EntityEntry entityEntry)
{
if (entityEntry.State == EntityState.Added)
@@ -3026,6 +3048,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();
@@ -3073,7 +3096,7 @@ 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,
@@ -3104,8 +3127,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,
@@ -3233,7 +3255,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,