Uat_Study
parent
9dc562866c
commit
79af3792a7
|
@ -2165,13 +2165,16 @@ namespace IRaCIS.Application.Services
|
|||
foreach (var item in tableQuestions)
|
||||
{
|
||||
var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault();
|
||||
|
||||
var rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && ((x.RowIndex % 1) == 0) && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync();
|
||||
|
||||
if (rowCount > item.MaxRowCount.Value - 1)
|
||||
if (!answer.IsNullOrEmpty())
|
||||
{
|
||||
throw new BusinessValidationFailedException($"问题{item.QuestionName}最大相同问题数为{item.MaxRowCount.Value},当前已存在{rowCount}条!");
|
||||
var rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && ((x.RowIndex % 1) == 0) && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync();
|
||||
|
||||
if (rowCount > item.MaxRowCount.Value - 1)
|
||||
{
|
||||
throw new BusinessValidationFailedException($"问题{item.QuestionName}最大相同问题数为{item.MaxRowCount.Value},当前已存在{rowCount}条!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
var isCurrentTaskAddList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.TrialId == inDto.TrialId && x.RowIndex == inDto.RowIndex).Select(x => x.IsCurrentTaskAdd).ToListAsync();
|
||||
|
|
Loading…
Reference in New Issue