代码整理
This commit is contained in:
+33
-11
@@ -1,19 +1,13 @@
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using MassTransit;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using Panda.DynamicWebApi.Attributes;
|
||||
using AutoMapper;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 非Dicom
|
||||
/// </summary>
|
||||
@@ -35,7 +29,38 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
#region 获取阅片非Dicom文件
|
||||
|
||||
/// <summary>
|
||||
/// 保存任务问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SaveVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
|
||||
{
|
||||
var subjectId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.SubjectId).FirstOrDefaultAsync();
|
||||
await _readingTaskQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId);
|
||||
List<ReadingTaskQuestionAnswer> readingTaskAnswerList = inDto.AnswerList.Select(x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
SubjectId = subjectId,
|
||||
Answer = x.Answer,
|
||||
ReadingQuestionCriterionTrialId = inDto.ReadingQuestionCriterionTrialId,
|
||||
ReadingQuestionTrialId = x.ReadingQuestionTrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
TrialId = inDto.TrialId
|
||||
}).ToList();
|
||||
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
||||
{
|
||||
ReadingTaskState = ReadingTaskState.Reading,
|
||||
|
||||
});
|
||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskAnswerList);
|
||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取阅片非Dicom文件
|
||||
/// </summary>
|
||||
@@ -112,11 +137,9 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 找子问题
|
||||
/// <summary>
|
||||
/// 找子问题
|
||||
/// </summary>
|
||||
@@ -189,6 +212,5 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user