修改添加

Uat_Study
hang 2022-07-29 11:32:48 +08:00
parent 283bbd29e5
commit 904d5f3a3d
3 changed files with 21 additions and 10 deletions

View File

@ -418,6 +418,13 @@ namespace IRaCIS.Core.Application.ViewModel
} }
public class CancelSubjectDoctorCommand
{
public List<CancelSubjectAssignedDoctorCommand> CancelList { get; set; }
public string Note { get; set; } = string.Empty;
}
public class SubjectAssignView public class SubjectAssignView

View File

@ -102,12 +102,12 @@ namespace IRaCIS.Core.Application.Service
} }
public async Task<IResponseOutput> AddSubjectCancelDoctorNote(CancelDoctorCommand command) //public async Task<IResponseOutput> AddSubjectCancelDoctorNote(CancelDoctorCommand command)
{ //{
await _subjectCanceDoctorRepository.InsertOrUpdateAsync(command, true); // await _subjectCanceDoctorRepository.InsertOrUpdateAsync(command, true);
return ResponseOutput.Ok(); // return ResponseOutput.Ok();
} //}
public async Task<List<SubjectCancelDoctorView>> GetSubjectCancelDoctorHistoryList(Guid subjectId) public async Task<List<SubjectCancelDoctorView>> GetSubjectCancelDoctorHistoryList(Guid subjectId)
{ {

View File

@ -154,13 +154,13 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// <summary> /// <summary>
/// 取消Subject 分配的医生 /// 取消Subject 分配的医生
/// </summary> /// </summary>
/// <param name="commandList"></param> /// <param name="cancelCommand"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception> /// <exception cref="BusinessValidationFailedException"></exception>
[HttpPost] [HttpPost]
public async Task<IResponseOutput> CancelSubjectAssignedDoctor(List<CancelSubjectAssignedDoctorCommand> commandList) public async Task<IResponseOutput> 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)) 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(); await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(); return ResponseOutput.Ok();