自动生成增加验证逻辑
parent
1fc20e5640
commit
d42c8477aa
|
@ -166,6 +166,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate"]);
|
||||
}
|
||||
|
||||
if (subjectList.Count<2 * filterObj.PlanSubjectCount)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate1"]);
|
||||
}
|
||||
|
||||
inCommand.SubejctIdList = GetRandomSubjectIdList(subjectList.Select(t => t.SubjectId).ToList(), filterObj.PlanSubjectCount);
|
||||
}
|
||||
|
||||
|
@ -328,6 +333,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate"]);
|
||||
}
|
||||
|
||||
if (subjectSelectList.Count< 2 * filterObj.PlanSubjectCount)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate1"]);
|
||||
}
|
||||
|
||||
inCommand.SubejctIdList = GetRandomSubjectIdList(subjectSelectList.Select(t => t.SubjectId).ToList(), filterObj.PlanSubjectCount);
|
||||
}
|
||||
|
||||
|
|
|
@ -1335,10 +1335,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
var addList = _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
|
||||
|
||||
await _readingTaskQuestionMarkRepository.AddRangeAsync(questionMarkList);
|
||||
//await _readingTaskQuestionMarkRepository.AddRangeAsync(questionMarkList);
|
||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
foreach (var item in addList)
|
||||
{
|
||||
item.MergeRow = null;
|
||||
item.SplitRow = null;
|
||||
}
|
||||
//await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue