修改一版

Uat_Study
he 2022-07-26 17:38:29 +08:00
parent fa0a2b55b9
commit d5cf6b28e3
2 changed files with 56 additions and 1 deletions

View File

@ -362,7 +362,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class GetTrialReadingQuestionInDto
{
[NotDefault]
public Guid ReadingQuestionCriterionTrialId { get; set; }
public Guid ReadingQuestionCriterionSystemId { get; set; }
public Guid? VisitTaskId { get; set; }

View File

@ -41,6 +41,8 @@ namespace IRaCIS.Application.Services
private readonly IRepository<ReadModule> _readModuleRepository;
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystemRepository;
private readonly IRepository<ReadingQuestionSystem> _readingQuestionSystem;
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
@ -60,6 +62,8 @@ namespace IRaCIS.Application.Services
IRepository<ReadModule> readModuleRepository,
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystemRepository,
IRepository<ReadingQuestionSystem> ReadingQuestionSystem,
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository
)
{
@ -78,6 +82,8 @@ namespace IRaCIS.Application.Services
this._readModuleRepository = readModuleRepository;
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
this._readingQuestionCriterionSystemRepository = readingQuestionCriterionSystemRepository;
this._readingQuestionSystem = ReadingQuestionSystem;
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
}
@ -613,6 +619,55 @@ namespace IRaCIS.Application.Services
}
#endregion
#region 获取系统的阅片问题
/// <summary>
/// 获取系统的阅片问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<GetTrialReadingQuestionPageDto> GetSystemReadingQuestion(GetTrialReadingQuestionInDto inDto)
{
var result = new GetTrialReadingQuestionPageDto();
var query = from data in _readingQuestionSystem.Where(x => x.ReadingQuestionCriterionSystemId == inDto.ReadingQuestionCriterionSystemId)
select new GetTrialReadingQuestionOutDto()
{
ReadingQuestionTrialId = data.Id,
ParentTriggerValue = data.ParentTriggerValue,
GroupName = data.GroupName,
QuestionName = data.QuestionName,
IsRequired = data.IsRequired,
ShowOrder = data.ShowOrder,
ParentId = data.ParentId,
TypeValue = data.TypeValue,
Answer = string.Empty,
PageShowOrder = data.ShowOrder,
};
var qusetionList = await query.OrderBy(x => x.ShowOrder).ToListAsync();
var groupList = new List<GetTrialReadingQuestionOutDto>();
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
groupList.ForEach(x =>
{
this.FindChildQuestion(x, qusetionList);
});
groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
result.SinglePage = groupList;
return (result);
}
#endregion
#region 获取阅片任务和答案
/// <summary>
/// 获取阅片任务和答案