no message
This commit is contained in:
parent
3419a314e1
commit
d5a2042d35
8 changed files with 513 additions and 71 deletions
|
|
@ -6782,6 +6782,30 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-19
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command19/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand19([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.RetirementDischarges
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var placementProfile in placementProfiles)
|
||||
{
|
||||
// update placementstatus
|
||||
placementProfile.Status = "REPORT";
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-19
|
||||
/// </summary>
|
||||
|
|
@ -6816,6 +6840,30 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-20
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command20/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportcommand20([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.RetirementExpulsions
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var placementProfile in placementProfiles)
|
||||
{
|
||||
// update placementstatus
|
||||
placementProfile.Status = "REPORT";
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-20
|
||||
/// </summary>
|
||||
|
|
@ -6850,6 +6898,68 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-21
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command21/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportcommand21([FromBody] ReportPersonRequest req_)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrl = $"{baseAPI}/org/profile-employee/report-temp";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName == null ? "" : d.firstName,
|
||||
LastName = d.lastName == null ? "" : d.lastName,
|
||||
RefPlacementProfileId = d.id,
|
||||
RefDisciplineId = d.id,
|
||||
Organization = d.organization,
|
||||
PositionName = d.positionName,
|
||||
PositionLevel = d.positionLevel,
|
||||
PositionType = d.positionType,
|
||||
PositionNumber = d.positionNumber,
|
||||
BirthDate = d.birthDate,
|
||||
};
|
||||
seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
|
||||
return Success(resultData);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-21
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue