Uat_Study
parent
67ae8ba4c5
commit
26976fa289
|
@ -261,7 +261,12 @@ namespace IRaCIS.Application.Services
|
|||
if (await _visitTaskRepository.AnyAsync(x => x.Id == visitTaskid && x.ReadingTaskState == ReadingTaskState.HaveSigned))
|
||||
{
|
||||
throw new BusinessValidationFailedException($"当前任务已经签名!");
|
||||
}
|
||||
|
||||
|
||||
if (await _visitTaskRepository.AnyAsync(x => x.Id == visitTaskid && x.TaskState != TaskState.Effect))
|
||||
{
|
||||
throw new BusinessValidationFailedException($"当前任务已失效!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1110,6 +1115,9 @@ namespace IRaCIS.Application.Services
|
|||
await _readingTableQuestionAnswerRepository.AddRangeAsync(questionAnswerList);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
await this.SubmitTaskChangeState(inDto.VisitTaskId);
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
@ -1131,6 +1139,21 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||
{
|
||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
|
||||
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId
|
||||
&&(x.IsJudgeQuestion||x.IsRequired== IsRequired.Required)
|
||||
).ToListAsync();
|
||||
|
||||
var answerQuestionIds = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Select(x => x.ReadingQuestionTrialId).ToListAsync();
|
||||
|
||||
readingQuestionList = readingQuestionList.Where(x => !answerQuestionIds.Contains(x.Id)).ToList();
|
||||
|
||||
if(readingQuestionList.Count()>0)
|
||||
{
|
||||
throw new BusinessValidationFailedException($" 必填问题{ string.Join(',', readingQuestionList.Select(x =>x.QuestionName))}的答案为空");
|
||||
}
|
||||
|
||||
await _readingCalculateService.VerifyVisitTaskQuestions(inDto);
|
||||
|
||||
|
|
Loading…
Reference in New Issue