แก้ defect
add send noti when create ลงเวลากรณีพิเศษ
This commit is contained in:
parent
bb637bca36
commit
ee4ef41547
8 changed files with 144 additions and 12 deletions
|
|
@ -146,7 +146,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return await rawData.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<LeaveRequest>> GetLeaveRequestForAdminAsync(int year, Guid type, string status)
|
||||
public async Task<List<LeaveRequest>> GetLeaveRequestForAdminAsync(int year, Guid type, string status, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
var rawData = _dbContext.Set<LeaveRequest>()
|
||||
.Include(x => x.Type)
|
||||
|
|
@ -164,6 +164,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
if (status.Trim().ToUpper() != "ALL")
|
||||
rawData = rawData.Where(x => x.LeaveStatus == status);
|
||||
|
||||
if (startDate != DateTime.MinValue)
|
||||
rawData = rawData.Where(x => x.LeaveStartDate >= startDate);
|
||||
|
||||
if (endDate != DateTime.MinValue)
|
||||
rawData = rawData.Where(x => x.LeaveEndDate <= endDate);
|
||||
|
||||
return await rawData.ToListAsync();
|
||||
}
|
||||
|
||||
|
|
@ -570,7 +576,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
.Include(x => x.Type)
|
||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||
.Where(x => x.LeaveStartDate.Date == startDate.Date || x.LeaveEndDate.Date == endDate.Date)
|
||||
.Where(x => x.LeaveStatus == "DELETE" && x.LeaveStatus == "REJECT")
|
||||
.Where(x => x.LeaveStatus == "NEW" || x.LeaveStatus == "PENDING" || x.LeaveStatus == "APPROVE")
|
||||
.ToListAsync();
|
||||
|
||||
return data.Count > 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue