From 3563e5e3837d9ffa7c4914318949849a4ddd6d8d Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 11 Aug 2022 15:19:57 +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 --- .../Dto/ReadingMedicineQuestionViewModel.cs | 49 ++++++++++++++++++- .../Reading/ReadingMedicineQuestionService.cs | 7 ++- .../Reading/ReadingMedicineSystemQuestion.cs | 9 +++- .../Reading/ReadingMedicineTrialQuestion.cs | 5 ++ 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs index 59dab05c3..919d97299 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs @@ -49,6 +49,11 @@ namespace IRaCIS.Core.Application.ViewModel /// 是否启用 /// public bool IsEnable { get; set; } + + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } } ///ReadingMedicineSystemQuestionQuery 列表查询参数模型 @@ -59,6 +64,11 @@ namespace IRaCIS.Core.Application.ViewModel public string QuestionName { get; set; } = string.Empty; public string TypeValue { get; set; } = string.Empty; + /// + /// 任务类型 + /// + public ReadingCategory? ReadingCategory { get; set; } + } @@ -72,6 +82,11 @@ namespace IRaCIS.Core.Application.ViewModel /// 类型值 /// public string TypeValue { get; set; } + + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } } public class DeleteReadingMedicineTrialQuestion @@ -114,6 +129,11 @@ namespace IRaCIS.Core.Application.ViewModel public Guid? Id { get; set; } public int? ShowOrder { get; set; } + + /// + /// 任务类型 + /// + public ReadingCategory? ReadingCategory { get; set; } } @@ -161,6 +181,11 @@ namespace IRaCIS.Core.Application.ViewModel /// 是否启用 /// public bool IsEnable { get; set; } + + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } } public class ReadingMedicineTrialQuestionView @@ -182,12 +207,22 @@ namespace IRaCIS.Core.Application.ViewModel public bool? IsConfirm { get; set; } public int? ParentShowOrder { get; set; } - } + + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } + } public class GetMedicineQuestionPreviewInDto { public Guid TrialId { get; set; } + + /// + /// 任务类型 + /// + public ReadingCategory? ReadingCategory { get; set; } } @@ -270,6 +305,11 @@ namespace IRaCIS.Core.Application.ViewModel public string TypeValue { get; set; } = string.Empty; + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } + } /// ReadingMedicineTrialQuestionAddOrEdit 列表查询参数模型 @@ -288,7 +328,12 @@ namespace IRaCIS.Core.Application.ViewModel public int ShowOrder { get; set; } public Guid? ParentId { get; set; } public bool? IsConfirm { get; set; } - } + + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } + } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs index 3457e7a6f..db9e868e5 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs @@ -46,6 +46,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) + .WhereIf(inDto.ReadingCategory!=null, x => x.ReadingCategory==inDto.ReadingCategory) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder); return await query.ToListAsync(); } @@ -105,6 +106,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) + .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder); @@ -125,6 +127,7 @@ namespace IRaCIS.Core.Application.Service public async Task> GetMedicineQuestionPreview(GetMedicineQuestionPreviewInDto inDto) { var trialQuestionList = await _readingMedicineTrialQuestionRepository.Where(x=>x.TrialId==inDto.TrialId) + .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync(); List readingQuestionList = trialQuestionList.Where(x => x.ParentId == null).ToList(); @@ -188,12 +191,13 @@ namespace IRaCIS.Core.Application.Service .Where(x => types.Contains(x.Type)) .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id) .WhereIf(inDto.ShowOrder != null, x => x.ShowOrder x.ReadingCategory == inDto.ReadingCategory) .Select(x => new GetReadingMedicineTrialOtherQuestionOutDto() { Id = x.Id, QuestionName = x.QuestionName, TypeValue=x.TypeValue, - + ReadingCategory=x.ReadingCategory, }).ToListAsync(); return questionList; @@ -217,6 +221,7 @@ namespace IRaCIS.Core.Application.Service IsRequired = x.IsRequired, QuestionName = x.QuestionName, Type = x.Type, + ReadingCategory=x.ReadingCategory, TypeValue = x.TypeValue, TrialId=inDto.TrialId, }).ToList(); diff --git a/IRaCIS.Core.Domain/Reading/ReadingMedicineSystemQuestion.cs b/IRaCIS.Core.Domain/Reading/ReadingMedicineSystemQuestion.cs index e749c7a9d..8bb31c9a1 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingMedicineSystemQuestion.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingMedicineSystemQuestion.cs @@ -75,6 +75,11 @@ namespace IRaCIS.Core.Domain.Models /// 是否启用 /// public bool IsEnable { get; set; } - - } + + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } + + } } diff --git a/IRaCIS.Core.Domain/Reading/ReadingMedicineTrialQuestion.cs b/IRaCIS.Core.Domain/Reading/ReadingMedicineTrialQuestion.cs index bac3e30e7..c43228a9a 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingMedicineTrialQuestion.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingMedicineTrialQuestion.cs @@ -86,6 +86,11 @@ namespace IRaCIS.Core.Domain.Models /// public bool IsConfirm { get; set; } + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } + [ForeignKey("ParentId")] public ReadingMedicineTrialQuestion ParentQuestion { get; set; }