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