diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs index 3ce7d3012..3c75dc778 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs @@ -35,7 +35,7 @@ namespace IRaCIS.Core.Application.Contracts public Guid UpdateUserId { get; set; } - public List ChildList=new List(); + public List Childrens = new List(); } /// QCQuestionConfigureView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index 698f1f483..cbf2ea718 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -135,11 +135,11 @@ namespace IRaCIS.Core.Application.Contracts var question = new List(); if (inDto.TrialId!= null) { - question = await _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId).OrderBy(x => x.ShowOrder).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + question = await _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); } else { - question=await _qcQuestionRepository.AsQueryable().OrderBy(x => x.ShowOrder).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + question=await _qcQuestionRepository.Where(x=>x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); } @@ -155,11 +155,11 @@ namespace IRaCIS.Core.Application.Contracts private void GetQuestionChild(QCQuestionView parent, List dataList) { - parent.ChildList = dataList.Where(x => x.ParentId == parent.Id).ToList(); + parent.Childrens = dataList.Where(x => x.ParentId == parent.Id).ToList(); - if (parent.ChildList.Count != 0) + if (parent.Childrens.Count != 0) { - parent.ChildList.ForEach(x => + parent.Childrens.ForEach(x => { GetQuestionChild(x, dataList); });