แก้ออกคำสั่ง
This commit is contained in:
parent
ee2aa136b9
commit
6c09c68c5c
33 changed files with 18908 additions and 626 deletions
|
|
@ -533,7 +533,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
uppdated.orgRevisionId = req.orgRevisionId;
|
||||
uppdated.positionId = req.positionId;
|
||||
uppdated.posMasterNo = req.posMasterNo;
|
||||
uppdated.position = req.position;
|
||||
uppdated.position = req.positionName;
|
||||
uppdated.positionField = req.positionField;
|
||||
uppdated.posTypeId = req.posTypeId;
|
||||
uppdated.posTypeName = req.posTypeName;
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
uppdated.orgRevisionId = req.orgRevisionId;
|
||||
uppdated.positionId = req.positionId;
|
||||
uppdated.posMasterNo = req.posMasterNo;
|
||||
uppdated.position = req.position;
|
||||
uppdated.position = req.positionName;
|
||||
uppdated.positionField = req.positionField;
|
||||
uppdated.posTypeId = req.posTypeId;
|
||||
uppdated.posTypeName = req.posTypeName;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,132 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// list รายการช่วยราชการของ Keycloak
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("keycloak")]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByKeycloak()
|
||||
{
|
||||
var apiUrl = $"{_configuration["API"]}org/profile/keycloak/position";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
|
||||
var placementOfficers = await _context.PlacementOfficers.AsQueryable()
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Where(x => x.Status == "DONE")
|
||||
.Where(x => x.profileId == org.result.profileId)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
p.rootOld,
|
||||
p.rootOldId,
|
||||
p.rootShortNameOld,
|
||||
p.child1Old,
|
||||
p.child1OldId,
|
||||
p.child1ShortNameOld,
|
||||
p.child2Old,
|
||||
p.child2OldId,
|
||||
p.child2ShortNameOld,
|
||||
p.child3Old,
|
||||
p.child3OldId,
|
||||
p.child3ShortNameOld,
|
||||
p.child4Old,
|
||||
p.child4OldId,
|
||||
p.child4ShortNameOld,
|
||||
p.PositionOld,
|
||||
p.posMasterNoOld,
|
||||
p.posTypeOldId,
|
||||
p.posTypeNameOld,
|
||||
p.posLevelOldId,
|
||||
p.posLevelNameOld,
|
||||
p.CreatedAt,
|
||||
p.Reason,
|
||||
p.Status,
|
||||
p.DateStart,
|
||||
p.DateEnd,
|
||||
p.Organization,
|
||||
p.OrganizationPositionOld,
|
||||
p.IsActive,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return Success(placementOfficers);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// list รายการช่วยราชการของ ProfileId
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("profileId/{id}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByProfileId(string id)
|
||||
{
|
||||
var placementOfficers = await _context.PlacementOfficers.AsQueryable()
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Where(x => x.Status == "DONE")
|
||||
.Where(x => x.profileId == id)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
p.rootOld,
|
||||
p.rootOldId,
|
||||
p.rootShortNameOld,
|
||||
p.child1Old,
|
||||
p.child1OldId,
|
||||
p.child1ShortNameOld,
|
||||
p.child2Old,
|
||||
p.child2OldId,
|
||||
p.child2ShortNameOld,
|
||||
p.child3Old,
|
||||
p.child3OldId,
|
||||
p.child3ShortNameOld,
|
||||
p.child4Old,
|
||||
p.child4OldId,
|
||||
p.child4ShortNameOld,
|
||||
p.PositionOld,
|
||||
p.posMasterNoOld,
|
||||
p.posTypeOldId,
|
||||
p.posTypeNameOld,
|
||||
p.posLevelOldId,
|
||||
p.posLevelNameOld,
|
||||
p.CreatedAt,
|
||||
p.Reason,
|
||||
p.Status,
|
||||
p.DateStart,
|
||||
p.DateEnd,
|
||||
p.Organization,
|
||||
p.OrganizationPositionOld,
|
||||
p.IsActive,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return Success(placementOfficers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get รายละเอียดช่วยราชการเจ้าหน้าที่
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -633,7 +633,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
uppdated.orgRevisionId = req.orgRevisionId;
|
||||
uppdated.positionId = req.positionId;
|
||||
uppdated.posMasterNo = req.posMasterNo;
|
||||
uppdated.position = req.position;
|
||||
uppdated.position = req.positionName;
|
||||
uppdated.positionField = req.positionField;
|
||||
uppdated.posTypeId = req.posTypeId;
|
||||
uppdated.posTypeName = req.posTypeName;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace BMA.EHR.Placement.Service.Requests
|
|||
public string? orgRevisionId { get; set; }
|
||||
public int? posMasterNo { get; set; }
|
||||
public string? positionId { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionName { get; set; }
|
||||
public string? positionField { get; set; }
|
||||
public string? posTypeId { get; set; }
|
||||
public string? posTypeName { get; set; }
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace BMA.EHR.Placement.Service.Requests
|
|||
public string? orgRevisionId { get; set; }
|
||||
public int? posMasterNo { get; set; }
|
||||
public string? positionId { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionName { get; set; }
|
||||
public string? positionField { get; set; }
|
||||
public string? posTypeId { get; set; }
|
||||
public string? posTypeName { get; set; }
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace BMA.EHR.Placement.Service.Requests
|
|||
public string? orgRevisionId { get; set; }
|
||||
public int? posMasterNo { get; set; }
|
||||
public string? positionId { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionName { get; set; }
|
||||
public string? positionField { get; set; }
|
||||
public string? posTypeId { get; set; }
|
||||
public string? posTypeName { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue