fix 优化排班
This commit is contained in:
@@ -42,6 +42,10 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
var workGrid = await _dbContext.Queryable<WorkGridEntity>().SingleAsync(x => x.Code == request.WorkGridCode);
|
||||
workGrid.ThrowIfNull("工作网格不存在");
|
||||
|
||||
var timeSetting = await _dbContext.Queryable<WorkGridTimePeriodEntity>().Where(x => x.Type == request.PeriodType).Select(x => new { x.Start, x.Before }).SingleAsync();
|
||||
var currentLimit = request.Date.ToDateTime(timeSetting.Start.Add(-TimeSpan.FromSeconds(timeSetting.Before)));
|
||||
(DateTime.Now >= currentLimit).ThrowIfTrue("当前时间不可修改排班信息");
|
||||
|
||||
var workGridUserCodes = await _dbContext.Queryable<WorkGridUserEntity>()
|
||||
.Where(x => x.WorkGridCode == workGrid.Code && request.UserCodes.Contains(x.UserCode))
|
||||
.Select(x => x.UserCode)
|
||||
|
||||
Reference in New Issue
Block a user