เอา paging ออก
This commit is contained in:
parent
e8cf09b7ac
commit
99a3cfd052
8 changed files with 163 additions and 155 deletions
|
|
@ -69,7 +69,8 @@ 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(int page = 1, int pageSize = 10, string keyword = "")
|
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
|
||||||
{
|
{
|
||||||
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,30 +165,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"));
|
||||||
|
|
||||||
if (keyword != "")
|
// if (keyword != "")
|
||||||
{
|
// {
|
||||||
var data = placementAppointments.Where(x =>
|
// var data = placementAppointments.Where(x =>
|
||||||
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
// (x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
(x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
// (x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
(x.Reason != null && x.Reason.Contains(keyword)) ||
|
// (x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||||
(x.nodeName != null && x.nodeName.Contains(keyword)))
|
// (x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
placementAppointments = data;
|
// placementAppointments = data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Success(new { data = placementAppointments, total = placementAppointments.Count });
|
return Success(placementAppointments);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@ 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(int page = 1, int pageSize = 10, string keyword = "")
|
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,30 +162,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
p.typeCommand,
|
p.typeCommand,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
if (keyword != "")
|
// if (keyword != "")
|
||||||
{
|
// {
|
||||||
var data = placementAppointments.Where(x =>
|
// var data = placementAppointments.Where(x =>
|
||||||
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
// (x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
(x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
// (x.OrganizationOld != null && x.OrganizationOld.Contains(keyword)) ||
|
||||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
(x.Reason != null && x.Reason.Contains(keyword)) ||
|
// (x.Reason != null && x.Reason.Contains(keyword)) ||
|
||||||
(x.nodeName != null && x.nodeName.Contains(keyword)))
|
// (x.nodeName != null && x.nodeName.Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
placementAppointments = data;
|
// placementAppointments = data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Success(new { data = placementAppointments, total = placementAppointments.Count });
|
return Success(placementAppointments);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("exam/{year}")]
|
[HttpGet("exam/{year}")]
|
||||||
public async Task<ActionResult<ResponseObject>> GetExam(int year, int page = 1, int pageSize = 10, string keyword = "")
|
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)
|
||||||
|
|
@ -111,20 +112,20 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
IsExpired = x.EndDate.Date < DateTime.Now.Date,
|
IsExpired = x.EndDate.Date < DateTime.Now.Date,
|
||||||
CreatedAt = x.CreatedAt,
|
CreatedAt = x.CreatedAt,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
if (keyword != "")
|
// if (keyword != "")
|
||||||
{
|
// {
|
||||||
var data_ = data.Where(x =>
|
// var data_ = data.Where(x =>
|
||||||
(x.ExamRound != null && x.ExamRound.Contains(keyword)) ||
|
// (x.ExamRound != null && x.ExamRound.Contains(keyword)) ||
|
||||||
(x.ExamOrder != null && x.ExamOrder.Contains(keyword)) ||
|
// (x.ExamOrder != null && x.ExamOrder.Contains(keyword)) ||
|
||||||
(x.NumberOfCandidates != null && x.NumberOfCandidates.ToString().Contains(keyword)))
|
// (x.NumberOfCandidates != null && x.NumberOfCandidates.ToString().Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
data = data_;
|
// data = data_;
|
||||||
}
|
// }
|
||||||
return Success( new { data, total = data.Count });
|
return Success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("pass/{examId:length(36)}")]
|
[HttpGet("pass/{examId:length(36)}")]
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@ 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(int page = 1, int pageSize = 10, string keyword = "")
|
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,27 +143,27 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
if (keyword != "")
|
// if (keyword != "")
|
||||||
{
|
// {
|
||||||
var data = placementOfficers.Where(x =>
|
// var data = placementOfficers.Where(x =>
|
||||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
(x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
// (x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
||||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
(x.Organization != null && x.Organization.Contains(keyword)))
|
// (x.Organization != null && x.Organization.Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
placementOfficers = data;
|
// placementOfficers = data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Success(new { data = placementOfficers, total = placementOfficers.Count });
|
return Success(placementOfficers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@ 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(int page = 1, int pageSize = 10, string keyword = "")
|
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_RECEIVE");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_TRANSFER_RECEIVE");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
|
@ -181,24 +182,24 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
// 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 =>
|
||||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
(x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
// (x.citizenId != null && x.citizenId.Contains(keyword)) ||
|
||||||
(x.root != null && x.root.Contains(keyword)) ||
|
// (x.root != null && x.root.Contains(keyword)) ||
|
||||||
(x.nodeName != null && x.nodeName.Contains(keyword)) ||
|
// (x.nodeName != null && x.nodeName.Contains(keyword)) ||
|
||||||
(x.nodeShortName != null && x.nodeShortName.Contains(keyword)))
|
// (x.nodeShortName != null && x.nodeShortName.Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
placementReceives = data;
|
// placementReceives = data;
|
||||||
}
|
// }
|
||||||
return Success(new { data = placementReceives, total = placementReceives.Count });
|
return Success(placementReceives);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,8 @@ 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(int page = 1, int pageSize = 10, string keyword = "")
|
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,28 +149,28 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
if (keyword != "")
|
// if (keyword != "")
|
||||||
{
|
// {
|
||||||
var data = placementRepatriations.Where(x =>
|
// var data = placementRepatriations.Where(x =>
|
||||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
(x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
// (x.PositionOld != null && x.PositionOld.Contains(keyword)) ||
|
||||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
(x.Organization != null && x.Organization.Contains(keyword)))
|
// (x.Organization != null && x.Organization.Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
placementRepatriations = data;
|
// placementRepatriations = data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Success(new { data = placementRepatriations, total = placementRepatriations.Count });
|
return Success(placementRepatriations);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,8 @@ 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(int page = 1, int pageSize = 10, string keyword = "")
|
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,23 +220,23 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
if (keyword != "")
|
// if (keyword != "")
|
||||||
{
|
// {
|
||||||
var data = placementTransfers.Where(x =>
|
// var data = placementTransfers.Where(x =>
|
||||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)))
|
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
placementTransfers = data;
|
// placementTransfers = data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Success(new { data = placementTransfers, total = placementTransfers.Count });
|
return Success(placementTransfers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@ 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(int page = 1, int pageSize = 10, string keyword = "")
|
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,27 +147,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 != "")
|
// if (keyword != "")
|
||||||
{
|
// {
|
||||||
var data = retirementOthers.Where(x =>
|
// var data = retirementOthers.Where(x =>
|
||||||
(x.prefix != null && x.prefix.Contains(keyword)) ||
|
// (x.prefix != null && x.prefix.Contains(keyword)) ||
|
||||||
(x.firstName != null && x.firstName.Contains(keyword)) ||
|
// (x.firstName != null && x.firstName.Contains(keyword)) ||
|
||||||
(x.lastName != null && x.lastName.Contains(keyword)) ||
|
// (x.lastName != null && x.lastName.Contains(keyword)) ||
|
||||||
(x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
// (x.rootShortNameOld != null && x.rootShortNameOld.Contains(keyword)) ||
|
||||||
(x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
// (x.posMasterNoOld != null && x.posMasterNoOld.ToString().Contains(keyword)) ||
|
||||||
(x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
// (x.posTypeNameOld != null && x.posTypeNameOld.Contains(keyword)) ||
|
||||||
(x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
// (x.posLevelNameOld != null && x.posLevelNameOld.Contains(keyword)) ||
|
||||||
(x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
// (x.OrganizationPositionOld != null && x.OrganizationPositionOld.Contains(keyword)) ||
|
||||||
(x.Reason != null && x.Reason.Contains(keyword)))
|
// (x.Reason != null && x.Reason.Contains(keyword)))
|
||||||
.OrderByDescending(x => x.CreatedAt)
|
// .OrderByDescending(x => x.CreatedAt)
|
||||||
.Skip((page - 1) * pageSize)
|
// .Skip((page - 1) * pageSize)
|
||||||
.Take(pageSize)
|
// .Take(pageSize)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
retirementOthers = data;
|
// retirementOthers = data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Success(new { data = retirementOthers, total = retirementOthers.Count });
|
return Success(retirementOthers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue