From 904d5f3a3ddf4af3d440ecd75fd4488ba20d7306 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 29 Jul 2022 11:32:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/DTO/VisitTaskViewModel.cs | 11 +++++++++-- .../Service/Allocation/TaskAllocationRuleService.cs | 10 +++++----- .../Service/Allocation/VisitTaskService.cs | 10 +++++++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index d354428fc..61483d8d3 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -244,7 +244,7 @@ namespace IRaCIS.Core.Application.ViewModel public string? TaskCode { get; set; } - public String? TrialSiteCode { get; set; } + public String? TrialSiteCode { get; set; } public ReReadingApplyState? ReReadingApplyState { get; set; } @@ -398,7 +398,7 @@ namespace IRaCIS.Core.Application.ViewModel } - public class SubjectUserDTO: SubjectUserView + public class SubjectUserDTO : SubjectUserView { public bool IsHaveReading { get; set; } } @@ -418,6 +418,13 @@ namespace IRaCIS.Core.Application.ViewModel } + public class CancelSubjectDoctorCommand + { + public List CancelList { get; set; } + + public string Note { get; set; } = string.Empty; + } + public class SubjectAssignView diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs index efc95ed15..ccfd46bc0 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs @@ -102,12 +102,12 @@ namespace IRaCIS.Core.Application.Service } - public async Task AddSubjectCancelDoctorNote(CancelDoctorCommand command) - { - await _subjectCanceDoctorRepository.InsertOrUpdateAsync(command, true); + //public async Task AddSubjectCancelDoctorNote(CancelDoctorCommand command) + //{ + // await _subjectCanceDoctorRepository.InsertOrUpdateAsync(command, true); - return ResponseOutput.Ok(); - } + // return ResponseOutput.Ok(); + //} public async Task> GetSubjectCancelDoctorHistoryList(Guid subjectId) { diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 7f5c5357d..899e0ee79 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -154,13 +154,13 @@ namespace IRaCIS.Core.Application.Service.Allocation /// /// 取消Subject 分配的医生 /// - /// + /// /// /// [HttpPost] - public async Task CancelSubjectAssignedDoctor(List commandList) + public async Task CancelSubjectAssignedDoctor(CancelSubjectDoctorCommand cancelCommand) { - foreach (var command in commandList.Where(t => t.IsCancelAssign)) + foreach (var command in cancelCommand.CancelList.Where(t => t.IsCancelAssign)) { if (await _visitTaskRepository.AnyAsync(t => t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading)) { @@ -178,6 +178,10 @@ namespace IRaCIS.Core.Application.Service.Allocation }); } + var subjectId = cancelCommand.CancelList.First().SubjectId; + + await _repository.AddAsync(new SubjectCanceDoctor() { SubjectId = subjectId, Note = cancelCommand.Note }); + await _visitTaskRepository.SaveChangesAsync(); return ResponseOutput.Ok();