fix 参数控制

This commit is contained in:
2025-04-07 10:36:47 +08:00
parent 0b97d70f0e
commit ea22977a55

View File

@@ -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
{