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();