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