From d07755b9fbaf166b015b5bdde7d5bca6b92da360 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Mon, 3 Mar 2025 16:40:36 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=90=8C=E6=AD=A5=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=8E=92=E7=8F=AD=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs | 1 + .../WorkGrids/Services/Implements/WorkGridService.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs b/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs index c97f7c86..17cd70db 100644 --- a/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs +++ b/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs @@ -114,6 +114,7 @@ public class WorkGridsController : ControllerBase /// /// [HttpPost("user/remove")] + [Transactional] public async Task RemoveUsersFromWorkGridAsync(WorkGridUserRemoveRequest request) { await _workGridService.RemoveAsync(request); diff --git a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs index d41b1856..c01d8c73 100644 --- a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs +++ b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs @@ -171,6 +171,11 @@ public class WorkGridService : IWorkGridService .Where(x => request.UserCodes.Contains(x.UserCode)) .ToListAsync(); + var workGridSchedules = await _dbContext.Queryable().Where(x => x.WorkGridCode == myWorkGrid.Code) + .Where(x => request.UserCodes.Contains(x.UserCode)) + .ToListAsync(); + await _dbContext.DeleteReallyAsync(workGridUsers); + await _dbContext.DeleteReallyAsync(workGridSchedules); } } \ No newline at end of file