เพิ่ม api แสดงข้อมูลเงินเดือนที่บันทึกในระบบสรรหา
This commit is contained in:
parent
f80c1ca295
commit
72c53c2e42
6 changed files with 236 additions and 67 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using BMA.EHR.Application.Repositories.Commands;
|
||||
using BMA.EHR.Application.Requests.Commands;
|
||||
using BMA.EHR.Command.Service.Requests;
|
||||
using BMA.EHR.Command.Service.Responses;
|
||||
using BMA.EHR.Domain.Common;
|
||||
using BMA.EHR.Domain.Extensions;
|
||||
using BMA.EHR.Domain.Models.Commands.Core;
|
||||
|
|
@ -510,16 +511,26 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
// TODO : หาค่า Education มาแสดง
|
||||
var receivers = (await _repository.GetReceiverByCommmandIdAsync(orderId))
|
||||
.OrderBy(x => x.Sequence)
|
||||
.Select(r => new
|
||||
.Select(r => new CommandReceiverResponse
|
||||
{
|
||||
personId = r.Id,
|
||||
sequence = r.Sequence,
|
||||
idCard = r.CitizenId,
|
||||
name = $"{r.Prefix!}{r.FirstName!} {r.LastName!}",
|
||||
selectStatus = true,
|
||||
education = "" // ยังหาไม่เจอว่าอยุ่ field ไหน
|
||||
RefRecordId = r.RefPlacementProfileId!.Value,
|
||||
PersonalId = r.Id,
|
||||
Sequence = r.Sequence,
|
||||
IdCard = r.CitizenId,
|
||||
Name = $"{r.Prefix!}{r.FirstName!} {r.LastName!}",
|
||||
SelectStatus = true,
|
||||
Education = "" // ยังหาไม่เจอว่าอยุ่ field ไหน
|
||||
}).ToList();
|
||||
|
||||
foreach (var r in receivers)
|
||||
{
|
||||
var salary = await _repository.GetPlacementSalaryAsync(r.RefRecordId);
|
||||
|
||||
r.SalaryAmount = salary.SalaryAmount;
|
||||
r.PositionSalaryAmount = salary.PositionSalaryAmount;
|
||||
r.MonthSalaryAmount = salary.MonthSalaryAmount;
|
||||
}
|
||||
|
||||
return Success(receivers);
|
||||
}
|
||||
catch
|
||||
|
|
@ -899,7 +910,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
{
|
||||
try
|
||||
{
|
||||
await _repository.UpdateCommandInfo(orderId, req.OrderNo, req.OrderYear, req.SignDate);
|
||||
await _repository.UpdateCommandInfoAsync(orderId, req.OrderNo, req.OrderYear, req.SignDate);
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -908,6 +919,32 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// อ่านข้อมูลเงินเดือนสำหรับผู้บรรจุ จากข้อมูลระบบสรรหา
|
||||
/// </summary>
|
||||
/// <param name="personalId">Record Id ของผู้รับคำสั่งในบัญชีแนบท้าย</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("salary/{personalId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetPlacementSalaryAsync(Guid personalId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = await _repository.GetPlacementSalaryAsync(personalId);
|
||||
|
||||
return Success(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// บันทึกข้อมูลเงินเดือนสำหรับผู้บรรจุ
|
||||
/// </summary>
|
||||
|
|
@ -916,7 +953,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("salary/{id}")]
|
||||
[HttpPut("salary/{personalId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue