add filter status #2083

This commit is contained in:
harid 2025-12-22 09:49:59 +07:00
parent 97c9064ab5
commit 3b58d38eb1

View file

@ -59,7 +59,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetDisciplineSuspend(DateTime? startDate, DateTime? endDate, int page = 1, int pageSize = 25, string keyword = "", string profileType = "", string? sortBy = "", bool? descending = false)
public async Task<ActionResult<ResponseObject>> GetDisciplineSuspend(DateTime? startDate, DateTime? endDate, int page = 1, int pageSize = 25, string keyword = "", string profileType = "", string? sortBy = "", bool? descending = false, string? status="")
{
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_DISCIPLINE_SUSPENDED");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -78,7 +78,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
) :
true
)
&&
&&
(
(x.CitizenId != null && x.CitizenId.Contains(keyword)) ||
((x.Prefix ?? "") + (x.FirstName ?? "") + " " + (x.LastName ?? "")).Contains(keyword) ||
@ -94,6 +94,10 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
(profileType.ToUpper() == "OFFICER" && x.profileType == "OFFICER") ||
(profileType.ToUpper() == "EMPLOYEE" && x.profileType == "EMPLOYEE")
)
&&
(
!string.IsNullOrEmpty(status) ? x.Status!.Trim().ToUpper() == status : true
)
select x).ToList();
var query = data_search
.Select(x => new