From b8108e34ba4a17b6b2f965ddc3b907bf5000c181 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 4 Aug 2022 15:57:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/QC/DTO/QCQuestionConfigureViewModel.cs | 2 +- .../Service/QC/QCQuestionService.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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); });