修改一版

Uat_Study
he 2022-07-04 14:51:48 +08:00
parent bee1ebe768
commit e60ccc0083
1 changed files with 24 additions and 21 deletions

View File

@ -149,10 +149,10 @@ namespace IRaCIS.Core.Application.Service
} }
#region 问题
private async Task<List<ReadingMedicineQuestion>> GetMedicalQuestionAnswer(GetMedicalReviewReadingTaskInDto inDto) private async Task<List<ReadingMedicineQuestion>> GetMedicalQuestionAnswer(GetMedicalReviewReadingTaskInDto inDto)
{ {
var questionQuery = from data in _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsConfirm&&x.IsEnable) var questionQuery = from data in _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm && x.IsEnable)
join questionAnswer in _readingMedicineQuestionAnswerRepository.Where(x => x.TaskMedicalReviewId == inDto.TaskMedicalReviewId) on data.Id equals questionAnswer.ReadingMedicineQuestionId into questionAnswerTemp join questionAnswer in _readingMedicineQuestionAnswerRepository.Where(x => x.TaskMedicalReviewId == inDto.TaskMedicalReviewId) on data.Id equals questionAnswer.ReadingMedicineQuestionId into questionAnswerTemp
from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty() from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty()
select new ReadingMedicineQuestion() select new ReadingMedicineQuestion()
@ -160,8 +160,8 @@ namespace IRaCIS.Core.Application.Service
MedicineQuestionId = data.Id, MedicineQuestionId = data.Id,
Type = data.Type, Type = data.Type,
ParentTriggerValue = data.ParentTriggerValue, ParentTriggerValue = data.ParentTriggerValue,
IsEnable=data.IsEnable, IsEnable = data.IsEnable,
IsConfirm=data.IsConfirm, IsConfirm = data.IsConfirm,
QuestionName = data.QuestionName, QuestionName = data.QuestionName,
IsRequired = data.IsRequired, IsRequired = data.IsRequired,
ShowOrder = data.ShowOrder, ShowOrder = data.ShowOrder,
@ -170,9 +170,9 @@ namespace IRaCIS.Core.Application.Service
Answer = leftquestionAnswer.Answer Answer = leftquestionAnswer.Answer
}; };
var questionList = await questionQuery.ToListAsync(); var questionList = await questionQuery.OrderBy(x=>x.ShowOrder).ToListAsync();
List < ReadingMedicineQuestion > medicineQuestionList = questionList.Where(x => x.ParentId == null).ToList(); List<ReadingMedicineQuestion> medicineQuestionList = questionList.Where(x => x.ParentId == null).ToList();
medicineQuestionList.ForEach(x => medicineQuestionList.ForEach(x =>
{ {
FindChildQuestion(x, questionList); FindChildQuestion(x, questionList);
@ -193,6 +193,9 @@ namespace IRaCIS.Core.Application.Service
}); });
} }
} }
#endregion
/// <summary> /// <summary>
/// 保存医学审核问题 /// 保存医学审核问题