add status filter
Some checks failed
release-dev / release-dev (push) Has been cancelled

This commit is contained in:
Bright 2025-02-20 16:59:21 +07:00
parent 9718ff149c
commit 12aceb5e00
8 changed files with 24 additions and 12 deletions

View file

@ -68,7 +68,7 @@ namespace BMA.EHR.Placement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string? status = "ALL")
{
var getPermission = await _permission.GetPermissionOrgAPIAsync("LIST", "SYS_PROMOTION_OFFICER", UserId);
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -169,6 +169,8 @@ namespace BMA.EHR.Placement.Service.Controllers
p.typeCommand,
})
.ToListAsync();
if (status != null && status.Trim().ToUpper() != "ALL")
placementAppointments = placementAppointments.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(placementAppointments);
}

View file

@ -67,7 +67,7 @@ namespace BMA.EHR.Placement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string? status = "ALL")
{
var getPermission = await _permission.GetPermissionOrgAPIAsync("LIST", "SYS_PROMOTION_EMP", UserId);
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -191,7 +191,8 @@ namespace BMA.EHR.Placement.Service.Controllers
// placementAppointments = data;
// }
if (status != null && status.Trim().ToUpper() != "ALL")
placementAppointments = placementAppointments.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(placementAppointments);
}

View file

@ -68,7 +68,7 @@ namespace BMA.EHR.Placement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string? status = "ALL")
{
var getPermission = await _permission.GetPermissionOrgAPIAsync("LIST", "SYS_TEMPDUTY", UserId);
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -127,7 +127,8 @@ namespace BMA.EHR.Placement.Service.Controllers
p.IsActive,
})
.ToListAsync();
if (status != null && status.Trim().ToUpper() != "ALL")
placementOfficers = placementOfficers.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(placementOfficers);
}

View file

@ -69,7 +69,7 @@ namespace BMA.EHR.Placement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string? status = "ALL")
{
var getPermission = await _permission.GetPermissionOrgAPIAsync("LIST", "SYS_TRANSFER_RECEIVE", UserId);
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -164,6 +164,8 @@ namespace BMA.EHR.Placement.Service.Controllers
p.profileId,
})
.ToListAsync();
if (status != null && status.Trim().ToUpper() != "ALL")
placementReceives = placementReceives.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(placementReceives);
}

View file

@ -69,7 +69,7 @@ namespace BMA.EHR.Placement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string? status = "ALL")
{
var getPermission = await _permission.GetPermissionOrgAPIAsync("LIST", "SYS_TEMPDUTY2", UserId);
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -132,6 +132,8 @@ namespace BMA.EHR.Placement.Service.Controllers
p.DateRepatriation,
})
.ToListAsync();
if (status != null && status.Trim().ToUpper() != "ALL")
placementRepatriations = placementRepatriations.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(placementRepatriations);
}

View file

@ -161,7 +161,7 @@ namespace BMA.EHR.Placement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string? status = "ALL")
{
var getPermission = await _permission.GetPermissionOrgAPIAsync("LIST", "SYS_TRANSFER_REQ", UserId);
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -224,6 +224,8 @@ namespace BMA.EHR.Placement.Service.Controllers
p.IsActive,
})
.ToListAsync();
if (status != null && status.Trim().ToUpper() != "ALL")
placementTransfers = placementTransfers.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(placementTransfers);
}

View file

@ -68,7 +68,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string? status = "ALL")
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
{
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PLACEMENT_OTHER");
@ -166,7 +166,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
// retirementOthers = data;
// }
if (status != null && status.Trim().ToUpper() != "ALL")
retirementOthers = retirementOthers.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(retirementOthers);
}
}

View file

@ -69,7 +69,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("{type}")]
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string type)
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string type, string? status = "WAITTING")
{
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_DISMISS");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -148,7 +148,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
p.IsActive,
})
.ToListAsync();
if (status != null && status.Trim().ToUpper() != "WAITTING")
retirementOuts = retirementOuts.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
return Success(retirementOuts);
}
}