diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 1772c5e1..04de411a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -15,9 +15,12 @@ using AutoMapper; using MassTransit; using IRaCIS.Core.Infra.EFCore.Common; using System.Linq.Expressions; +using IRaCIS.Core.Domain.Share.Reading; namespace IRaCIS.Core.Application.Service { + + /// /// 访视读片任务 /// @@ -245,7 +248,7 @@ namespace IRaCIS.Core.Application.Service task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId; task1.AllocateTime = DateTime.Now; - task1.SuggesteFinishedTime = DateTime.Now.AddDays(7); + task1.SuggesteFinishedTime = GetSuggessFinishTime(true,UrgentType.NotUrget); } if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null) @@ -253,7 +256,7 @@ namespace IRaCIS.Core.Application.Service task2.TaskAllocationState = defaultState; task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId; task2.AllocateTime = DateTime.Now; - task2.SuggesteFinishedTime = DateTime.Now.AddDays(7); + task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } } @@ -298,7 +301,7 @@ namespace IRaCIS.Core.Application.Service singleTask.AllocateTime = DateTime.Now; - singleTask.SuggesteFinishedTime = DateTime.Now.AddDays(7); + singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } @@ -422,6 +425,49 @@ namespace IRaCIS.Core.Application.Service } + public DateTime GetSuggessFinishTime(bool isInOrder, UrgentType urgentType ) + { + + var datetime= new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day + 7, 22, 0, 0); + //switch (urgentType) + //{ + // case UrgentType.NotUrget: + + // datetime= new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day + 7, 22, 0, 0); + + // break; + // case UrgentType.EnrollConfirm: + + // datetime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day , 22, 0, 0); + // break; + + // case UrgentType.EnrollConfirmOtherNotUrgent: + + // datetime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day+5, 22, 0, 0); + // break; + + // case UrgentType.PDVProgressVisitOrGlobal: + // datetime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 22, 0, 0); + // break; + // case UrgentType.PDVProgressJudge: + // datetime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day+1, 22, 0, 0); + // break; + + // //不加急 7天 + // case UrgentType.NormalUrgent: + + // datetime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day + 7, 22, 0, 0); + // break; + + // default: + // break; + //} + + return datetime; + + + + } public async Task AddTaskAsync(GenerateTaskCommand generateTaskCommand) @@ -640,7 +686,7 @@ namespace IRaCIS.Core.Application.Service task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId; task1.AllocateTime = DateTime.Now; - task1.SuggesteFinishedTime = DateTime.Now.AddDays(7); + task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null) @@ -648,7 +694,7 @@ namespace IRaCIS.Core.Application.Service task2.TaskAllocationState = defaultState; task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId; task2.AllocateTime = DateTime.Now; - task2.SuggesteFinishedTime = DateTime.Now.AddDays(7); + task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } #endregion @@ -688,7 +734,7 @@ namespace IRaCIS.Core.Application.Service arm1.TaskAllocationState = TaskAllocationState.Allocated; arm1.AllocateTime = DateTime.Now; arm1.DoctorUserId = task1.DoctorUserId; - arm1.SuggesteFinishedTime = DateTime.Now.AddDays(7); + arm1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } } @@ -718,7 +764,7 @@ namespace IRaCIS.Core.Application.Service TaskAllocationState = TaskAllocationState.Allocated, AllocateTime = DateTime.Now, DoctorUserId = task1.DoctorUserId, - SuggesteFinishedTime = DateTime.Now.AddDays(7), + SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget), TrialReadingCriterionId = latestTask.TrialReadingCriterionId, IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign, IsClinicalDataSign = latestTask.IsClinicalDataSign @@ -747,7 +793,7 @@ namespace IRaCIS.Core.Application.Service arm2.TaskAllocationState = TaskAllocationState.Allocated; arm2.AllocateTime = DateTime.Now; arm2.DoctorUserId = task2.DoctorUserId; - arm2.SuggesteFinishedTime = DateTime.Now.AddDays(7); + arm2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } } @@ -779,7 +825,7 @@ namespace IRaCIS.Core.Application.Service TaskAllocationState = TaskAllocationState.Allocated, AllocateTime = DateTime.Now, DoctorUserId = task2.DoctorUserId, - SuggesteFinishedTime = DateTime.Now.AddDays(7), + SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget), TrialReadingCriterionId = latestTask.TrialReadingCriterionId, IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign, @@ -808,7 +854,7 @@ namespace IRaCIS.Core.Application.Service task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId; task1.AllocateTime = DateTime.Now; - task1.SuggesteFinishedTime = DateTime.Now.AddDays(7); + task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null) @@ -816,7 +862,7 @@ namespace IRaCIS.Core.Application.Service task2.TaskAllocationState = defaultState; task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId; task2.AllocateTime = DateTime.Now; - task2.SuggesteFinishedTime = DateTime.Now.AddDays(7); + task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } } @@ -924,7 +970,7 @@ namespace IRaCIS.Core.Application.Service singleTask.AllocateTime = DateTime.Now; - singleTask.SuggesteFinishedTime = DateTime.Now.AddDays(7); + singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } @@ -960,7 +1006,7 @@ namespace IRaCIS.Core.Application.Service arm.TaskAllocationState = TaskAllocationState.Allocated; arm.AllocateTime = DateTime.Now; arm.DoctorUserId = singleTask.DoctorUserId; - arm.SuggesteFinishedTime = DateTime.Now.AddDays(7); + arm.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } else { @@ -1029,7 +1075,7 @@ namespace IRaCIS.Core.Application.Service singleTask.AllocateTime = DateTime.Now; - singleTask.SuggesteFinishedTime = DateTime.Now.AddDays(7); + singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); } @@ -1203,7 +1249,7 @@ namespace IRaCIS.Core.Application.Service DoctorUserId = task.DoctorUserId, TaskAllocationState = TaskAllocationState.Allocated, AllocateTime = DateTime.Now, - SuggesteFinishedTime = DateTime.Now.AddDays(7), + SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget), SouceReadModuleId = task.SouceReadModuleId, SourceSubjectVisitId = task.SourceSubjectVisitId, @@ -1253,7 +1299,7 @@ namespace IRaCIS.Core.Application.Service DoctorUserId = task.DoctorUserId, TaskAllocationState = TaskAllocationState.Allocated, AllocateTime = DateTime.Now, - SuggesteFinishedTime = DateTime.Now.AddDays(7), + SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget), IsAnalysisCreate = true, IsSelfAnalysis = false, @@ -1300,7 +1346,7 @@ namespace IRaCIS.Core.Application.Service DoctorUserId = subjectUser == null ? null : subjectUser.DoctorUserId, TaskAllocationState = subjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated, AllocateTime = subjectUser == null ? null : DateTime.Now, - SuggesteFinishedTime = subjectUser == null ? null : DateTime.Now.AddDays(7), + SuggesteFinishedTime = subjectUser == null ? null : GetSuggessFinishTime(true, UrgentType.NotUrget), TrialReadingCriterionId = firstTask.TrialReadingCriterionId, @@ -1354,7 +1400,7 @@ namespace IRaCIS.Core.Application.Service DoctorUserId = originalTaskInfo.DoctorUserId, AllocateTime = DateTime.Now, TaskAllocationState = TaskAllocationState.Allocated, - SuggesteFinishedTime = DateTime.Now.AddDays(7), + SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget), Code = currentMaxCodeInt + 1, TaskBlindName = "G-"+ visitNumList.IndexOf(originalTaskInfo.VisitTaskNum), @@ -1404,7 +1450,7 @@ namespace IRaCIS.Core.Application.Service DoctorUserId = oncologySubjectUser == null ? null : oncologySubjectUser.DoctorUserId, AllocateTime = oncologySubjectUser == null ? null : DateTime.Now, TaskAllocationState = oncologySubjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated, - SuggesteFinishedTime = oncologySubjectUser == null ? null : DateTime.Now.AddDays(7), + SuggesteFinishedTime = oncologySubjectUser == null ? null : GetSuggessFinishTime(true, UrgentType.NotUrget), TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), ReadingCategory = item.ReadingCategory, diff --git a/IRaCIS.Core.Domain.Share/Reading/UrgentType.cs b/IRaCIS.Core.Domain.Share/Reading/UrgentType.cs new file mode 100644 index 00000000..270e3b86 --- /dev/null +++ b/IRaCIS.Core.Domain.Share/Reading/UrgentType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Domain.Share.Reading +{ + + + public enum UrgentType + { + NotUrget = 0, + + EnrollConfirm = 1, + + EnrollConfirmOtherNotUrgent=5, + + PDVProgressVisitOrGlobal = 2, + + PDVProgressJudge = 3, + + NormalUrgent = 4, + + + + } +}