fix 优化10天禁止保存问题
This commit is contained in:
@@ -58,6 +58,9 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
|
||||
exists.ThrowIfTrue("当天已经存在排班人员");
|
||||
|
||||
var maximumConsecutiveDtos = await MaximumConsecutiveUserCodesAsync(request.UserCodes, 10, request.Date);
|
||||
maximumConsecutiveDtos.ThrowIfExists(maximumConsecutiveDtos.Select(x => $"{x.UserCode}已经连续排班10天({x.Start}-{x.End}),不可继续排班").Join("\r\n"));
|
||||
|
||||
var toInserts = request.UserCodes.Select(x => new WorkGridScheduleEntity
|
||||
{
|
||||
WorkGridCode = request.WorkGridCode,
|
||||
@@ -67,10 +70,6 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
}).ToList();
|
||||
|
||||
await _dbContext.InsertAsync(toInserts);
|
||||
|
||||
var maximumConsecutiveDtos = await MaximumConsecutiveUserCodesAsync(request.UserCodes, 11, request.Date);
|
||||
maximumConsecutiveDtos.ThrowIfExists(maximumConsecutiveDtos.Select(x => $"{x.UserCode}已经连续排班10天({x.Start}-{x.End}),不可继续排班").Join("\r\n"));
|
||||
|
||||
await _operateLog.LogAsync(OperateLogType.WorkGrid, $"新增网格({workGrid.Name}){request.Date.ToString("yyyy-M-d")}的{request.PeriodType.GetDescription()}人员:{request.UserCodes.Join(",")}");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user