Uat_Study
parent
0b3c5c92e2
commit
bbb08f7527
|
@ -643,6 +643,13 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingTableQuestionTrial(ReadingTableQuestionTrialAddOrEdit indto)
|
||||
{
|
||||
|
||||
|
||||
if (await _readingTableQuestionTrialRepository.AnyAsync(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder && x.ReadingQuestionId==indto.ReadingQuestionId))
|
||||
{
|
||||
throw new BusinessValidationFailedException("问题编号重复");
|
||||
}
|
||||
|
||||
indto.ParentTriggerValue = string.Join(',', indto.ParentTriggerValueList);
|
||||
indto.RelevanceValue = string.Join(',', indto.RelevanceValueList);
|
||||
|
||||
|
|
|
@ -589,19 +589,15 @@ namespace IRaCIS.Application.Services
|
|||
qusetionList = qusetionList.Where(x => usedGurops.Contains(x.GroupName)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (inDto.TaskId != null)
|
||||
|
||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.TaskId).ToListAsync();
|
||||
qusetionList.ForEach(x =>
|
||||
{
|
||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.TaskId).ToListAsync();
|
||||
qusetionList.ForEach(x =>
|
||||
{
|
||||
var answer= answers.Where(y => y.ReadingQuestionTrialId == x.Id).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
x.Answer = answer.IsNullOrEmpty() ? x.DefaultValue : answer;
|
||||
});
|
||||
|
||||
}
|
||||
var answer = answers.Where(y => y.ReadingQuestionTrialId == x.Id).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
x.Answer = answer.IsNullOrEmpty() ? x.DefaultValue : answer;
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
Loading…
Reference in New Issue