IRC_NewDev
he 2023-09-22 16:07:33 +08:00
parent 5399c89d8e
commit a8212404ba
3 changed files with 13 additions and 19 deletions

View File

@ -1036,6 +1036,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid? FirstAddTaskId { get; set; }
public QuestionType? QuestionType { get; set; }
public string? OrderMark { get; set; } = string.Empty;
}
public class GetReadingQuestionAndAnswerInDto
{

View File

@ -1568,27 +1568,15 @@ namespace IRaCIS.Application.Services
}).ToListAsync();
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
var datetime = DateTime.Now;
List<ReadingTaskQuestionMark> markList = inDto.QuestionMarkInfoList.Select(x => new ReadingTaskQuestionMark
{
Id = NewId.NextGuid(),
VisitTaskId = inDto.VisitTaskId,
InstanceId = x.InstanceId,
MarkTool = x.MarkTool,
NumberOfFrames = x.NumberOfFrames,
PicturePath = x.PicturePath,
MeasureData = x.MeasureData,
QuestionId = x.QuestionId,
SeriesId = x.SeriesId,
StudyId = x.StudyId,
CreateTime = datetime,
FirstAddTaskId= questionMarkList.Where(y=>y.QuestionId==x.QuestionId).Select(x=>x.FirstAddTaskId).FirstOrDefault() ?? inDto.VisitTaskId,
}).ToList();
var markList = _mapper.Map<List<QuestionMarkInfo>, List<ReadingTaskQuestionMark>>(inDto.QuestionMarkInfoList);
markList.ForEach(x => {
x.Id = NewId.NextGuid();
x.VisitTaskId = inDto.VisitTaskId;
x.CreateTime = datetime;
x.FirstAddTaskId = questionMarkList.Where(y => y.QuestionId == x.QuestionId).Select(x => x.FirstAddTaskId).FirstOrDefault() ?? inDto.VisitTaskId;
});
await _readingTaskQuestionMarkRepository.AddRangeAsync(markList);
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
return ResponseOutput.Ok(true);

View File

@ -81,6 +81,10 @@ namespace IRaCIS.Core.Domain.Models
public QuestionType? QuestionType { get; set; }
public string? OrderMark { get; set; } = string.Empty;
}