From a0cc2338467e3fea00f43f1b2534314fc4f33160 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Mon, 30 Sep 2024 14:45:40 +0700 Subject: [PATCH] fix #617 --- .../PlacementTransferController.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 000adcf0..373cc005 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -14,6 +14,8 @@ using System.Net.Http.Headers; using System.Security.Claims; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Drawing.Printing; namespace BMA.EHR.Placement.Service.Controllers { @@ -70,7 +72,7 @@ namespace BMA.EHR.Placement.Service.Controllers /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("user")] - public async Task> GetListByProfile() + public async Task> GetListByProfile(string keyword = "") { var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position"; using (var client = new HttpClient()) @@ -129,6 +131,23 @@ namespace BMA.EHR.Placement.Service.Controllers p.IsActive, }) .ToListAsync(); + if (keyword != "") + { + var data = placementTransfers.Where(x => + (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) || + (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) || + (x.PositionNumberOld != null && x.PositionNumberOld.Contains(keyword)) || + (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) || + (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) || + (x.Organization != null && x.Organization.Contains(keyword)) + ) + //.OrderByDescending(x => x.CreatedAt) + // .Skip((page - 1) * pageSize) + // .Take(pageSize) + .ToList(); + + placementTransfers = data; + } return Success(placementTransfers); } }