no message
This commit is contained in:
parent
14b3c386e0
commit
9b6db93a5f
3 changed files with 382 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using BMA.EHR.Application.Repositories;
|
using BMA.EHR.Application.Repositories;
|
||||||
using BMA.EHR.Application.Repositories.MessageQueue;
|
using BMA.EHR.Application.Repositories.MessageQueue;
|
||||||
using BMA.EHR.Domain.Common;
|
using BMA.EHR.Domain.Common;
|
||||||
|
using BMA.EHR.Domain.Extensions;
|
||||||
using BMA.EHR.Domain.Models.Placement;
|
using BMA.EHR.Domain.Models.Placement;
|
||||||
using BMA.EHR.Domain.Shared;
|
using BMA.EHR.Domain.Shared;
|
||||||
using BMA.EHR.Infrastructure.Persistence;
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
|
@ -741,5 +742,159 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
return Success(appointments);
|
return Success(appointments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ออกคำสั่ง C-PM-05
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("appoint/report/excecute")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteAppoint([FromBody] ReportExecuteRequest req)
|
||||||
|
{
|
||||||
|
// create new profile
|
||||||
|
foreach (var recv in req.refIds)
|
||||||
|
{
|
||||||
|
var placementProfile = await _context.PlacementAppointments
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||||
|
if (placementProfile == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (placementProfile == null)
|
||||||
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
var baseAPI = _configuration["API"];
|
||||||
|
var apiUrlSalary = $"{baseAPI}/org/profile/salary";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||||
|
{
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
date = recv.commandAffectDate,
|
||||||
|
amount = recv.amount,
|
||||||
|
positionSalaryAmount = recv.positionSalaryAmount,
|
||||||
|
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||||
|
posNo = placementProfile.posMasterNo == null ? "" :
|
||||||
|
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||||
|
position = placementProfile.position,
|
||||||
|
positionLine = "",
|
||||||
|
positionPathSide = "",
|
||||||
|
positionExecutive = "",
|
||||||
|
positionType = placementProfile.posTypeName,
|
||||||
|
positionLevel = placementProfile.posLevelName,
|
||||||
|
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||||
|
templateDoc = recv.templateDoc,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
posmasterId = placementProfile.posmasterId,
|
||||||
|
positionId = placementProfile.positionId,
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update placementstatus
|
||||||
|
placementProfile.Status = "DONE";
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ออกคำสั่ง C-PM-06
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("slip/report/excecute")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteSlip([FromBody] ReportExecuteRequest req)
|
||||||
|
{
|
||||||
|
// create new profile
|
||||||
|
foreach (var recv in req.refIds)
|
||||||
|
{
|
||||||
|
var placementProfile = await _context.PlacementAppointments
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||||
|
if (placementProfile == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (placementProfile == null)
|
||||||
|
throw new Exception(GlobalMessages.DataNotFound);
|
||||||
|
var baseAPI = _configuration["API"];
|
||||||
|
var apiUrlSalary = $"{baseAPI}/org/profile/salary";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||||
|
{
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
date = recv.commandAffectDate,
|
||||||
|
amount = recv.amount,
|
||||||
|
positionSalaryAmount = recv.positionSalaryAmount,
|
||||||
|
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||||
|
posNo = placementProfile.posMasterNo == null ? "" :
|
||||||
|
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||||
|
position = placementProfile.position,
|
||||||
|
positionLine = "",
|
||||||
|
positionPathSide = "",
|
||||||
|
positionExecutive = "",
|
||||||
|
positionType = placementProfile.posTypeName,
|
||||||
|
positionLevel = placementProfile.posLevelName,
|
||||||
|
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||||
|
templateDoc = recv.templateDoc,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
posmasterId = placementProfile.posmasterId,
|
||||||
|
positionId = placementProfile.positionId,
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update placementstatus
|
||||||
|
placementProfile.Status = "DONE";
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using BMA.EHR.Application.Repositories.MessageQueue;
|
using BMA.EHR.Application.Repositories.MessageQueue;
|
||||||
using BMA.EHR.Domain.Common;
|
using BMA.EHR.Domain.Common;
|
||||||
using BMA.EHR.Domain.Extensions;
|
using BMA.EHR.Domain.Extensions;
|
||||||
using BMA.EHR.Domain.Models.MetaData;
|
|
||||||
using BMA.EHR.Domain.Models.Placement;
|
using BMA.EHR.Domain.Models.Placement;
|
||||||
using BMA.EHR.Domain.Shared;
|
using BMA.EHR.Domain.Shared;
|
||||||
using BMA.EHR.Infrastructure.Persistence;
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
|
@ -12,13 +11,9 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Swashbuckle.AspNetCore.Annotations;
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Security.Cryptography;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Microsoft.AspNetCore.Http.HttpResults;
|
|
||||||
using System.Drawing.Drawing2D;
|
|
||||||
|
|
||||||
namespace BMA.EHR.Placement.Service.Controllers
|
namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -1879,5 +1874,229 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ออกคำสั่ง C-PM-03
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("appoint/report/excecute")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteAppoint([FromBody] ReportExecuteRequest req)
|
||||||
|
{
|
||||||
|
// create new profile
|
||||||
|
foreach (var recv in req.refIds)
|
||||||
|
{
|
||||||
|
var placementProfile = await _context.PlacementProfiles
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||||
|
if (placementProfile == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var baseAPI = _configuration["API"];
|
||||||
|
var apiUrlSalary = $"{baseAPI}/org/profile/salary";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||||
|
{
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
date = recv.commandAffectDate,
|
||||||
|
amount = recv.amount,
|
||||||
|
positionSalaryAmount = recv.positionSalaryAmount,
|
||||||
|
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||||
|
posNo = placementProfile.posMasterNo == null ? "" :
|
||||||
|
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||||
|
position = placementProfile.positionName,
|
||||||
|
positionLine = "",
|
||||||
|
positionPathSide = "",
|
||||||
|
positionExecutive = "",
|
||||||
|
positionType = placementProfile.posTypeName,
|
||||||
|
positionLevel = placementProfile.posLevelName,
|
||||||
|
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||||
|
templateDoc = recv.templateDoc,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
posmasterId = placementProfile.posmasterId,
|
||||||
|
positionId = placementProfile.positionId,
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update placementstatus
|
||||||
|
placementProfile.PlacementStatus = "CONTAIN";
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ออกคำสั่ง C-PM-04
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("move/report/excecute")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteMove([FromBody] ReportExecuteRequest req)
|
||||||
|
{
|
||||||
|
// create new profile
|
||||||
|
foreach (var recv in req.refIds)
|
||||||
|
{
|
||||||
|
var placementProfile = await _context.PlacementProfiles
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||||
|
if (placementProfile == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var baseAPI = _configuration["API"];
|
||||||
|
var apiUrlSalary = $"{baseAPI}/org/profile/salary";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||||
|
{
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
date = recv.commandAffectDate,
|
||||||
|
amount = recv.amount,
|
||||||
|
positionSalaryAmount = recv.positionSalaryAmount,
|
||||||
|
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||||
|
posNo = placementProfile.posMasterNo == null ? "" :
|
||||||
|
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||||
|
position = placementProfile.positionName,
|
||||||
|
positionLine = "",
|
||||||
|
positionPathSide = "",
|
||||||
|
positionExecutive = "",
|
||||||
|
positionType = placementProfile.posTypeName,
|
||||||
|
positionLevel = placementProfile.posLevelName,
|
||||||
|
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||||
|
templateDoc = recv.templateDoc,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
posmasterId = placementProfile.posmasterId,
|
||||||
|
positionId = placementProfile.positionId,
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update placementstatus
|
||||||
|
placementProfile.PlacementStatus = "CONTAIN";
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ออกคำสั่ง C-PM-39
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("slip/report/excecute")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteSlip([FromBody] ReportExecuteRequest req)
|
||||||
|
{
|
||||||
|
// create new profile
|
||||||
|
foreach (var recv in req.refIds)
|
||||||
|
{
|
||||||
|
var placementProfile = await _context.PlacementProfiles
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||||
|
if (placementProfile == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var baseAPI = _configuration["API"];
|
||||||
|
var apiUrlSalary = $"{baseAPI}/org/profile/salary";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||||
|
{
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
date = recv.commandAffectDate,
|
||||||
|
amount = recv.amount,
|
||||||
|
positionSalaryAmount = recv.positionSalaryAmount,
|
||||||
|
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||||
|
posNo = placementProfile.posMasterNo == null ? "" :
|
||||||
|
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||||
|
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||||
|
position = placementProfile.positionName,
|
||||||
|
positionLine = "",
|
||||||
|
positionPathSide = "",
|
||||||
|
positionExecutive = "",
|
||||||
|
positionType = placementProfile.posTypeName,
|
||||||
|
positionLevel = placementProfile.posLevelName,
|
||||||
|
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||||
|
templateDoc = recv.templateDoc,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
posmasterId = placementProfile.posmasterId,
|
||||||
|
positionId = placementProfile.positionId,
|
||||||
|
profileId = placementProfile.profileId,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update placementstatus
|
||||||
|
placementProfile.PlacementStatus = "CONTAIN";
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,5 +14,8 @@ namespace BMA.EHR.Placement.Service.Requests
|
||||||
public string? commandNo { get; set; }
|
public string? commandNo { get; set; }
|
||||||
public int commandYear { get; set; }
|
public int commandYear { get; set; }
|
||||||
public string? templateDoc { get; set; }
|
public string? templateDoc { get; set; }
|
||||||
|
public double? amount { get; set; }
|
||||||
|
public double? positionSalaryAmount { get; set; }
|
||||||
|
public double? mouthSalaryAmount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue