修改一版
parent
1b0827b04e
commit
3ee005e93d
|
@ -296,7 +296,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
|
||||||
var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync();
|
var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync();
|
||||||
var query= from data in _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId==inDto.ReadingQuestionCriterionTrialId)
|
var query= from data in _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId==inDto.ReadingQuestionCriterionTrialId&&x.Type!= "group")
|
||||||
join questionAnswer in _readingTaskQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId) on data.Id equals questionAnswer.ReadingQuestionTrialId into questionAnswerTemp
|
join questionAnswer in _readingTaskQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId) on data.Id equals questionAnswer.ReadingQuestionTrialId into questionAnswerTemp
|
||||||
from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty()
|
from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty()
|
||||||
select new GetTrialReadingQuestionOutDto()
|
select new GetTrialReadingQuestionOutDto()
|
||||||
|
@ -319,29 +319,29 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
|
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
var groupList = qusetionList.Where(x => x.Type == "group").ToList();
|
//var groupList = qusetionList.Where(x => x.Type == "group").ToList();
|
||||||
|
|
||||||
groupList.ForEach(x =>
|
|
||||||
{
|
|
||||||
x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null).ToList();
|
|
||||||
|
|
||||||
x.Childrens.ForEach(z =>
|
|
||||||
{
|
|
||||||
this.FindChildQuestion(z, qusetionList);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//List<GetTrialReadingQuestionOutDto> groupList = qusetionList.Where(x => x.ParentId == null).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//groupList.ForEach(x =>
|
//groupList.ForEach(x =>
|
||||||
//{
|
//{
|
||||||
// this.FindChildQuestion(x, qusetionList);
|
// x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null).ToList();
|
||||||
|
|
||||||
|
// x.Childrens.ForEach(z =>
|
||||||
|
// {
|
||||||
|
// this.FindChildQuestion(z, qusetionList);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
//});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<GetTrialReadingQuestionOutDto> groupList = qusetionList.Where(x => x.ParentId == null).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
groupList.ForEach(x =>
|
||||||
|
{
|
||||||
|
this.FindChildQuestion(x, qusetionList);
|
||||||
|
});
|
||||||
return (groupList, new
|
return (groupList, new
|
||||||
{
|
{
|
||||||
readingTaskState = readingTaskState
|
readingTaskState = readingTaskState
|
||||||
|
|
Loading…
Reference in New Issue