From dcb231f78883148aab8fee6b509c17c7c32ac0ed Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 1 Mar 2023 16:35:01 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/MedicalAudit/ReadingMedicalReviewService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index 39f862560..be9ac26ab 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -591,7 +591,10 @@ namespace IRaCIS.Core.Application.Service await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { IsClosedDialog = true, + IsApplyHeavyReading=true, MedicalDialogCloseEnum = MedicalDialogClose.IRApplyReReading, + FileName = inDto.FileName, + DisagreeReason = inDto.DisagreeReason, }); } From 4471ecf1501a1b470e299755dc221ac2fea4f569 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 1 Mar 2023 16:41:54 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BB=E5=AD=A6?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/MedicalAudit/ReadingMedicalReviewService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index be9ac26ab..361a524cc 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -591,10 +591,15 @@ namespace IRaCIS.Core.Application.Service await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { IsClosedDialog = true, - IsApplyHeavyReading=true, MedicalDialogCloseEnum = MedicalDialogClose.IRApplyReReading, + + + IsApplyHeavyReading = true, FileName = inDto.FileName, + ImagePath = JsonConvert.SerializeObject(inDto.FileList), DisagreeReason = inDto.DisagreeReason, + + }); } From d7f82d7473aba840feef8236c9f021a337f3900b Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 1 Mar 2023 17:50:51 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BB=E5=AD=A6?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=8F=91=E9=80=81=E7=BD=97=E6=99=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Document/TrialEmailNoticeConfigService.cs | 10 ++++---- .../ReadingMedicalReviewService.cs | 23 ++++++++++++++++--- .../Allocation/TaskMedicalReview.cs | 7 ++++++ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index 1f333c1ea..b69f5a4a4 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -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); } diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index 361a524cc..c2307b8b4 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -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); } diff --git a/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs b/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs index 6aae1867b..5e02d6a2a 100644 --- a/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs +++ b/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs @@ -197,6 +197,13 @@ namespace IRaCIS.Core.Domain.Models } + public bool IsAutoGenerate { get; set; } + + // | 分割 + public string PDRelationTaskIdListStr { get; set; } + + [NotMapped] + public List PDRelationTaskIdList=> PDRelationTaskIdListStr.Split('|',StringSplitOptions.RemoveEmptyEntries).Select(t=> Guid.Parse(t) ).ToList(); } #region 文件对象 From 2cc72cc16ba3c81c116265685a10afc3ed939cd8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 1 Mar 2023 17:51:11 +0800 Subject: [PATCH 4/5] x --- .../Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index c2307b8b4..6ef672632 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -697,7 +697,6 @@ namespace IRaCIS.Core.Application.Service if (medicalReviewInfo.IsAutoGenerate) { - var allMedicalAuditList= await _taskMedicalReviewRepository.Where(x => medicalReviewInfo.PDRelationTaskIdList.Contains(x.Id) ).ToListAsync(); if (allMedicalAuditList.All(t => t.IsApplyHeavyReading == false)) From 57558af3eb5b7fccb6611f3b06ee7e81851725ae Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 1 Mar 2023 17:52:31 +0800 Subject: [PATCH 5/5] x --- .../Service/Document/TrialEmailNoticeConfigService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index b69f5a4a4..abff1e364 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -636,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.Where(t => t.ReadingCategory == ReadingCategory.Judge)..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