diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs index 4b9eaa2c9..5ec42ce6d 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs @@ -386,6 +386,36 @@ namespace IRaCIS.Core.Application.Service.RC [HttpPost] public async Task SetTrialJudgeRuleInfo(SetTrialJudgeRuleInfoInDto inDto) { + if (inDto.JudgeRuleEnum == JudgeRule.Consistent) + { + if (await _readingQuestionTrialRepository.AnyAsync(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId&& x.IsJudgeQuestion && x.LimitShow != LimitShow.AllShow)) + { + + + var questionList = await _readingQuestionTrialRepository + .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId && x.IsJudgeQuestion && x.LimitShow != LimitShow.AllShow) + .OrderBy(x => x.ShowOrder) + .Select(x => new TrialQuestionVisitJudgeRuleItemDto + { + ReadingQuestionTrialId = x.Id, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), + ShowOrder = x.ShowOrder, + Type = x.Type, + TypeValue = x.TypeValue, + QuestionGenre = x.QuestionGenre, + DictionaryCode = x.DictionaryCode, + Unit = x.Unit, + CustomUnit = x.CustomUnit, + }) + .ToListAsync(); + + var questionName=string.Join(",", questionList.Select(x => x.QuestionName)); + + + //---当前标准裁判规则为一致性,但存在非全部显示的裁判问题,操作失败 + throw new BusinessValidationFailedException(_localizer["JudgeCanNotLimitShow", questionName]); + } + } await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial() { JudgeModeEnum = inDto.JudgeModeEnum,