增加分配验证
parent
793b798ef8
commit
ac4fce8648
|
@ -123,7 +123,7 @@
|
|||
<summary>
|
||||
批量取消Subject 分配的医生
|
||||
</summary>
|
||||
<returns></returns>
|
||||
<returns></returns> 数量
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.ManualAssignDoctorApplyTask(IRaCIS.Core.Application.ViewModel.AssignConfirmCommand)">
|
||||
<summary>
|
||||
|
|
|
@ -27,20 +27,20 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
//总任务数
|
||||
public int? TotalTaskCount { get; set; }
|
||||
|
||||
//应用的总数
|
||||
//应用的任务总数
|
||||
public int? ApplyedTotalTaskCount { get; set; }
|
||||
|
||||
//自己的任务数量
|
||||
//自己的任务数
|
||||
public int? SelfTaskCount { get; set; }
|
||||
|
||||
//分配给自己的Subject数量
|
||||
public int? SelfSubjectCount { get; set; }
|
||||
|
||||
|
||||
//已应用的Subject 总数
|
||||
//已应用的Subject 数
|
||||
public int? ApplyedTotalSubjectCount { get; set; }
|
||||
|
||||
//系统Subject 总数
|
||||
//系统Subject 数
|
||||
public int? TotalSubjectCount { get; set; }
|
||||
|
||||
|
||||
|
|
|
@ -344,6 +344,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (assginSubjectDoctorCommand.IsReAssign)
|
||||
{
|
||||
|
||||
if (await _visitTaskRepository.AnyAsync(t => assginSubjectDoctorCommand.SubjectIdList.Contains(t.SubjectId)&& t.DoctorUserId != null))
|
||||
{
|
||||
throw new BusinessValidationFailedException("有Subject任务已应用,不允许重新分配");
|
||||
}
|
||||
|
||||
|
||||
await _subjectUserRepository.BatchDeleteNoTrackingAsync(t => doctorUserIdList.Contains(t.DoctorUserId) && assginSubjectDoctorCommand.SubjectIdList.Contains(t.SubjectId));
|
||||
}
|
||||
|
||||
|
@ -374,6 +381,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
foreach (var subjectId in cancelSubjectAssignCommand.SubjectIdList)
|
||||
{
|
||||
if(await _visitTaskRepository.AnyAsync(t=>t.SubjectId==subjectId && t.DoctorUserId != null))
|
||||
{
|
||||
throw new BusinessValidationFailedException("有Subject任务已应用,不允许取消分配");
|
||||
}
|
||||
|
||||
await _subjectUserRepository.DeleteFromQueryAsync(t => t.SubjectId == subjectId);
|
||||
//await _subjectRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectId, u => new Subject() { IsAssignDoctorUser = false });
|
||||
}
|
||||
|
@ -792,6 +804,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 任务 手动分配 重新分配 确认 取消分配
|
||||
/// </summary>分配
|
||||
|
|
Loading…
Reference in New Issue