fix 同步移除排班数据

This commit is contained in:
2025-03-03 16:40:36 +08:00
parent 1c1b258e84
commit d07755b9fb
2 changed files with 6 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ public class WorkGridsController : ControllerBase
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("user/remove")]
[Transactional]
public async Task RemoveUsersFromWorkGridAsync(WorkGridUserRemoveRequest request)
{
await _workGridService.RemoveAsync(request);

View File

@@ -171,6 +171,11 @@ public class WorkGridService : IWorkGridService
.Where(x => request.UserCodes.Contains(x.UserCode))
.ToListAsync();
var workGridSchedules = await _dbContext.Queryable<WorkGridScheduleEntity>().Where(x => x.WorkGridCode == myWorkGrid.Code)
.Where(x => request.UserCodes.Contains(x.UserCode))
.ToListAsync();
await _dbContext.DeleteReallyAsync(workGridUsers);
await _dbContext.DeleteReallyAsync(workGridSchedules);
}
}