เพิ่ม paging ระบบบรรจุ แต่งตั้ง ย้าย โอน
This commit is contained in:
parent
bb9e79b06c
commit
e59f242427
8 changed files with 152 additions and 15 deletions
|
|
@ -69,7 +69,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PROMOTION_OFFICER");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PROMOTION_OFFICER");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
|
@ -164,7 +164,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
// if (PlacementAdmin == true)
|
// if (PlacementAdmin == true)
|
||||||
// placementAppointments.Where(x => x.Status.Trim().ToUpper().Contains("PENDING"));
|
// placementAppointments.Where(x => x.Status.Trim().ToUpper().Contains("PENDING"));
|
||||||
|
|
||||||
return Success(placementAppointments);
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
var data = placementAppointments.Where(x =>
|
||||||
|
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||||
|
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
|
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
|
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
|
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
|
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
|
(x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||||
|
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
|
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
|
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
|
(x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||||
|
(x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||||
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
placementAppointments = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = placementAppointments, total = placementAppointments.Count });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PROMOTION_EMP");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PROMOTION_EMP");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
|
@ -161,8 +161,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
p.typeCommand,
|
p.typeCommand,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
var data = placementAppointments.Where(x =>
|
||||||
|
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||||
|
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
|
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
|
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
|
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
|
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
|
(x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||||
|
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
|
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
|
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
|
(x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||||
|
(x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||||
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
return Success(placementAppointments);
|
placementAppointments = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = placementAppointments, total = placementAppointments.Count });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ using Microsoft.Extensions.Configuration;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Microsoft.AspNetCore.Http.HttpResults;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
|
||||||
namespace BMA.EHR.Placement.Service.Controllers
|
namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -90,7 +92,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("exam/{year}")]
|
[HttpGet("exam/{year}")]
|
||||||
public async Task<ActionResult<ResponseObject>> GetExam(int year)
|
public async Task<ActionResult<ResponseObject>> GetExam(int year, int page = 1, int pageSize = 10, string keyword = "")
|
||||||
{
|
{
|
||||||
var data = await _context.Placements.Where(x => year > 0 ? (x.Year == year) : (x.Year > 0))
|
var data = await _context.Placements.Where(x => year > 0 ? (x.Year == year) : (x.Year > 0))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
|
|
@ -107,9 +109,22 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
AccountEndDate = x.EndDate,
|
AccountEndDate = x.EndDate,
|
||||||
AccountExpirationDate = x.EndDate,
|
AccountExpirationDate = x.EndDate,
|
||||||
IsExpired = x.EndDate.Date < DateTime.Now.Date,
|
IsExpired = x.EndDate.Date < DateTime.Now.Date,
|
||||||
|
CreatedAt = x.CreatedAt,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
var data_ = data.Where(x =>
|
||||||
|
(x.ExamRound != null && x.ExamRound.Contains(keyword)) ||
|
||||||
|
(x.ExamOrder != null && x.ExamOrder.Contains(keyword)) ||
|
||||||
|
(x.NumberOfCandidates != null && x.NumberOfCandidates.ToString().Contains(keyword)))
|
||||||
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
return Success(data);
|
data = data_;
|
||||||
|
}
|
||||||
|
return Success( new { data, total = data.Count });
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("pass/{examId:length(36)}")]
|
[HttpGet("pass/{examId:length(36)}")]
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TEMPDUTY");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TEMPDUTY");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
|
@ -142,7 +142,27 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return Success(placementOfficers);
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
var data = placementOfficers.Where(x =>
|
||||||
|
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
|
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
|
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
|
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
|
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
|
(x.PositionOld != null && x.PositionOld.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();
|
||||||
|
|
||||||
|
placementOfficers = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = placementOfficers, total = placementOfficers.Count });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
// if (PlacementAdmin == true)
|
// if (PlacementAdmin == true)
|
||||||
// placementReceives.Where(x => x.Status.Trim().ToUpper().Contains("PENDING"));
|
// placementReceives.Where(x => x.Status.Trim().ToUpper().Contains("PENDING"));
|
||||||
|
|
||||||
if (keyword != "")
|
if (keyword != "")
|
||||||
{
|
{
|
||||||
var data = placementReceives.Where(x =>
|
var data = placementReceives.Where(x =>
|
||||||
|
|
@ -197,7 +198,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
|
|
||||||
placementReceives = data;
|
placementReceives = data;
|
||||||
}
|
}
|
||||||
return Success(placementReceives);
|
return Success(new { data = placementReceives, total = placementReceives.Count });
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TEMPDUTY2");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TEMPDUTY2");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
|
@ -148,7 +148,28 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return Success(placementRepatriations);
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
var data = placementRepatriations.Where(x =>
|
||||||
|
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
|
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
|
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
|
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
|
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
|
(x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
||||||
|
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
|
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
|
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
|
(x.Organization != null && x.Organization.Contains(keyword)))
|
||||||
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
placementRepatriations = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = placementRepatriations, total = placementRepatriations.Count });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TRANSFER_REQ");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TRANSFER_REQ");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
|
@ -219,7 +219,23 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
return Success(placementTransfers);
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
var data = placementTransfers.Where(x =>
|
||||||
|
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
|
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
|
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
|
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
|
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)))
|
||||||
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
placementTransfers = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = placementTransfers, total = placementTransfers.Count });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PLACEMENT_OTHER");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PLACEMENT_OTHER");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
|
@ -146,8 +146,27 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
CommandType = p.CommandType == null ? null : p.CommandType.Name,
|
CommandType = p.CommandType == null ? null : p.CommandType.Name,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
if (keyword != "")
|
||||||
|
{
|
||||||
|
var data = retirementOthers.Where(x =>
|
||||||
|
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
|
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
|
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
|
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
|
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
|
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
|
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
|
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
|
(x.Reason != null && x.Reason.Contains(keyword)))
|
||||||
|
.OrderByDescending(x => x.CreatedAt)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
return Success(retirementOthers);
|
retirementOthers = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success(new { data = retirementOthers, total = retirementOthers.Count });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue