diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 186af7474..b073825ec 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -2820,8 +2820,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).Where(t => t.RowId == entity.Id).ToList(); - //获取表格问题名称 组合成数组 - var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => + 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(); + + //获取表格问题名称 组合成数组 + var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => new { TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id @@ -2886,7 +2893,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common new { //如果问题类型是附件 特殊处理 方便前端解析 - Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, + Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer+ unitDataList.Where(y=>y.Unit==u.Unit).Select(x=>x.UnitName).FirstIsNullReturnEmpty(), //t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/, u.QuestionName, u.QuestionEnName, diff --git a/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs b/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs index 2534fb6f9..501f81324 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Infra.EFCore.Common.Dto { @@ -97,6 +98,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto public Guid ChildId { get; set; } } + + public class UnitData + { + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } + + public string UnitName { get; set; } + } + /// /// 稽查数据 ///