修改加急

Test.EIImageViewer
hang 2023-02-17 09:41:23 +08:00
parent 92656b691d
commit 63c6b8da69
1 changed files with 25 additions and 18 deletions

View File

@ -72,14 +72,15 @@ namespace IRaCIS.Core.Application.Service
public async Task<IResponseOutput> SetTrialEmail(SetTrialEmailInDto inDto) public async Task<IResponseOutput> SetTrialEmail(SetTrialEmailInDto inDto)
{ {
await TestEmailConfigAsync(new TrialEmailNoticeConfigAddOrEdit() { await TestEmailConfigAsync(new TrialEmailNoticeConfigAddOrEdit()
{
AuthorizationCode=inDto.EmailAuthorizationCode, AuthorizationCode = inDto.EmailAuthorizationCode,
FromEmail=inDto.EmailFromEmail, FromEmail = inDto.EmailFromEmail,
FromName=inDto.EmailFromName, FromName = inDto.EmailFromName,
SMTPServerAddress=inDto.EmailSMTPServerAddress, SMTPServerAddress = inDto.EmailSMTPServerAddress,
SMTPServerPort= inDto.EmailSMTPServerPort.Value, SMTPServerPort = inDto.EmailSMTPServerPort.Value,
TrialId=inDto.TrialId, TrialId = inDto.TrialId,
}); });
await _trialRepository.UpdatePartialFromQueryAsync(inDto.TrialId, x => new Trial() await _trialRepository.UpdatePartialFromQueryAsync(inDto.TrialId, x => new Trial()
@ -388,6 +389,17 @@ namespace IRaCIS.Core.Application.Service
answer = "是"; answer = "是";
} }
//把另外一个人的任务设置为不加急(如果项目加急是否 subject 加急是否)
var urgent = _repository.Where<SubjectVisit>(t => t.Id == taskInfo.SourceSubjectVisitId).Select(t => new { IsSubjectUrgent = t.Subject.IsUrgent, t.Trial.IsUrgent }).FirstOrDefault();
if (urgent?.IsUrgent == false || urgent?.IsSubjectUrgent==false)
{
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false &&
t.Id != visitTaskId && t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId, u => new VisitTask() { IsUrgent = false });
}
} }
@ -711,21 +723,16 @@ namespace IRaCIS.Core.Application.Service
} }
else if (readingCategory == ReadingCategory.Global) else if (readingCategory == ReadingCategory.Global)
{ {
var questionAnsewerList = await _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == visitTaskId && t.TrialReadingQuestion.QuestionType == QuestionType.Tumor).ToListAsync(); var questionAnsewer = await _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == visitTaskId && t.TrialReadingQuestion.QuestionType == QuestionType.Tumor).OrderByDescending(c => c.VisitTask.VisitTaskNum).FirstNotNullAsync();
var answerEmptyTaskIdList=questionAnsewerList.Where(t=>string.IsNullOrEmpty(t.Answer)).Select(t=>t.TaskId).ToList();
var answerList= await _repository.Where<ReadingTaskQuestionAnswer>(t => answerEmptyTaskIdList.Contains(t.VisitTaskId) && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor) answer = questionAnsewer.Answer;
.Select(t=>t.Answer).ToListAsync(); if (string.IsNullOrEmpty(questionAnsewer.Answer))
if (questionAnsewerList.Any(t => t.Answer == ((int)OverallAssessment.PD).ToString()) || answerList.Any(t => t == ((int)OverallAssessment.PD).ToString()))
{ {
answer = ((int)OverallAssessment.PD).ToString(); answer = await _repository.Where<ReadingTaskQuestionAnswer>(t => questionAnsewer.TaskId == t.VisitTaskId && t.ReadingQuestionTrial.QuestionType == QuestionType.Tumor)
.Select(t => t.Answer).FirstOrDefaultAsync();
} }
} }
else if (readingCategory == ReadingCategory.Judge) else if (readingCategory == ReadingCategory.Judge)
{ {