diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 789887e56..19aa16fe9 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -209,7 +209,39 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string QuestionName { get; set; } = string.Empty; } + /// + /// 获取其他问题返回的Dto + /// + public class CriterionOtherQuestionOutDto + { + public Guid QuestionId { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } + } + public class GetTrialCriterionOtherQuestionInDto + { + [NotDefault] + public Guid ReadingQuestionCriterionTrialId { get; set; } + + /// + /// 当前ID + /// + public Guid? ReadingQuestionTrialId { get; set; } + } + + public class GetSystemCriterionOtherQuestionInDto + { + [NotDefault] + public Guid ReadingQuestionCriterionSystemId { get; set; } + + /// + /// 当前ID + /// + public Guid? ReadingQuestionSystemId { get; set; } + } public class ReadingQuestionSystemViewInDto : PageInput { diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs index 3837afa8c..ec699f01e 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs @@ -172,6 +172,25 @@ namespace IRaCIS.Application.Services inDto.Asc); } + /// + /// 获取系统标准的其他问题 + /// + /// + /// + [HttpPost] + public async Task> GetSystemCriterionOtherQuestion(GetSystemCriterionOtherQuestionInDto inDto) + { + var questionList =await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.ReadingQuestionCriterionSystemId) + .WhereIf(inDto.ReadingQuestionSystemId != null, x => x.Id != inDto.ReadingQuestionSystemId) + .Select(x => new CriterionOtherQuestionOutDto() + { + QuestionId = x.Id, + QuestionName = x.QuestionName + }).ToListAsync(); + + return questionList; + } + /// /// 删除系统问题 /// @@ -367,6 +386,27 @@ namespace IRaCIS.Application.Services inDto.Asc); } + + + /// + /// 获取项目标准的其他问题(项目) + /// + /// + /// + [HttpPost] + public async Task> GetTrialCriterionOtherQuestion(GetTrialCriterionOtherQuestionInDto inDto) + { + var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId) + .WhereIf(inDto.ReadingQuestionTrialId != null, x => x.Id != inDto.ReadingQuestionTrialId) + .Select(x => new CriterionOtherQuestionOutDto() + { + QuestionId = x.Id, + QuestionName = x.QuestionName + }).ToListAsync(); + + return questionList; + } + /// /// 删除项目问题(项目) ///