diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 0302bc536..1f9293bfe 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -24,6 +24,8 @@ namespace IRaCIS.Core.Application.ViewModel public TaskState TaskState { get; set; } + public bool IsJudgeTaskReturn { get; set; } + public DateTime? CheckPassedTime { get; set; } public DateTime? AllocateTime { get; set; } @@ -277,7 +279,7 @@ namespace IRaCIS.Core.Application.ViewModel public List DoctorUserIdList => DoctorUserList.Select(t => t.DoctorUserId).ToList(); //.ForEach(t => t.HistoryDoctorList = TotalDoctorUserList.Where(c => (Guid?)t.Id == c.OrignalSubjectUserId).ToList()) - public List DoctorUserList => TotalDoctorUserList.Where(t => t.IsConfirmed && t.OrignalSubjectUserId == null).ToList() + public List DoctorUserList => TotalDoctorUserList.Where(t => t.OrignalSubjectUserId == null).ToList() ; [JsonIgnore] diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index ffdc55fd8..784de31dc 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -287,7 +287,7 @@ namespace IRaCIS.Core.Application.Service foreach (var reReadingVisitTask in generateTaskCommand.ReReadingTaskList) { reReadingVisitTask.OriginalReReadingId = reReadingVisitTask.Id; - reReadingVisitTask.OriginalReReadingId = Guid.Empty; + reReadingVisitTask.Id = Guid.Empty; reReadingVisitTask. Code = currentMaxCodeInt + 1; reReadingVisitTask.TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)); diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index a199f1c7b..095bd7492 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -815,10 +815,17 @@ namespace IRaCIS.Core.Application.Service if (visitTask.SourceSubjectVisitId != null) { + if(await _visitTaskRepository.AnyAsync(t=>t.SourceSubjectVisitId== visitTask.SourceSubjectVisitId && t.DoctorUserId== assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id)) + { + return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配"); + } } else if (visitTask.SouceReadModuleId != null) { - + if (await _visitTaskRepository.AnyAsync(t => t.SouceReadModuleId == visitTask.SouceReadModuleId && t.DoctorUserId == assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id)) + { + return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配"); + } } else { @@ -878,17 +885,33 @@ namespace IRaCIS.Core.Application.Service [UnitOfWork] public async Task ApplyReReading(ApplyReReadingCommand applyReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService) { - var taskList = await _visitTaskRepository.Where(t => applyReReadingCommand.TaskIdList.Contains(t.Id), true).ToListAsync(); + var taskList = await _visitTaskRepository.Where(t => applyReReadingCommand.TaskIdList.Contains(t.Id), true).Include(t=>t.JudgeVisitTask).ToListAsync(); var reReadingTaskList = taskList.Clone(); foreach (var task in taskList) { + + task.IsReReading = true; task.RequestReReadingReason = applyReReadingCommand.RequestReReadingReason; task.RequestReReadingType = applyReReadingCommand.RequestReReadingTypeEnum; task.RequestReReadingTime = DateTime.Now; task.RequestReReadingUserId = _userInfo.Id; + + //产生了裁判 + if (task.JudgeVisitTaskId != null) + { + if(task.ReadingTaskState==ReadingTaskState.WaitReading || task.ReadingTaskState == ReadingTaskState.Reading) + { + + } + else + { + task.JudgeVisitTask.IsJudgeTaskReturn = true; + + } + } } await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand() diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs index 30ad35f91..2aa7df4f6 100644 --- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs +++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs @@ -31,11 +31,14 @@ namespace IRaCIS.Core.Domain.Share //未分配 NotAllocate = 0, - + //预分配 InitAllocated = 1, //已分配 Allocated = 2, + + //已取消 + HaveCanceled=3 } public enum Arm diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index 5f8e42a73..8add719fe 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -134,6 +134,11 @@ namespace IRaCIS.Core.Domain.Models public TaskAllocationRule DoctorTaskAllocationRule { get; set; } + public bool IsJudgeTaskReturn { get; set; } + + //是否回退过 + public bool IsReturned { get; set; } + //裁判任务的Id public Guid? JudgeVisitTaskId { get; set; } @@ -151,8 +156,7 @@ namespace IRaCIS.Core.Domain.Models //签名时间 public DateTime? SignTime { get; set; } - //是否回退过 - public bool IsReturned { get; set; } + //是否 重阅 public bool IsReReading { get; set; }