กรองค้นหาข้อมูลรายการลงเวลากรณีพิเศษ #2252
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m24s

This commit is contained in:
harid 2026-01-28 16:24:59 +07:00
parent b10ff45d07
commit 90eb94cee3
2 changed files with 13 additions and 2 deletions

View file

@ -144,7 +144,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
}
}
public async Task<List<AdditionalCheckRequest>> GetAdditionalCheckRequestsByAdminRole(int year, int month, string role, string nodeId, int? node)
public async Task<List<AdditionalCheckRequest>> GetAdditionalCheckRequestsByAdminRole(int year, int month, string role, string nodeId, int? node, string? keyword)
{
try
{
@ -152,6 +152,17 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
.Where(x => (x.CheckDate.Year == year && x.CheckDate.Month == month))
.OrderByDescending(x => x.CreatedAt.Date)
.ToListAsync();
if (!string.IsNullOrEmpty(keyword))
{
data = data.Where(x =>
(
(x.Prefix ?? "") + (x.FirstName ?? "") + " " + (x.LastName ?? "")).Contains(keyword)
|| x.Description.Contains(keyword)
).ToList();
}
if (role == "OWNER")
{
node = null;

View file

@ -2805,7 +2805,7 @@ namespace BMA.EHR.Leave.Service.Controllers
}
//var rawData = await _additionalCheckRequestRepository.GetAdditionalCheckRequests(year, month);
var rawData = await _additionalCheckRequestRepository.GetAdditionalCheckRequestsByAdminRole(year, month, role, nodeId, profileAdmin?.Node);
var rawData = await _additionalCheckRequestRepository.GetAdditionalCheckRequestsByAdminRole(year, month, role, nodeId, profileAdmin?.Node, keyword);
var total = rawData.Count;