แก้ list รายการเกษียณ

This commit is contained in:
kittapath 2024-11-05 14:16:13 +07:00
parent ae67d4381d
commit b98b02ac98
5 changed files with 9 additions and 18 deletions

View file

@ -57,8 +57,6 @@ namespace BMA.EHR.Retirement.Service.Controllers
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"];
private bool? RetirementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1");
#endregion
/// <summary>
@ -105,7 +103,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
var retirementOthers = await _context.RetirementOthers.AsQueryable()
.OrderByDescending(x => x.CreatedAt)
.Where(x => RetirementAdmin == true ? true : (rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))))
.Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id)))))
.Select(p => new
{
p.Id,
@ -720,7 +718,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
{
result.Add(r);
string? _null = null;
result.Add(new {
result.Add(new
{
No = _null,
FullName = r.RemarkHorizontal,
Education = _null,
@ -735,7 +734,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
NewPositionLevel = _null,
NewPositionNumber = _null,
NewSalary = _null,
AppointDate = _null,
AppointDate = _null,
RemarkHorizontal = _null,
RemarkVertical = _null,
});
@ -920,7 +919,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
{
result.Add(r);
string? _null = null;
result.Add(new {
result.Add(new
{
No = _null,
FullName = r.RemarkHorizontal,
Education = _null,
@ -936,7 +936,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
NewPositionLevel = _null,
NewPositionNumber = _null,
NewSalary = _null,
AppointDate = _null,
AppointDate = _null,
RemarkHorizontal = _null,
RemarkVertical = _null,
});