添加默认值

This commit is contained in:
he
2022-11-01 13:54:13 +08:00
parent c802b7cb1c
commit bd998673f7
2 changed files with 17 additions and 1 deletions
@@ -327,7 +327,8 @@ namespace IRaCIS.Application.Services
private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item, List<DicomReadingQuestionAnswer> questions, List<ReadingTaskQuestionAnswer> answers)
{
item.Answer = answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
var answer = answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
item.Answer = answer.IsNullOrEmpty()?item.DefaultValue: answer;
item.Childrens = questions.Where(x => x.ParentId == item.Id || ((item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName))).ToList();
if (item.Childrens != null && item.Childrens.Count > 0)
{