Uat_Study
parent
8ab0241225
commit
53739d2177
|
@ -281,6 +281,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public Guid QuestionId { get; set; }
|
||||
|
||||
|
||||
public Guid RowId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表格问题Id
|
||||
/// </summary>
|
||||
|
@ -1011,7 +1014,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
{
|
||||
public Guid TableQuestionId { get; set; }
|
||||
|
||||
public string Answer { get; set; }
|
||||
public string Answer { get; set; }=string.Empty;
|
||||
}
|
||||
|
||||
public class GetTrialReadingQuestionInDto
|
||||
|
|
|
@ -831,8 +831,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
if (visitTaskAnswerList == null)
|
||||
{
|
||||
visitTaskAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTask.ReadingCategory == ReadingCategory.Visit
|
||||
&& x.SubjectId == inDto.SubjectId && x.VisitTask.ReadingTaskState == ReadingTaskState.HaveSigned &&x.VisitTask.ArmEnum==inDto.ArmEnum&& x.VisitTask.TaskState == TaskState.Effect && x.ReadingQuestionTrial.QuestionType == QuestionType.SOD)
|
||||
visitTaskAnswerList = await _readingTaskQuestionAnswerRepository.Where(x =>x.VisitTaskId==inDto.VisitTaskId|| (x.VisitTask.ReadingCategory == ReadingCategory.Visit
|
||||
&& x.SubjectId == inDto.SubjectId && x.VisitTask.ReadingTaskState == ReadingTaskState.HaveSigned &&x.VisitTask.ArmEnum==inDto.ArmEnum&& x.VisitTask.TaskState == TaskState.Effect && x.ReadingQuestionTrial.QuestionType == QuestionType.SOD))
|
||||
.Select(x => new VisitTaskAnswerInfo
|
||||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace IRaCIS.Application.Services
|
|||
await this.VerifyIsBaseLineTask(inDto.VisitTaskId);
|
||||
var rowAnswer = await _readingTableAnswerRowInfoRepository.Where(x =>x.Id==inDto.RowId).FirstNotNullAsync();
|
||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == rowAnswer.RowIndex && x.QuestionId == inDto.QuestionId).ToListAsync();
|
||||
var maxRowIndex = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId).OrderByDescending(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefaultAsync();
|
||||
var maxRowIndex = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId&&x.RowIndex< Math.Floor(rowAnswer.RowIndex+1)).OrderByDescending(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefaultAsync();
|
||||
var newRowIndex = maxRowIndex + (decimal)0.01;
|
||||
|
||||
rowAnswer.RowIndex = newRowIndex;
|
||||
|
@ -333,10 +333,6 @@ namespace IRaCIS.Application.Services
|
|||
if (!(await _readingTableQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == visitTaskId)))
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit&&x.SubjectId==taskinfo.SubjectId&&x.ReadingTaskState==ReadingTaskState.HaveSigned &&x.VisitTaskNum< taskinfo.VisitTaskNum&&x.TaskState==TaskState.Effect&&x.ArmEnum==taskinfo.ArmEnum
|
||||
).OrderByDescending(x=>x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
|
||||
|
@ -345,6 +341,7 @@ namespace IRaCIS.Application.Services
|
|||
var copyTableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == LastVisitTaskId).Select(x => new CopyTableAnswerDto() {
|
||||
Answer = x.Answer,
|
||||
QuestionId = x.QuestionId,
|
||||
RowId=x.RowId,
|
||||
QuestionMark = x.ReadingTableQuestionTrial.QuestionMark,
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
RowIndex = x.RowIndex,
|
||||
|
@ -364,6 +361,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
x.SplitRowId = tableRowAnswers.Where(y => y.OriginalId == x.SplitRowId).Select(y => y.Id).FirstOrDefault();
|
||||
x.MergeRowId = tableRowAnswers.Where(y => y.OriginalId == x.MergeRowId).Select(y => y.Id).FirstOrDefault();
|
||||
|
||||
});
|
||||
|
||||
List<QuestionMark?> notNeedCopyMarks = new List<QuestionMark?>()
|
||||
|
@ -379,6 +377,7 @@ namespace IRaCIS.Application.Services
|
|||
Answer = notNeedCopyMarks.Contains(x.QuestionMark) ? string.Empty : x.Answer,
|
||||
QuestionId = x.QuestionId,
|
||||
RowIndex = x.RowIndex,
|
||||
RowId= tableRowAnswers.Where(y=>y.OriginalId==x.RowId).Select(x=>x.Id).FirstOrDefault(),
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
TrialId = x.TrialId,
|
||||
VisitTaskId = visitTaskId,
|
||||
|
@ -2058,20 +2057,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.TrialId == inDto.TrialId && x.RowIndex == inDto.RowIndex);
|
||||
await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.TrialId == inDto.TrialId && x.RowIndex == inDto.RowIndex);
|
||||
List<ReadingTableQuestionAnswer> answerList = inDto.AnswerList.Select(x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = x.Answer,
|
||||
Id = NewId.NextGuid(),
|
||||
TrialId = inDto.TrialId,
|
||||
QuestionId = inDto.QuestionId,
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
RowIndex = inDto.RowIndex,
|
||||
|
||||
VisitTaskId = inDto.VisitTaskId
|
||||
}).ToList();
|
||||
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.AddAsync(new ReadingTableAnswerRowInfo()
|
||||
ReadingTableAnswerRowInfo rowInfo = new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
TrialId = inDto.TrialId,
|
||||
|
@ -2084,7 +2071,23 @@ namespace IRaCIS.Application.Services
|
|||
VisitTaskId = inDto.VisitTaskId,
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
List<ReadingTableQuestionAnswer> answerList = inDto.AnswerList.Select(x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = x.Answer,
|
||||
Id = NewId.NextGuid(),
|
||||
TrialId = inDto.TrialId,
|
||||
QuestionId = inDto.QuestionId,
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
RowIndex = inDto.RowIndex,
|
||||
RowId= rowInfo.Id,
|
||||
VisitTaskId = inDto.VisitTaskId
|
||||
}).ToList();
|
||||
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.AddAsync(rowInfo);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(answerList);
|
||||
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
||||
|
|
|
@ -80,6 +80,12 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
[ForeignKey("SplitRowId")]
|
||||
public ReadingTableAnswerRowInfo SplitRow { get; set; }
|
||||
|
||||
[ForeignKey("MergeRowId")]
|
||||
public ReadingTableAnswerRowInfo MergeRow { get; set; }
|
||||
|
||||
[ForeignKey("QuestionId")]
|
||||
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
|
||||
|
||||
|
|
|
@ -56,6 +56,13 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// RowId
|
||||
/// </summary>
|
||||
public Guid RowId { get; set; }
|
||||
|
||||
|
||||
[ForeignKey("QuestionId")]
|
||||
|
||||
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
|
||||
|
|
Loading…
Reference in New Issue