add 增加WorkGridCode优先使用

This commit is contained in:
2025-03-27 10:39:43 +08:00
parent f6b04b6ee1
commit 3592e4565e
2 changed files with 7 additions and 2 deletions

View File

@@ -243,7 +243,11 @@ public class WorkGridScheduleService : IWorkGridScheduleService
public async Task<Pagination<WorkGridScheduleAttendancePageResponse>> GetAttendancePageAsync(WorkGridScheduleAttendancePageRequest request)
{
var jinkoCode = _currentUser.GetUserClaim(UserClaimConstants.JinkoCode);
var workGrid = await _dbContext.Queryable<WorkGridEntity>().Where(x => x.LeaderUserCode == jinkoCode).SingleAsync();
var workGrid = await _dbContext.Queryable<WorkGridEntity>()
.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<WorkGridScheduleAttendancePageResponse>