This commit is contained in:
he
2022-07-14 11:35:33 +08:00
parent db23c918cf
commit f09b2ade75
4 changed files with 25 additions and 6 deletions
@@ -593,6 +593,8 @@ namespace IRaCIS.Core.Application.Contracts
{
[NotDefault]
public Guid TrialId { get; set; }
}
public class SetTrialReadingCriterionInDto
@@ -85,7 +85,15 @@ namespace IRaCIS.Core.Application
[HttpPost]
public async Task<List<TrialJudgeQuestion>> GetTrialReadingJudgeList(GetTrialReadingInfoInDto inDto)
{
return await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.IsJudgeQuestion && x.TrialId == inDto.TrialId)
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
if (trialCriterion == null)
{
throw new BusinessValidationFailedException("请先确认一个项目标准。");
}
return await _readingQuestionTrialRepository
.WhereIf(trialCriterion.FormType==FormType.SinglePage,x=>x.ReadingCriterionPageId==null)
.WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null)
.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.IsJudgeQuestion && x.TrialId == inDto.TrialId&&x.ReadingQuestionCriterionTrialId== trialCriterion.Id)
.Select(x => new TrialJudgeQuestion()
{
AnswerCombination = x.AnswerCombination,