修改一版

Uat_Study
he 2022-08-25 16:12:01 +08:00
parent a37e2288f0
commit daf014576f
3 changed files with 18 additions and 17 deletions

View File

@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Contracts
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto); Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists);
Task<IResponseOutput> SubmitGlobalReadingInfo(SubmitGlobalReadingInfoInDto inDto); Task<IResponseOutput> SubmitGlobalReadingInfo(SubmitGlobalReadingInfoInDto inDto);

View File

@ -42,6 +42,7 @@ namespace IRaCIS.Application.Services
private readonly IRepository<ReadingJudgeInfo> _readingJudgeInfoRepository; private readonly IRepository<ReadingJudgeInfo> _readingJudgeInfoRepository;
private readonly IRepository<ReadModule> _readModuleRepository; private readonly IRepository<ReadModule> _readModuleRepository;
private readonly IRepository<ReadingTableQuestionSystem> _readingTableQuestionSystemRepository; private readonly IRepository<ReadingTableQuestionSystem> _readingTableQuestionSystemRepository;
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository; private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository; private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystemRepository; private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystemRepository;
@ -66,6 +67,7 @@ namespace IRaCIS.Application.Services
IRepository<ReadingJudgeInfo> readingJudgeInfoRepository, IRepository<ReadingJudgeInfo> readingJudgeInfoRepository,
IRepository<ReadModule> readModuleRepository, IRepository<ReadModule> readModuleRepository,
IRepository<ReadingTableQuestionSystem> readingTableQuestionSystemRepository, IRepository<ReadingTableQuestionSystem> readingTableQuestionSystemRepository,
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository, IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository, IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystemRepository, IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystemRepository,
@ -89,6 +91,7 @@ namespace IRaCIS.Application.Services
this._readingJudgeInfoRepository = readingJudgeInfoRepository; this._readingJudgeInfoRepository = readingJudgeInfoRepository;
this._readModuleRepository = readModuleRepository; this._readModuleRepository = readModuleRepository;
this._readingTableQuestionSystemRepository = readingTableQuestionSystemRepository; this._readingTableQuestionSystemRepository = readingTableQuestionSystemRepository;
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository; this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository; this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
this._readingQuestionCriterionSystemRepository = readingQuestionCriterionSystemRepository; this._readingQuestionCriterionSystemRepository = readingQuestionCriterionSystemRepository;
@ -722,7 +725,7 @@ namespace IRaCIS.Application.Services
#region 获取项目的阅片问题 #region 获取项目的阅片问题
/// <summary> /// <summary>
/// 获取项目的阅片问题 /// 获取项目的阅片问题ECRF预览
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// SinglePage 单页 /// SinglePage 单页
@ -745,6 +748,9 @@ namespace IRaCIS.Application.Services
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();
var groupList = new List<GetTrialReadingQuestionOutDto>(); var groupList = new List<GetTrialReadingQuestionOutDto>();
var qusetionIds = qusetionList.Select(x => x.ReadingQuestionTrialId).ToList();
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId))
.ProjectTo<TableQuestionDataInfo>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
if (inDto.FormType != null) if (inDto.FormType != null)
{ {
formType = inDto.FormType.Value; formType = inDto.FormType.Value;
@ -768,7 +774,7 @@ namespace IRaCIS.Application.Services
var pageGroupList = newPageQusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); var pageGroupList = newPageQusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
pageGroupList.ForEach(x => pageGroupList.ForEach(x =>
{ {
this.FindChildQuestion(x, newPageQusetionList); this.FindChildQuestion(x, newPageQusetionList, tableQuestionList);
}); });
page.Childrens = pageGroupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList(); page.Childrens = pageGroupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
@ -785,7 +791,7 @@ namespace IRaCIS.Application.Services
groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
groupList.ForEach(x => groupList.ForEach(x =>
{ {
this.FindChildQuestion(x, qusetionList); this.FindChildQuestion(x, qusetionList, tableQuestionList);
}); });
groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList(); groupList = groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList();
@ -795,17 +801,7 @@ namespace IRaCIS.Application.Services
} }
//List<GetTrialReadingQuestionOutDto> groupList = qusetionList.Where(x => x.ParentId == null).ToList();
//groupList.ForEach(x =>
//{
// this.FindChildQuestion(x, qusetionList);
//});
return (result, new return (result, new
{ {
readingTaskState = readingTaskState, readingTaskState = readingTaskState,
@ -1176,15 +1172,19 @@ namespace IRaCIS.Application.Services
/// </summary> /// </summary>
/// <param name="trialReadingQuestion"></param> /// <param name="trialReadingQuestion"></param>
/// <param name="questionlists"></param> /// <param name="questionlists"></param>
/// <param name="tableQuestionLists"></param>
[NonDynamicMethod] [NonDynamicMethod]
public void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists) public void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists,List<TableQuestionDataInfo> tableQuestionLists)
{ {
trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId || (trialReadingQuestion.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == trialReadingQuestion.GroupName)).ToList(); trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId || (trialReadingQuestion.Type == "group" && x.Type != "group" && x.ParentId == null && x.GroupName == trialReadingQuestion.GroupName)).ToList();
trialReadingQuestion.TableQuestions = tableQuestionLists.Where(x => x.ReadingQuestionId == trialReadingQuestion.ReadingQuestionTrialId).ToList();
if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0) if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0)
{ {
trialReadingQuestion.Childrens.ForEach(x => trialReadingQuestion.Childrens.ForEach(x =>
{ {
this.FindChildQuestion(x, questionlists); this.FindChildQuestion(x, questionlists, tableQuestionLists);
}); });
} }
} }

View File

@ -54,6 +54,7 @@ namespace IRaCIS.Core.Application.Service
CreateMap<ReadingQuestionSystem, GetSystemReadingQuestionOutDto>(); CreateMap<ReadingQuestionSystem, GetSystemReadingQuestionOutDto>();
CreateMap<ReadingTableQuestionSystem, TableQuestionDataInfo>(); CreateMap<ReadingTableQuestionSystem, TableQuestionDataInfo>();
CreateMap<ReadingTableQuestionTrial, TableQuestionDataInfo>();
CreateMap<ReadingTableQuestionSystem, ReadingTableQuestionSystemView>() CreateMap<ReadingTableQuestionSystem, ReadingTableQuestionSystemView>()
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder)); .ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));