增加分配验证

Uat_Study
hang 2022-06-16 11:33:54 +08:00
parent 793b798ef8
commit ac4fce8648
3 changed files with 19 additions and 5 deletions

View File

@ -123,7 +123,7 @@
<summary> <summary>
批量取消Subject 分配的医生 批量取消Subject 分配的医生
</summary> </summary>
<returns></returns> <returns></returns> 数量
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.ManualAssignDoctorApplyTask(IRaCIS.Core.Application.ViewModel.AssignConfirmCommand)"> <member name="M:IRaCIS.Core.Application.Service.VisitTaskService.ManualAssignDoctorApplyTask(IRaCIS.Core.Application.ViewModel.AssignConfirmCommand)">
<summary> <summary>

View File

@ -27,20 +27,20 @@ namespace IRaCIS.Core.Application.ViewModel
//总任务数 //总任务数
public int? TotalTaskCount { get; set; } public int? TotalTaskCount { get; set; }
//应用的总数 //应用的任务总数
public int? ApplyedTotalTaskCount { get; set; } public int? ApplyedTotalTaskCount { get; set; }
//自己的任务数 //自己的任务数
public int? SelfTaskCount { get; set; } public int? SelfTaskCount { get; set; }
//分配给自己的Subject数量 //分配给自己的Subject数量
public int? SelfSubjectCount { get; set; } public int? SelfSubjectCount { get; set; }
//已应用的Subject //已应用的Subject
public int? ApplyedTotalSubjectCount { get; set; } public int? ApplyedTotalSubjectCount { get; set; }
//系统Subject //系统Subject
public int? TotalSubjectCount { get; set; } public int? TotalSubjectCount { get; set; }

View File

@ -344,6 +344,13 @@ namespace IRaCIS.Core.Application.Service
if (assginSubjectDoctorCommand.IsReAssign) 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)); 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) 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 _subjectUserRepository.DeleteFromQueryAsync(t => t.SubjectId == subjectId);
//await _subjectRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectId, u => new Subject() { IsAssignDoctorUser = false }); //await _subjectRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectId, u => new Subject() { IsAssignDoctorUser = false });
} }
@ -792,6 +804,8 @@ namespace IRaCIS.Core.Application.Service
return ResponseOutput.Ok(); return ResponseOutput.Ok();
} }
/// <summary> /// <summary>
/// 任务 手动分配 重新分配 确认 取消分配 /// 任务 手动分配 重新分配 确认 取消分配
/// </summary>分配 /// </summary>分配