查询既往信息

IRC_NewDev
he 2024-03-15 10:30:27 +08:00
parent c3ed54f05f
commit 5735383cd7
3 changed files with 47 additions and 14 deletions

View File

@ -438,7 +438,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
{ {
public Guid VisitTaskId { get; set; } public Guid VisitTaskId { get; set; }
public string? OtherPicturePath { get; set; } public string? PicturePath { get; set; }
public string TaskBlindName { get; set; } = string.Empty; public string TaskBlindName { get; set; } = string.Empty;
@ -447,7 +447,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class GetPreviousOtherPicturePathInDto 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 public class GetReadingCalculationDataInDto

View File

@ -177,17 +177,37 @@ namespace IRaCIS.Application.Services
[HttpPost] [HttpPost]
public async Task<List<GetPreviousOtherPicturePathOutDto>> GetPreviousOtherPicturePath(GetPreviousOtherPicturePathInDto inDto) public async Task<List<GetPreviousOtherPicturePathOutDto>> GetPreviousOtherPicturePath(GetPreviousOtherPicturePathInDto inDto)
{ {
var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstNotNullAsync(); List<GetPreviousOtherPicturePathOutDto> result = new List<GetPreviousOtherPicturePathOutDto>() { };
var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(rowinfo.VisitTaskId);
var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList(); if (inDto.RowId != null)
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) var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstNotNullAsync();
.OrderBy(x => x.VisitTask.VisitTaskNum).Select(x => new GetPreviousOtherPicturePathOutDto() var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(rowinfo.VisitTaskId);
{ var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList();
VisitTaskId = x.VisitTaskId, result = await _readingTableAnswerRowInfoRepository.Where(x => x.QuestionId == rowinfo.QuestionId && x.RowIndex == rowinfo.RowIndex && visitTaskIds.Contains(x.VisitTaskId))
OtherPicturePath = x.OtherPicturePath,
TaskBlindName = x.VisitTask.TaskBlindName .OrderBy(x => x.VisitTask.VisitTaskNum).Select(x => new GetPreviousOtherPicturePathOutDto()
}).ToListAsync(); {
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; return result;
} }

View File

@ -106,8 +106,14 @@ namespace IRaCIS.Core.Domain.Models
public int? OtherNumberOfFrames { get; set; } public int? OtherNumberOfFrames { get; set; }
public string? OtherMeasureData { get; set; } = string.Empty; public string? OtherMeasureData { get; set; } = string.Empty;
[JsonIgnore]
[ForeignKey("QuestionId")]
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
} [JsonIgnore]
[ForeignKey("VisitTaskId")]
public VisitTask VisitTask { get; set; }
}
} }