修改
continuous-integration/drone/push Build is passing Details

IRC_NewDev
he 2024-10-24 10:22:51 +08:00
parent ad01628e48
commit a7cfc1714a
3 changed files with 31 additions and 9 deletions

View File

@ -1574,7 +1574,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class GetCalculateQuestionsOutDto: ReadingQuestionSystemView public class GetCalculateQuestionsOutDto: ReadingQuestionSystemView
{ {
public List<ReadingTableQuestionSystemView> TableQuestions { get; set; } public List<ReadingTableQuestionTrial> TableQuestions { get; set; }
}
public class GetSystemCalculateQuestionsOutDto : ReadingQuestionSystemView
{
public List<ReadingTableQuestionSystem> TableQuestions { get; set; }
} }

View File

@ -88,7 +88,7 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<List<GetCalculateQuestionsOutDto>> GetCalculateQuestions(GetCalculateQuestionsInDto inDto) public async Task<(List<GetCalculateQuestionsOutDto>,bool)> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
{ {
var result = await _readingQuestionTrialRepository var result = await _readingQuestionTrialRepository
@ -98,7 +98,15 @@ namespace IRaCIS.Core.Application.Service
.OrderBy(x => x.ShowOrder) .OrderBy(x => x.ShowOrder)
.ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync(); .ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync();
return result;
var tablequestion=await _readingTableQuestionTrialRepository.Where(x=>x.TrialCriterionId==inDto.TrialCriterionId).ToListAsync();
result.ForEach(x =>
{
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
});
return (result,true);
} }
/// <summary> /// <summary>
@ -107,7 +115,7 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<List<GetCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto) public async Task<List<GetSystemCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto)
{ {
var result = await _readingQuestionSystemRepository var result = await _readingQuestionSystemRepository
@ -115,7 +123,16 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
.WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type)) .WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type))
.OrderBy(x => x.ShowOrder) .OrderBy(x => x.ShowOrder)
.ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync() ; .ProjectTo<GetSystemCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync() ;
var tablequestion = await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync();
result.ForEach(x =>
{
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
});
return result; return result;
} }

View File

@ -225,12 +225,10 @@ namespace IRaCIS.Core.Application.Service
.ForMember(dest => dest.CreateUser, opt => opt.Ignore()) .ForMember(dest => dest.CreateUser, opt => opt.Ignore())
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder)); .ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));
CreateMap<ReadingQuestionTrial, GetCalculateQuestionsOutDto>() CreateMap<ReadingQuestionTrial, GetCalculateQuestionsOutDto>();
.ForMember(d => d.TableQuestions, u => u.MapFrom(s => s.ReadingTableQuestionTrialList));
CreateMap<ReadingQuestionSystem, GetCalculateQuestionsOutDto>() CreateMap<ReadingQuestionSystem, GetCalculateQuestionsOutDto>();
.ForMember(d => d.TableQuestions, u => u.MapFrom(s => s.ReadingTableQuestionTrialList));
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>() CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>()
.ForMember(dest => dest.CreateUser, opt => opt.Ignore()) .ForMember(dest => dest.CreateUser, opt => opt.Ignore())