修改
This commit is contained in:
+16
-1
@@ -1284,12 +1284,27 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => tableQuestionIds.Contains(x.Id) && x.MaxRowCount != null && x.MaxRowCount != 0).ToListAsync();
|
||||
|
||||
List<QuestionMark?> questionMarks = new List<QuestionMark?>()
|
||||
{
|
||||
QuestionMark.Part,
|
||||
QuestionMark.Organ,
|
||||
|
||||
};
|
||||
foreach (var item in tableQuestions)
|
||||
{
|
||||
var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault();
|
||||
if (!answer.IsNullOrEmpty())
|
||||
{
|
||||
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();
|
||||
var rowCount = 0;
|
||||
if (questionMarks.Contains(item.QuestionMark))
|
||||
{
|
||||
rowCount = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && ((x.RowIndex % 1) == 0) && x.OrganInfoId == inDto.OrganInfoId && x.OrganInfoId != null && x.RowIndex != inDto.RowIndex).CountAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user