diff --git a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs index 6a61b533..2d4881fd 100644 --- a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs +++ b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs @@ -55,7 +55,8 @@ public class WorkGridScheduleService : IWorkGridScheduleService { x.Code, x.Name, x.LeaderUserCode, - LeaderUserName = ga.Name + LeaderUserName = ga.Name, + x.MaxConsecutiveLimitCount }) .SingleAsync(); workGrid.ThrowIfNull("工作网格不存在"); @@ -100,8 +101,8 @@ public class WorkGridScheduleService : IWorkGridScheduleService existsUserCodes.ThrowIfExists(existsUserCodes.Join(",") + $"在{dateAfter.ToString("yyyy-MM-dd")}已存在{WorkGridTimePeriodEnumType.Day.GetDescription()}"); } - 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 maximumConsecutiveDtos = await MaximumConsecutiveUserCodesAsync(request.UserCodes, workGrid.MaxConsecutiveLimitCount, request.Date); + maximumConsecutiveDtos.ThrowIfExists(maximumConsecutiveDtos.Select(x => $"{x.UserCode}已经连续排班{workGrid.MaxConsecutiveLimitCount}天({x.Start}-{x.End}),禁止排班").Join("\r\n")); var toInserts = request.UserCodes.Select(x => new WorkGridScheduleEntity {