修改一版
parent
8e94426f1a
commit
5be770e2bb
|
@ -5618,6 +5618,13 @@
|
||||||
<summary>
|
<summary>
|
||||||
获取项目的阅片问题
|
获取项目的阅片问题
|
||||||
</summary>
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
SinglePage 单页
|
||||||
|
|
||||||
|
MultiPage 多页
|
||||||
|
|
||||||
|
PublicPage 公共
|
||||||
|
</remarks>
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
|
|
@ -296,6 +296,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public JudgeTypeEnum JudgeType { get; set; }
|
public JudgeTypeEnum JudgeType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GetTrialReadingQuestionPageDto
|
||||||
|
{
|
||||||
|
public List<GetTrialReadingQuestionOutDto> SinglePage { get; set; }
|
||||||
|
|
||||||
|
public List<GetTrialReadingQuestionOutDto> MultiPage { get; set; }
|
||||||
|
|
||||||
|
public List<GetTrialReadingQuestionOutDto> PublicPage{ get; set; }
|
||||||
|
}
|
||||||
public class GetTrialReadingQuestionOutDto
|
public class GetTrialReadingQuestionOutDto
|
||||||
{
|
{
|
||||||
public Guid ReadingQuestionTrialId { get; set; }
|
public Guid ReadingQuestionTrialId { get; set; }
|
||||||
|
|
|
@ -78,6 +78,7 @@ namespace IRaCIS.Application.Services
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取下一个阅片任务
|
/// 获取下一个阅片任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
@ -292,12 +293,19 @@ namespace IRaCIS.Application.Services
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取项目的阅片问题
|
/// 获取项目的阅片问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// SinglePage 单页
|
||||||
|
///
|
||||||
|
/// MultiPage 多页
|
||||||
|
///
|
||||||
|
/// PublicPage 公共
|
||||||
|
/// </remarks>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<(List<GetTrialReadingQuestionOutDto>, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
public async Task<(GetTrialReadingQuestionPageDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
|
||||||
{
|
{
|
||||||
|
var result = new GetTrialReadingQuestionPageDto();
|
||||||
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)
|
||||||
|
|
||||||
|
@ -326,9 +334,6 @@ namespace IRaCIS.Application.Services
|
||||||
IsPublicPage=leftpage.IsPublicPage,
|
IsPublicPage=leftpage.IsPublicPage,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
|
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync();
|
var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync();
|
||||||
|
@ -340,50 +345,73 @@ namespace IRaCIS.Application.Services
|
||||||
var readingCriterionPageIds = qusetionList.OrderBy(x => x.PageShowOrder).Select(x => x.ReadingCriterionPageId).Distinct().ToList();
|
var readingCriterionPageIds = qusetionList.OrderBy(x => x.PageShowOrder).Select(x => x.ReadingCriterionPageId).Distinct().ToList();
|
||||||
foreach (var item in readingCriterionPageIds)
|
foreach (var item in readingCriterionPageIds)
|
||||||
{
|
{
|
||||||
|
|
||||||
var newPageQusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == item).ToList();
|
var newPageQusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == item).ToList();
|
||||||
|
|
||||||
var firstData = newPageQusetionList.FirstOrDefault();
|
var firstData = newPageQusetionList.FirstOrDefault();
|
||||||
var page = new GetTrialReadingQuestionOutDto()
|
var page = new GetTrialReadingQuestionOutDto()
|
||||||
{
|
{
|
||||||
|
|
||||||
PageName = firstData.PageName,
|
PageName = firstData.PageName,
|
||||||
IsPage = true,
|
IsPage = true,
|
||||||
IsPublicPage = firstData.IsPublicPage,
|
IsPublicPage = firstData.IsPublicPage,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
var pageGroupList = newPageQusetionList.Where(x => x.Type == "group").ToList();
|
||||||
var pageGroupList = newPageQusetionList.Where(x => x.Type == "group").ToList();
|
if (pageGroupList.Count()!=0)
|
||||||
pageGroupList.ForEach(x =>
|
|
||||||
{
|
{
|
||||||
x.Childrens = newPageQusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList();
|
pageGroupList.ForEach(x =>
|
||||||
x.Childrens.ForEach(z =>
|
|
||||||
{
|
{
|
||||||
this.FindChildQuestion(z, newPageQusetionList);
|
x.Childrens = newPageQusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList();
|
||||||
|
x.Childrens.ForEach(z =>
|
||||||
|
{
|
||||||
|
this.FindChildQuestion(z, newPageQusetionList);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
firstData.Childrens = pageGroupList;
|
else
|
||||||
groupList.Add(firstData);
|
{
|
||||||
|
pageGroupList = newPageQusetionList.Where(x => x.ParentId == null).ToList();
|
||||||
|
pageGroupList.ForEach(x =>
|
||||||
|
{
|
||||||
|
this.FindChildQuestion(x, newPageQusetionList);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
page.Childrens = pageGroupList;
|
||||||
|
groupList.Add(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result.PublicPage = groupList.Where(x => x.IsPublicPage.Value).ToList();
|
||||||
|
result.MultiPage= groupList.Where(x => !x.IsPublicPage.Value).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
|
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
|
||||||
groupList = qusetionList.Where(x => x.Type == "group").ToList();
|
groupList = qusetionList.Where(x => x.Type == "group").ToList();
|
||||||
|
|
||||||
groupList.ForEach(x =>
|
|
||||||
{
|
|
||||||
x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList();
|
|
||||||
|
|
||||||
x.Childrens.ForEach(z =>
|
if (groupList.Count() != 0)
|
||||||
|
{
|
||||||
|
groupList.ForEach(x =>
|
||||||
{
|
{
|
||||||
this.FindChildQuestion(z, qusetionList);
|
x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList();
|
||||||
|
|
||||||
|
x.Childrens.ForEach(z =>
|
||||||
|
{
|
||||||
|
this.FindChildQuestion(z, qusetionList);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
groupList = qusetionList.Where(x => x.ParentId == null).ToList();
|
||||||
|
groupList.ForEach(x =>
|
||||||
|
{
|
||||||
|
this.FindChildQuestion(x, qusetionList);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
}
|
||||||
|
|
||||||
|
result.SinglePage = groupList;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -397,7 +425,7 @@ namespace IRaCIS.Application.Services
|
||||||
//{
|
//{
|
||||||
// this.FindChildQuestion(x, qusetionList);
|
// this.FindChildQuestion(x, qusetionList);
|
||||||
//});
|
//});
|
||||||
return (groupList, new
|
return (result, new
|
||||||
{
|
{
|
||||||
readingTaskState = readingTaskState,
|
readingTaskState = readingTaskState,
|
||||||
FormType= formType
|
FormType= formType
|
||||||
|
|
Loading…
Reference in New Issue