add MaxConsecutiveLimitCount
This commit is contained in:
@@ -32,4 +32,11 @@ public class WorkGridSaveRequest
|
||||
/// </summary>
|
||||
[Range(1, int.MaxValue, ErrorMessage = "请设置连续排班数提醒")]
|
||||
public int MaxConsecutiveTipCount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 请设置连续排班限制
|
||||
/// </summary>
|
||||
[Range(1, int.MaxValue, ErrorMessage = "请设置连续排班限制")]
|
||||
public int MaxConsecutiveLimitCount { get; set; }
|
||||
}
|
||||
@@ -40,4 +40,6 @@ public class WorkGridPageResponse
|
||||
public int MaxUserTipCount { get; set; }
|
||||
|
||||
public int MaxConsecutiveTipCount { get; set; }
|
||||
|
||||
public int MaxConsecutiveLimitCount { get; set; }
|
||||
}
|
||||
@@ -34,6 +34,8 @@ public class WorkGridUserPageResponse
|
||||
/// </summary>
|
||||
public int MaxConsecutiveTipCount { get; set; }
|
||||
|
||||
public int MaxConsecutiveLimitCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工明细
|
||||
/// </summary>
|
||||
|
||||
@@ -101,8 +101,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
}
|
||||
|
||||
var maximumConsecutiveDtos = await MaximumConsecutiveUserCodesAsync(request.UserCodes, 10, request.Date);
|
||||
//张三(工号)已连续排班10天,超10休1规定,禁止排班,请处理
|
||||
maximumConsecutiveDtos.ThrowIfExists(maximumConsecutiveDtos.Select(x => $"{x.UserCode}已经连续排班10天({x.Start}-{x.End}),超10休1规定,禁止排班").Join("\r\n"));
|
||||
maximumConsecutiveDtos.ThrowIfExists(maximumConsecutiveDtos.Select(x => $"{x.UserCode}已经连续排班10天({x.Start}-{x.End}),禁止排班").Join("\r\n"));
|
||||
|
||||
var toInserts = request.UserCodes.Select(x => new WorkGridScheduleEntity
|
||||
{
|
||||
|
||||
@@ -118,7 +118,9 @@ public class WorkGridService : IWorkGridService
|
||||
await ChangeAsync(entity.LeaderUserCode, request.LeaderUserCode);
|
||||
}
|
||||
|
||||
updateGrids.Add($"{entity.Name}->{request.Name},排班用户数{entity.MaxUserTipCount}->{request.MaxUserTipCount},连续排班天数:{entity.MaxConsecutiveTipCount}->{request.MaxConsecutiveTipCount}");
|
||||
updateGrids.Add($"{entity.Name}->{request.Name}," +
|
||||
$"排班用户数{entity.MaxUserTipCount}->{request.MaxUserTipCount}," +
|
||||
$"连续排班天数:{entity.MaxConsecutiveTipCount}->{request.MaxConsecutiveTipCount},${entity.MaxConsecutiveLimitCount}->{request.MaxConsecutiveLimitCount}");
|
||||
request.Adapt(entity);
|
||||
entity.LeaderUserCode = request.LeaderUserCode;
|
||||
|
||||
@@ -159,6 +161,7 @@ public class WorkGridService : IWorkGridService
|
||||
Remark = x.Remark,
|
||||
MaxUserTipCount = x.MaxUserTipCount,
|
||||
MaxConsecutiveTipCount = x.MaxConsecutiveTipCount,
|
||||
MaxConsecutiveLimitCount = x.MaxConsecutiveLimitCount,
|
||||
UserCount = SqlFunc.Subqueryable<WorkGridUserEntity>().Where(p => p.WorkGridCode == x.Code && p.IsDeleted == false).Count()
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
@@ -203,7 +206,8 @@ public class WorkGridService : IWorkGridService
|
||||
Name = x.Name,
|
||||
Remark = x.Remark,
|
||||
MaxUserTipCount = x.MaxUserTipCount,
|
||||
MaxConsecutiveTipCount = x.MaxConsecutiveTipCount
|
||||
MaxConsecutiveTipCount = x.MaxConsecutiveTipCount,
|
||||
MaxConsecutiveLimitCount = x.MaxConsecutiveLimitCount
|
||||
})
|
||||
.SingleAsync();
|
||||
|
||||
|
||||
@@ -49,5 +49,12 @@ public class WorkGridEntity : SugarBaseEntity, ISoftDeleted
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "最大排班连续天数提醒")]
|
||||
public int MaxConsecutiveTipCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请设置连续排班限制
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "请设置连续排班限制")]
|
||||
public int MaxConsecutiveLimitCount { get; set; }
|
||||
|
||||
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user