修改一版
parent
3773e530e9
commit
57bce07622
|
@ -353,6 +353,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Answer { get; set; }
|
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; }
|
public List<GetTrialReadingQuestionOutDto> Childrens { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public string PageName { get; set; }
|
public string PageName { get; set; }
|
||||||
public bool IsEnable { get; set; }
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
|
public int ShowOrder { get; set; } = 0;
|
||||||
public Guid ReadingQuestionCriterionTrialId{ get; set; }
|
public Guid ReadingQuestionCriterionTrialId{ get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -297,6 +297,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)
|
||||||
|
|
||||||
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()
|
||||||
|
@ -312,18 +313,35 @@ namespace IRaCIS.Application.Services
|
||||||
ShowOrder=data.ShowOrder,
|
ShowOrder=data.ShowOrder,
|
||||||
ParentId=data.ParentId,
|
ParentId=data.ParentId,
|
||||||
TypeValue=data.TypeValue,
|
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 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>();
|
||||||
|
|
||||||
|
if (formType == FormType.MultiplePage)
|
||||||
|
{
|
||||||
|
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId != null).ToList();
|
||||||
|
|
||||||
|
//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 =>
|
groupList.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null&& y.Type != "group").ToList();
|
x.Childrens = qusetionList.Where(y => y.GroupName == x.GroupName && y.ParentId == null && y.Type != "group").ToList();
|
||||||
|
|
||||||
x.Childrens.ForEach(z =>
|
x.Childrens.ForEach(z =>
|
||||||
{
|
{
|
||||||
|
@ -331,6 +349,8 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -344,8 +364,10 @@ namespace IRaCIS.Application.Services
|
||||||
//});
|
//});
|
||||||
return (groupList, new
|
return (groupList, new
|
||||||
{
|
{
|
||||||
readingTaskState = readingTaskState
|
readingTaskState = readingTaskState,
|
||||||
});
|
FormType= formType
|
||||||
|
|
||||||
|
}); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -406,6 +406,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsPublicPage { get; set; }
|
public bool IsPublicPage { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public int ShowOrder { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建时间
|
/// 创建时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application
|
||||||
public async Task<GetTrialReadingCriterionInfoOutDto> GetTrialReadingCriterionInfo(GetTrialReadingInfoInDto inDto)
|
public async Task<GetTrialReadingCriterionInfoOutDto> GetTrialReadingCriterionInfo(GetTrialReadingInfoInDto inDto)
|
||||||
{
|
{
|
||||||
GetTrialReadingCriterionInfoOutDto result = new GetTrialReadingCriterionInfoOutDto();
|
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();
|
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();
|
result.ReadingInfoSignTime = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x=>x.ReadingInfoSignTime).FirstOrDefaultAsync();
|
||||||
if (trialCriterion != null)
|
if (trialCriterion != null)
|
||||||
|
@ -127,14 +127,10 @@ namespace IRaCIS.Core.Application
|
||||||
result.FormType = trialCriterion.FormType;
|
result.FormType = trialCriterion.FormType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
result.TrialQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.TrialId == inDto.TrialId&&x.ReadingQuestionCriterionTrialId == result.TrialCriterionId
|
result.TrialQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.TrialId == inDto.TrialId&&x.ReadingQuestionCriterionTrialId == result.TrialCriterionId
|
||||||
&&x.ReadingCriterionPageId==null)
|
&&x.ReadingCriterionPageId==null)
|
||||||
.ProjectTo<TrialReadQuestion>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
.ProjectTo<TrialReadQuestion>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsPublicPage { get; set; } = false;
|
public bool IsPublicPage { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序
|
||||||
|
/// </summary>
|
||||||
|
public int ShowOrder { get; set; } = 0;
|
||||||
|
|
||||||
|
|
||||||
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue