修改一版

Uat_Study
he 2022-07-14 09:13:53 +08:00
parent 3773e530e9
commit 57bce07622
6 changed files with 53 additions and 15 deletions

View File

@ -353,6 +353,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public string Answer { get; set; }
/// <summary>
/// 分页名称
/// </summary>
public string PageName { get; set; }
/// <summary>
/// 标准分页Id
/// </summary>
public Guid? ReadingCriterionPageId { get; set; }
public List<GetTrialReadingQuestionOutDto> Childrens { get; set; }
}

View File

@ -35,6 +35,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string PageName { get; set; }
public bool IsEnable { get; set; }
public int ShowOrder { get; set; } = 0;
public Guid ReadingQuestionCriterionTrialId{ get; set; }
/// <summary>

View File

@ -297,6 +297,7 @@ namespace IRaCIS.Application.Services
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)
join questionAnswer in _readingTaskQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId) on data.Id equals questionAnswer.ReadingQuestionTrialId into questionAnswerTemp
from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty()
select new GetTrialReadingQuestionOutDto()
@ -312,25 +313,44 @@ namespace IRaCIS.Application.Services
ShowOrder=data.ShowOrder,
ParentId=data.ParentId,
TypeValue=data.TypeValue,
Answer= leftquestionAnswer.Answer
Answer= leftquestionAnswer.Answer,
ReadingCriterionPageId=data.ReadingCriterionPageId,
PageName= data.ReadingCriterionPage.PageName,
};
var qusetionList =await query.OrderBy(x=>x.ShowOrder).ToListAsync();
var groupList = qusetionList.Where(x => x.Type == "group").ToList();
var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync();
var groupList = new List<GetTrialReadingQuestionOutDto>();
groupList.ForEach(x =>
if (formType == FormType.MultiplePage)
{
x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null&& y.Type != "group").ToList();
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId != null).ToList();
x.Childrens.ForEach(z =>
//var readingCriterionPageIds= qusetionList.Select(x=>x.)
}
else
{
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
groupList = qusetionList.Where(x => x.Type == "group").ToList();
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);
});
});
}
@ -344,8 +364,10 @@ namespace IRaCIS.Application.Services
//});
return (groupList, new
{
readingTaskState = readingTaskState
});
readingTaskState = readingTaskState,
FormType= formType
}); ;
}
/// <summary>

View File

@ -406,6 +406,9 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary>
public bool IsPublicPage { get; set; }
public int ShowOrder { get; set; }
/// <summary>
/// 创建时间
/// </summary>

View File

@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application
public async Task<GetTrialReadingCriterionInfoOutDto> GetTrialReadingCriterionInfo(GetTrialReadingInfoInDto inDto)
{
GetTrialReadingCriterionInfoOutDto result = new GetTrialReadingCriterionInfoOutDto();
result.ReadingCriterionPageList = await _readingCriterionPageRepository.Where(x => x.TrialId == inDto.TrialId).ProjectTo<ReadingCriterionPageDto>(_mapper.ConfigurationProvider).ToListAsync();
result.ReadingCriterionPageList = await _readingCriterionPageRepository.Where(x => x.TrialId == inDto.TrialId).ProjectTo<ReadingCriterionPageDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
result.ReadingInfoSignTime = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x=>x.ReadingInfoSignTime).FirstOrDefaultAsync();
if (trialCriterion != null)
@ -127,14 +127,10 @@ namespace IRaCIS.Core.Application
result.FormType = trialCriterion.FormType;
};
result.TrialQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.TrialId == inDto.TrialId&&x.ReadingQuestionCriterionTrialId == result.TrialCriterionId
&&x.ReadingCriterionPageId==null)
.ProjectTo<TrialReadQuestion>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
return result;
}

View File

@ -48,6 +48,11 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public bool IsPublicPage { get; set; } = false;
/// <summary>
/// 排序
/// </summary>
public int ShowOrder { get; set; } = 0;
public Guid ReadingQuestionCriterionTrialId { get; set; }