This commit is contained in:
he
2023-02-24 13:41:04 +08:00
parent 078fff447c
commit 700f6488aa
2 changed files with 112 additions and 36 deletions
@@ -46,18 +46,37 @@ namespace IRaCIS.Application.Services
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
{
await VerifyTaskIsSign(inDto.GlobalTaskId);
var criterionType = await _visitTaskRepository.Where(x => x.Id == inDto.GlobalTaskId).Select(x => x.TrialReadingCriterion.CriterionType).FirstNotNullAsync();
foreach (var item in inDto.VisitTaskAnswerList)
{
foreach (var answer in item.AnswerList)
{
await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == item.VisitTaskId && x.GlobalAnswerType == answer.GlobalAnswerType && x.QuestionId == answer.QuestionId);
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId
&& x.Answer != answer.Answer && answer.Answer != string.Empty&& answer.Answer!=null
, x => new ReadingTaskQuestionAnswer()
if (criterionType == CriterionType.PCWG3)
{
GlobalChangeAnswer = answer.Answer,
IsGlobalChange=true,
});
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId
&& x.Answer != answer.Answer && answer.Answer != string.Empty && answer.Answer != null
, x => new ReadingTaskQuestionAnswer()
{
Answer= answer.Answer,
GlobalChangeAnswer = answer.Answer,
IsGlobalChange = true,
});
}
else
{
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId
&& x.Answer != answer.Answer && answer.Answer != string.Empty && answer.Answer != null
, x => new ReadingTaskQuestionAnswer()
{
GlobalChangeAnswer = answer.Answer,
IsGlobalChange = true,
});
}
}
}
var answers= inDto.VisitTaskAnswerList.SelectMany(x => x.AnswerList.Select(y => new ReadingGlobalTaskInfo()
@@ -308,6 +327,10 @@ namespace IRaCIS.Application.Services
}).ToList();
List<GetGlobalQuestionType> questionTypes = new List<GetGlobalQuestionType>()
{
};
if (criterionType != CriterionType.PCWG3)
{
x.AgreeOrNot = new List<GlobalQuestionInfo>()
@@ -322,6 +345,8 @@ namespace IRaCIS.Application.Services
}
};
questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.UpdateType, QuestionName = "评估更新类型" });
}
else
{
@@ -331,14 +356,8 @@ namespace IRaCIS.Application.Services
List<GetGlobalQuestionType> questionTypes = new List<GetGlobalQuestionType>()
{
};
if(criterionType!= CriterionType.PCWG3)
{
questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.UpdateType, QuestionName = "评估更新类型" });
}
questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.Reason, QuestionName = "全局阅片备注" });
foreach (var item in questionTypes)
{