From ac4fce8648621bbe4f8d20f8fadd4f286d3b1343 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Thu, 16 Jun 2022 11:33:54 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=86=E9=85=8D=E9=AA=8C?=
=?UTF-8?q?=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 2 +-
.../Allocation/DTO/TaskAllocationRuleViewModel.cs | 8 ++++----
.../Service/Allocation/VisitTaskService.cs | 14 ++++++++++++++
3 files changed, 19 insertions(+), 5 deletions(-)
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();
}
+
+
///
/// 任务 手动分配 重新分配 确认 取消分配
/// 分配