From 6352ffd9afaec09f264d7cce1ec7ee67153f388d Mon Sep 17 00:00:00 2001 From: liguoyang Date: Wed, 6 Mar 2024 17:34:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=A1=A3=E6=A1=88=E7=BB=84=E5=88=86?= =?UTF-8?q?=E9=85=8D=E4=BA=BA=E5=91=98=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Organization/Services/Implements/GainfoGroupService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs index ea35ff11..55df243d 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoGroupService.cs @@ -53,7 +53,7 @@ public class GainfoGroupService : IGainfoGroupService { _dbContext.Client.QueryFilter.Restore(); } - + if (!request.Id.HasValue) { @@ -86,6 +86,9 @@ public class GainfoGroupService : IGainfoGroupService public async Task AssignGainfosAsync(GainfoAssignRequest request) { + var existsNextGroup = await _dbContext.Queryable().Where(x => x.PCode == request.GroupCode).AnyAsync(); + existsNextGroup.ThrowIfTrue("存在下级分组,无法分配人员"); + var relations = await _dbContext.Queryable().Where(x => x.GroupCode == request.GroupCode).ToListAsync(); await _dbContext.DeleteReallyAsync(relations);