From 3592e4565e58099544100e5bd3103e2b2f9f96dd Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 27 Mar 2025 10:39:43 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0WorkGridCode=E4=BC=98?= =?UTF-8?q?=E5=85=88=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Request/WorkGridScheduleAttendancePageRequest.cs | 3 ++- .../Services/Implements/WorkGridScheduleService.cs | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.Basic/WorkGrids/Request/WorkGridScheduleAttendancePageRequest.cs b/Src/Dlhis.Basic/WorkGrids/Request/WorkGridScheduleAttendancePageRequest.cs index 96d02a04..66571469 100644 --- a/Src/Dlhis.Basic/WorkGrids/Request/WorkGridScheduleAttendancePageRequest.cs +++ b/Src/Dlhis.Basic/WorkGrids/Request/WorkGridScheduleAttendancePageRequest.cs @@ -1,4 +1,3 @@ -using System.ComponentModel.DataAnnotations; using Kurisu.AspNetCore.CustomClass; using Kurisu.AspNetCore.DataAccess.Dto; @@ -6,6 +5,8 @@ namespace Dlhis.Basic.WorkGrids.Request; public class WorkGridScheduleAttendancePageRequest : PageDto { + public Guid? WorkGridCode { get; set; } + public string UserCode { get; set; } public DateTimePeriod DateTimePeriod { get; set; } diff --git a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs index f074ebbb..baa4d893 100644 --- a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs +++ b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs @@ -243,7 +243,11 @@ public class WorkGridScheduleService : IWorkGridScheduleService public async Task> GetAttendancePageAsync(WorkGridScheduleAttendancePageRequest request) { var jinkoCode = _currentUser.GetUserClaim(UserClaimConstants.JinkoCode); - var workGrid = await _dbContext.Queryable().Where(x => x.LeaderUserCode == jinkoCode).SingleAsync(); + var workGrid = await _dbContext.Queryable() + .WhereIF(request.WorkGridCode.HasValue, x => x.Code == request.WorkGridCode) + .WhereIF(request.WorkGridCode.HasValue == false, x => x.LeaderUserCode == jinkoCode) + .SingleAsync(); + if (workGrid == null) { return new Pagination