查询既往信息
parent
c3ed54f05f
commit
5735383cd7
|
@ -438,7 +438,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public string? OtherPicturePath { get; set; }
|
||||
public string? PicturePath { get; set; }
|
||||
|
||||
public string TaskBlindName { get; set; } = string.Empty;
|
||||
|
||||
|
@ -447,7 +447,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public class GetPreviousOtherPicturePathInDto
|
||||
{
|
||||
public Guid RowId { get; set; }
|
||||
public Guid? RowId { get; set; }
|
||||
|
||||
public Guid? VisitTaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题类型
|
||||
/// </summary>
|
||||
public QuestionType? QuestionType { get; set; }
|
||||
}
|
||||
|
||||
public class GetReadingCalculationDataInDto
|
||||
|
|
|
@ -177,17 +177,37 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<List<GetPreviousOtherPicturePathOutDto>> GetPreviousOtherPicturePath(GetPreviousOtherPicturePathInDto inDto)
|
||||
{
|
||||
var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstNotNullAsync();
|
||||
var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(rowinfo.VisitTaskId);
|
||||
var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList();
|
||||
List<GetPreviousOtherPicturePathOutDto> result = await _readingTableAnswerRowInfoRepository.Where(x => x.QuestionId == rowinfo.QuestionId && x.RowIndex == rowinfo.RowIndex && visitTaskIds.Contains(x.VisitTaskId))
|
||||
.Where(x=>x.OtherPicturePath!=null&&x.OtherPicturePath!=string.Empty)
|
||||
.OrderBy(x => x.VisitTask.VisitTaskNum).Select(x => new GetPreviousOtherPicturePathOutDto()
|
||||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
OtherPicturePath = x.OtherPicturePath,
|
||||
TaskBlindName = x.VisitTask.TaskBlindName
|
||||
}).ToListAsync();
|
||||
List<GetPreviousOtherPicturePathOutDto> result = new List<GetPreviousOtherPicturePathOutDto>() { };
|
||||
|
||||
if (inDto.RowId != null)
|
||||
{
|
||||
var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstNotNullAsync();
|
||||
var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(rowinfo.VisitTaskId);
|
||||
var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList();
|
||||
result = await _readingTableAnswerRowInfoRepository.Where(x => x.QuestionId == rowinfo.QuestionId && x.RowIndex == rowinfo.RowIndex && visitTaskIds.Contains(x.VisitTaskId))
|
||||
|
||||
.OrderBy(x => x.VisitTask.VisitTaskNum).Select(x => new GetPreviousOtherPicturePathOutDto()
|
||||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
PicturePath = x.OtherPicturePath,
|
||||
TaskBlindName = x.VisitTask.TaskBlindName
|
||||
}).ToListAsync();
|
||||
}
|
||||
else if(inDto.VisitTaskId!=null&&inDto.QuestionType!=null)
|
||||
{
|
||||
var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(inDto.VisitTaskId.Value);
|
||||
var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList();
|
||||
result = await _readingTaskQuestionMarkRepository.Where(x => x.ReadingQuestionTrial.QuestionType == inDto.QuestionType && visitTaskIds.Contains(x.VisitTaskId))
|
||||
|
||||
.OrderBy(x => x.VisitTask.VisitTaskNum).Select(x => new GetPreviousOtherPicturePathOutDto()
|
||||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
PicturePath = x.PicturePath,
|
||||
TaskBlindName = x.VisitTask.TaskBlindName
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,8 +106,14 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public int? OtherNumberOfFrames { get; set; }
|
||||
public string? OtherMeasureData { get; set; } = string.Empty;
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("QuestionId")]
|
||||
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
|
||||
|
||||
}
|
||||
[JsonIgnore]
|
||||
[ForeignKey("VisitTaskId")]
|
||||
public VisitTask VisitTask { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue