修改
This commit is contained in:
@@ -34,6 +34,45 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量提交全局阅片信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
||||
{
|
||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||
foreach (var item in inDto.VisitTaskAnswerList)
|
||||
{
|
||||
foreach (var answer in item.AnswerList)
|
||||
{
|
||||
await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == item.VisitTaskId && x.GlobalAnswerType == answer.GlobalAnswerType && x.QuestionId == answer.QuestionId);
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId, x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
GlobalChangeAnswer = answer.Answer
|
||||
});
|
||||
}
|
||||
}
|
||||
var answers= inDto.VisitTaskAnswerList.SelectMany(x => x.AnswerList.Select(y => new ReadingGlobalTaskInfo()
|
||||
{
|
||||
Answer = y.Answer,
|
||||
QuestionId = y.QuestionId,
|
||||
SubjectId = inDto.SubjectId,
|
||||
GlobalTaskId = inDto.GlobalTaskId,
|
||||
GlobalAnswerType = y.GlobalAnswerType,
|
||||
TaskId = x.VisitTaskId,
|
||||
TrialId = inDto.TrialId,
|
||||
})).ToList();
|
||||
|
||||
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
||||
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
|
||||
#region 全局阅片相关
|
||||
/// <summary>
|
||||
/// 保存全局阅片结果
|
||||
|
||||
+24
-3
@@ -120,10 +120,31 @@ namespace IRaCIS.Application.Services
|
||||
this._trialEmailNoticeConfigService = trialEmailNoticeConfigService;
|
||||
}
|
||||
|
||||
|
||||
public async Task ChangeCalculationAnswer()
|
||||
/// <summary>
|
||||
/// 修改计算问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task ChangeCalculationAnswer(ChangeCalculationAnswerInDto inDto)
|
||||
{
|
||||
|
||||
foreach (var item in inDto.QuestionAnswer)
|
||||
{
|
||||
await _readingTaskQuestionAnswerRepository.UpdatePartialFromQueryAsync(x=>x.VisitTaskId==inDto.VisitTaskId&&x.ReadingQuestionTrialId==item.QuestionId, x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = item.Answer,
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var item in inDto.TableQuestionAnswer)
|
||||
{
|
||||
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowId == item.RowId&&x.TableQuestionId==item.TableQuestionId, x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = item.Answer,
|
||||
});
|
||||
}
|
||||
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user