From 0b97d70f0e9c46513777b1da311546d8b549983c Mon Sep 17 00:00:00 2001 From: liguoyang Date: Mon, 7 Apr 2025 10:33:14 +0800 Subject: [PATCH] add MaxConsecutiveLimitCount --- Src/Dlhis.Basic/WorkGrids/Request/WorkGridSaveRequest.cs | 7 +++++++ .../WorkGrids/Response/WorkGridPageResponse.cs | 2 ++ .../WorkGrids/Response/WorkGridUserPageResponse.cs | 6 ++++-- .../Services/Implements/WorkGridScheduleService.cs | 3 +-- .../WorkGrids/Services/Implements/WorkGridService.cs | 8 ++++++-- Src/Dlhis.Entity/Basic/Entity/WorkGridEntity.cs | 7 +++++++ 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Src/Dlhis.Basic/WorkGrids/Request/WorkGridSaveRequest.cs b/Src/Dlhis.Basic/WorkGrids/Request/WorkGridSaveRequest.cs index d1c7c1d6..d8c05825 100644 --- a/Src/Dlhis.Basic/WorkGrids/Request/WorkGridSaveRequest.cs +++ b/Src/Dlhis.Basic/WorkGrids/Request/WorkGridSaveRequest.cs @@ -32,4 +32,11 @@ public class WorkGridSaveRequest /// [Range(1, int.MaxValue, ErrorMessage = "请设置连续排班数提醒")] public int MaxConsecutiveTipCount { get; set; } + + + /// + /// 请设置连续排班限制 + /// + [Range(1, int.MaxValue, ErrorMessage = "请设置连续排班限制")] + public int MaxConsecutiveLimitCount { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Basic/WorkGrids/Response/WorkGridPageResponse.cs b/Src/Dlhis.Basic/WorkGrids/Response/WorkGridPageResponse.cs index 501e0edd..7cc81281 100644 --- a/Src/Dlhis.Basic/WorkGrids/Response/WorkGridPageResponse.cs +++ b/Src/Dlhis.Basic/WorkGrids/Response/WorkGridPageResponse.cs @@ -40,4 +40,6 @@ public class WorkGridPageResponse public int MaxUserTipCount { get; set; } public int MaxConsecutiveTipCount { get; set; } + + public int MaxConsecutiveLimitCount { get; set; } } \ No newline at end of file diff --git a/Src/Dlhis.Basic/WorkGrids/Response/WorkGridUserPageResponse.cs b/Src/Dlhis.Basic/WorkGrids/Response/WorkGridUserPageResponse.cs index d83371b4..912d030a 100644 --- a/Src/Dlhis.Basic/WorkGrids/Response/WorkGridUserPageResponse.cs +++ b/Src/Dlhis.Basic/WorkGrids/Response/WorkGridUserPageResponse.cs @@ -23,17 +23,19 @@ public class WorkGridUserPageResponse /// 员工数 /// public int UserCount { get; set; } - + /// /// 最大用户数设置 /// public int MaxUserTipCount { get; set; } - + /// /// 请设置连续排班数提醒 /// public int MaxConsecutiveTipCount { get; set; } + public int MaxConsecutiveLimitCount { get; set; } + /// /// 员工明细 /// diff --git a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs index ae3553b4..6a61b533 100644 --- a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs +++ b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs @@ -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 { diff --git a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs index 51a1bf44..02fb41b8 100644 --- a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs +++ b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridService.cs @@ -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().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(); diff --git a/Src/Dlhis.Entity/Basic/Entity/WorkGridEntity.cs b/Src/Dlhis.Entity/Basic/Entity/WorkGridEntity.cs index 9ca91351..ef7fa82e 100644 --- a/Src/Dlhis.Entity/Basic/Entity/WorkGridEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/WorkGridEntity.cs @@ -49,5 +49,12 @@ public class WorkGridEntity : SugarBaseEntity, ISoftDeleted [SugarColumn(IsNullable = false, ColumnDescription = "最大排班连续天数提醒")] public int MaxConsecutiveTipCount { get; set; } + /// + /// 请设置连续排班限制 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "请设置连续排班限制")] + public int MaxConsecutiveLimitCount { get; set; } + + public bool IsDeleted { get; set; } } \ No newline at end of file