From 6a0f448531e6ae7721bc92eb6d1ceb309435450e Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 6 Mar 2025 17:07:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=9610=E5=A4=A9=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/WorkGridScheduleService.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs index fb44e1ab..c34ea385 100644 --- a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs +++ b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs @@ -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(",")}"); }