修改医学审核发送罗晋

Uat_Study
hang 2023-03-01 17:50:51 +08:00
parent 4471ecf150
commit d7f82d7473
3 changed files with 33 additions and 7 deletions

View File

@ -196,7 +196,9 @@ namespace IRaCIS.Core.Application.Service
//生成任务
foreach (var taskId in taskIdList)
{
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { TrialId = trialId, VisitTaskId = taskId, MedicalManagerUserId = minUserIdList.FirstOrDefault(), AllocateTime = DateTime.Now },true);
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { TrialId = trialId, VisitTaskId = taskId, MedicalManagerUserId = minUserIdList.FirstOrDefault(), AllocateTime = DateTime.Now
,IsAutoGenerate=true,PDRelationTaskIdListStr=string.Join('|', taskIdList)
},true);
}
}
@ -588,7 +590,7 @@ namespace IRaCIS.Core.Application.Service
var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId.Value;
answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Visit, taskInfo.CriterionType);
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t=>t.ReadingCategory==ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
}
else
@ -634,7 +636,7 @@ namespace IRaCIS.Core.Application.Service
var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId.Value;
answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Global, taskInfo.CriterionType);
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge)..Select(t => t.Id).ToList(), minUserIdList);
}
else
@ -711,7 +713,7 @@ namespace IRaCIS.Core.Application.Service
var judgeResultId = taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).First().JudgeResultTaskId.Value;
answer = await TranslatePdStateAsync(judgeResultId, ReadingCategory.Visit, taskInfo.CriterionType);
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Select(t => t.Id).ToList(), minUserIdList);
isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, taskList.Where(t => t.ReadingCategory == ReadingCategory.Judge).Select(t => t.Id).ToList(), minUserIdList);
}

View File

@ -691,10 +691,27 @@ namespace IRaCIS.Core.Application.Service
AuditSignTime=DateTime.Now,
});
await _trialEmailNoticeConfigService.BaseBusinessScenarioSendEmailAsync(medicalReviewInfo.VisitTaskId, true&& medicalReviewInfo.IsApplyHeavyReading);
var result = await _taskMedicalReviewRepository.SaveChangesAsync();
//自动发送邮件逻辑
if (medicalReviewInfo.IsAutoGenerate)
{
var allMedicalAuditList= await _taskMedicalReviewRepository.Where(x => medicalReviewInfo.PDRelationTaskIdList.Contains(x.Id) ).ToListAsync();
if (allMedicalAuditList.All(t => t.IsApplyHeavyReading == false))
{
//自动发送
await _trialEmailNoticeConfigService.BaseBusinessScenarioSendEmailAsync(medicalReviewInfo.VisitTaskId, false);
}
}
return ResponseOutput.Result(result);
}

View File

@ -197,6 +197,13 @@ namespace IRaCIS.Core.Domain.Models
}
public bool IsAutoGenerate { get; set; }
// | 分割
public string PDRelationTaskIdListStr { get; set; }
[NotMapped]
public List<Guid> PDRelationTaskIdList=> PDRelationTaskIdListStr.Split('|',StringSplitOptions.RemoveEmptyEntries).Select(t=> Guid.Parse(t) ).ToList();
}
#region 文件对象