修改稽查的单位翻译
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
3bd16d7fce
commit
e7bbf09a50
|
@ -83,7 +83,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 翻译单位
|
||||
/// </summary>
|
||||
/// <param name="answerType">答案类型</param>
|
||||
/// <param name="unit">单位</param>
|
||||
/// <param name="customUnit">自定义单位</param>
|
||||
/// <param name="unitDataList">单位字典</param>
|
||||
/// <param name="answer">答案</param>
|
||||
/// <returns></returns>
|
||||
public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List<UnitData> 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,
|
||||
|
|
Loading…
Reference in New Issue