修改一版

Uat_Study
he 2022-07-14 16:15:25 +08:00
parent f365c19d4a
commit b5e3b22a3e
2 changed files with 19 additions and 2 deletions

View File

@ -133,6 +133,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class GetTrialCriterionJudgeQuestionListInDto public class GetTrialCriterionJudgeQuestionListInDto
{ {
[NotDefault]
public Guid TrialId { get; set; }
[NotDefault] [NotDefault]
public Guid ReadingQuestionCriterionTrialId { get; set; } public Guid ReadingQuestionCriterionTrialId { get; set; }
} }

View File

@ -255,9 +255,13 @@ namespace IRaCIS.Application.Services
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<List<GetTrialCriterionJudgeQuestionListOutDto>> GetTrialCriterionJudgeQuestionList(GetTrialCriterionJudgeQuestionListInDto inDto) public async Task<(List<GetTrialCriterionJudgeQuestionListOutDto>,object)> GetTrialCriterionJudgeQuestionList(GetTrialCriterionJudgeQuestionListInDto inDto)
{ {
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId && x.IsJudgeQuestion) var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId && x.IsJudgeQuestion)
.WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null)
.WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null)
.Select(x => new GetTrialCriterionJudgeQuestionListOutDto() .Select(x => new GetTrialCriterionJudgeQuestionListOutDto()
{ {
AnswerGroup = JsonConvert.DeserializeObject<List<string>>(x.AnswerGroup.IsNullOrEmpty()?"[]": x.AnswerGroup), AnswerGroup = JsonConvert.DeserializeObject<List<string>>(x.AnswerGroup.IsNullOrEmpty()?"[]": x.AnswerGroup),
@ -267,7 +271,17 @@ namespace IRaCIS.Application.Services
JudgeType=x.JudgeType, JudgeType=x.JudgeType,
ReadingQuestionTrialId = x.Id ReadingQuestionTrialId = x.Id
}).ToListAsync(); }).ToListAsync();
return result;
var signTime = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => x.ReadingInfoSignTime).FirstOrDefaultAsync();
return (result, new
{
IsSign = signTime != null,
});
} }
/// <summary> /// <summary>