保存裁判规则验证
parent
4cab822a52
commit
747bb29729
|
|
@ -386,6 +386,36 @@ namespace IRaCIS.Core.Application.Service.RC
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> SetTrialJudgeRuleInfo(SetTrialJudgeRuleInfoInDto inDto)
|
public async Task<IResponseOutput> 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()
|
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
||||||
{
|
{
|
||||||
JudgeModeEnum = inDto.JudgeModeEnum,
|
JudgeModeEnum = inDto.JudgeModeEnum,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue