diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 60a8328f0..9a43d72f1 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -123,7 +123,7 @@
批量取消Subject 分配的医生
-
+ 数量
diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs
index 158cada85..0fce6af28 100644
--- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs
@@ -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; }
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
index 2abe5b67e..0e6acfdf8 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
@@ -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();
}
+
+
///
/// 任务 手动分配 重新分配 确认 取消分配
/// 分配