修改一版

This commit is contained in:
he
2022-07-20 16:24:54 +08:00
parent 4c015e29b6
commit 48bbefebf9
3 changed files with 50 additions and 8 deletions
@@ -54,6 +54,18 @@ namespace IRaCIS.Core.Application
[NonDynamicMethod]
public async Task<IResponseOutput> TrialReadingInfoSign(TrialReadingInfoSignInDto inDto)
{
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
var existsJudge = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id && x.IsJudgeQuestion && x.JudgeType == JudgeTypeEnum.None)
.WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null)
.WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null)
.AnyAsync();
if (existsJudge)
{
throw new BusinessValidationFailedException("配置了裁判问题但未配置裁判规则,操作失败");
}
await _trialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialId, x => new Trial()
{
ReadingInfoSignTime = DateTime.Now