no message
This commit is contained in:
parent
3e63a99ce0
commit
c694f08dbe
2 changed files with 75 additions and 406 deletions
|
|
@ -1580,195 +1580,6 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpPost("recruit/report/excecute")]
|
[HttpPost("recruit/report/excecute")]
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteRecruit([FromBody] ReportExecuteRequest req)
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteRecruit([FromBody] ReportExecuteRequest req)
|
||||||
{
|
|
||||||
// create new profile
|
|
||||||
foreach (var recv in req.refIds)
|
|
||||||
{
|
|
||||||
// query placement Profile
|
|
||||||
var placementProfile = await _context.PlacementProfiles
|
|
||||||
.Include(x => x.PlacementCertificates)
|
|
||||||
.Include(x => x.PlacementEducations)
|
|
||||||
.ThenInclude(x => x.EducationLevel)
|
|
||||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
|
||||||
|
|
||||||
if (placementProfile == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/*ข้อมูล Profile ใหม่*/
|
|
||||||
var apiUrl = $"{_configuration["API"]}/org/profile/all";
|
|
||||||
var profileId = string.Empty;
|
|
||||||
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, apiUrl);
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrl, new
|
|
||||||
{
|
|
||||||
rank = string.Empty,
|
|
||||||
prefix = placementProfile.Prefix == null ? string.Empty : placementProfile.Prefix,
|
|
||||||
firstName = placementProfile.Firstname == null ? string.Empty : placementProfile.Firstname,
|
|
||||||
lastName = placementProfile.Lastname == null ? string.Empty : placementProfile.Lastname,
|
|
||||||
citizenId = placementProfile.CitizenId == null ? string.Empty : placementProfile.CitizenId,
|
|
||||||
position = placementProfile.positionName == null ? string.Empty : placementProfile.positionName,
|
|
||||||
posLevelId = placementProfile.posLevelId == null ? string.Empty : placementProfile.posLevelId,
|
|
||||||
posTypeId = placementProfile.posTypeId == null ? string.Empty : placementProfile.posTypeId,
|
|
||||||
email = placementProfile.Email == null ? string.Empty : placementProfile.Email,
|
|
||||||
phone = placementProfile.MobilePhone == null ? string.Empty : placementProfile.MobilePhone,
|
|
||||||
keycloak = string.Empty,
|
|
||||||
isProbation = true,
|
|
||||||
isLeave = false,
|
|
||||||
dateRetire = (DateTime?)null,
|
|
||||||
dateAppoint = recv.commandAffectDate,
|
|
||||||
dateStart = recv.commandAffectDate,
|
|
||||||
govAgeAbsent = 0,
|
|
||||||
govAgePlus = 0,
|
|
||||||
birthDate = placementProfile.DateOfBirth == null ? (DateTime?)null : placementProfile.DateOfBirth,
|
|
||||||
reasonSameDate = (DateTime?)null,
|
|
||||||
ethnicity = placementProfile.Race == null ? string.Empty : placementProfile.Race,
|
|
||||||
telephoneNumber = placementProfile.Telephone == null ? string.Empty : placementProfile.Telephone,
|
|
||||||
nationality = placementProfile.Nationality == null ? string.Empty : placementProfile.Nationality,
|
|
||||||
gender = placementProfile.Gender == null ? string.Empty : placementProfile.Gender,
|
|
||||||
relationship = placementProfile.Relationship == null ? string.Empty : placementProfile.Relationship,
|
|
||||||
religion = placementProfile.Religion == null ? string.Empty : placementProfile.Religion,
|
|
||||||
bloodGroup = string.Empty,
|
|
||||||
registrationAddress = placementProfile.RegistAddress == null ? string.Empty : placementProfile.RegistAddress,
|
|
||||||
registrationProvinceId = (String?)null,
|
|
||||||
registrationDistrictId = (String?)null,
|
|
||||||
registrationSubDistrictId = (String?)null,
|
|
||||||
registrationZipCode = placementProfile.RegistZipCode == null ? string.Empty : placementProfile.RegistZipCode,
|
|
||||||
currentAddress = placementProfile.CurrentAddress == null ? string.Empty : placementProfile.CurrentAddress,
|
|
||||||
currentProvinceId = (String?)null,
|
|
||||||
currentDistrictId = (String?)null,
|
|
||||||
currentSubDistrictId = (String?)null,
|
|
||||||
currentZipCode = placementProfile.CurrentZipCode == null ? string.Empty : placementProfile.CurrentZipCode,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
profileId = JsonConvert.DeserializeObject<PlacementProfileId>(_result).result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (placementProfile.PlacementEducations != null)
|
|
||||||
{
|
|
||||||
var apiUrlEdu = $"{_configuration["API"]}/org/profile/educations";
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
foreach (var edu in placementProfile.PlacementEducations)
|
|
||||||
{
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlEdu, new
|
|
||||||
{
|
|
||||||
profileId = profileId,
|
|
||||||
country = edu.Country == null ? string.Empty : edu.Country,
|
|
||||||
degree = edu.Degree == null ? string.Empty : edu.Degree,
|
|
||||||
duration = edu.Duration == null ? string.Empty : edu.Duration,
|
|
||||||
durationYear = edu.DurationYear == null ? 0 : edu.DurationYear,
|
|
||||||
field = edu.Field == null ? string.Empty : edu.Field,
|
|
||||||
finishDate = edu.FinishDate == null ? (DateTime?)null : edu.FinishDate,
|
|
||||||
fundName = edu.FundName == null ? string.Empty : edu.FundName,
|
|
||||||
gpa = edu.Gpa == null ? string.Empty : edu.Gpa,
|
|
||||||
institute = edu.Institute == null ? string.Empty : edu.Institute,
|
|
||||||
other = edu.Other == null ? string.Empty : edu.Other,
|
|
||||||
startDate = edu.StartDate == null ? (DateTime?)null : edu.StartDate,
|
|
||||||
endDate = edu.EndDate == null ? (DateTime?)null : edu.EndDate,
|
|
||||||
educationLevel = edu.EducationLevel == null ? string.Empty : edu.EducationLevel.Name,
|
|
||||||
educationLevelId = string.Empty,
|
|
||||||
positionPath = edu.PositionPath == null ? null : edu.PositionPath,
|
|
||||||
positionPathId = string.Empty,
|
|
||||||
isDate = edu.IsDate,
|
|
||||||
isEducation = edu.IsEducation,
|
|
||||||
note = string.Empty,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (placementProfile.PlacementCertificates != null)
|
|
||||||
{
|
|
||||||
var apiUrlCer = $"{_configuration["API"]}/org/profile/certificate";
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
foreach (var cer in placementProfile.PlacementCertificates)
|
|
||||||
{
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlCer, new
|
|
||||||
{
|
|
||||||
profileId = profileId,
|
|
||||||
expireDate = cer.ExpireDate == null ? (DateTime?)null : cer.ExpireDate,
|
|
||||||
issueDate = cer.IssueDate == null ? (DateTime?)null : cer.IssueDate,
|
|
||||||
certificateNo = cer.CertificateNo == null ? string.Empty : cer.CertificateNo,
|
|
||||||
certificateType = cer.CertificateType == null ? string.Empty : cer.CertificateType,
|
|
||||||
issuer = cer.Issuer == null ? string.Empty : cer.Issuer,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var apiUrlSalary = $"{_configuration["API"]}/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 _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
|
||||||
{
|
|
||||||
profileId = profileId,
|
|
||||||
date = recv.commandAffectDate,
|
|
||||||
amount = placementProfile.Amount,
|
|
||||||
positionSalaryAmount = placementProfile.PositionSalaryAmount,
|
|
||||||
mouthSalaryAmount = placementProfile.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 == null ? string.Empty : placementProfile.positionName,
|
|
||||||
positionLine = string.Empty,
|
|
||||||
positionPathSide = string.Empty,
|
|
||||||
positionExecutive = string.Empty,
|
|
||||||
positionType = placementProfile.posTypeName == null ? string.Empty : placementProfile.posTypeName,
|
|
||||||
positionLevel = placementProfile.posLevelName == null ? string.Empty : 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 = profileId,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
}
|
|
||||||
// update placementstatus
|
|
||||||
placementProfile.PlacementStatus = "DONE";//DONE
|
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ออกคำสั่ง C-PM-01 บรรจุและแต่งตั้งผู้สอบแข่งขันได้ (NEW)
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200"></response>
|
|
||||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpPost("recruit/report/excecute-new")]
|
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteRecruitNew([FromBody] ReportExecuteRequest req)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -1863,9 +1674,9 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
profileId = string.Empty,
|
profileId = string.Empty,
|
||||||
date = r.commandAffectDate,
|
date = r.commandAffectDate,
|
||||||
amount = p.Amount,
|
amount = r.amount,
|
||||||
positionSalaryAmount = p.PositionSalaryAmount,
|
positionSalaryAmount = r.positionSalaryAmount,
|
||||||
mouthSalaryAmount = p.MouthSalaryAmount,
|
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||||
posNo = p.posMasterNo == null ? "" :
|
posNo = p.posMasterNo == null ? "" :
|
||||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||||
|
|
@ -2025,195 +1836,6 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpPost("candidate/report/excecute")]
|
[HttpPost("candidate/report/excecute")]
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteCandidate([FromBody] ReportExecuteRequest req)
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteCandidate([FromBody] ReportExecuteRequest req)
|
||||||
{
|
|
||||||
// create new profile
|
|
||||||
foreach (var recv in req.refIds)
|
|
||||||
{
|
|
||||||
// query placement Profile
|
|
||||||
var placementProfile = await _context.PlacementProfiles
|
|
||||||
.Include(x => x.PlacementCertificates)
|
|
||||||
.Include(x => x.PlacementEducations)
|
|
||||||
.ThenInclude(x => x.EducationLevel)
|
|
||||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
|
||||||
|
|
||||||
if (placementProfile == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/*ข้อมูล Profile ใหม่*/
|
|
||||||
var apiUrl = $"{_configuration["API"]}/org/profile/all";
|
|
||||||
var profileId = string.Empty;
|
|
||||||
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, apiUrl);
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrl, new
|
|
||||||
{
|
|
||||||
rank = string.Empty,
|
|
||||||
prefix = placementProfile.Prefix == null ? string.Empty : placementProfile.Prefix,
|
|
||||||
firstName = placementProfile.Firstname == null ? string.Empty : placementProfile.Firstname,
|
|
||||||
lastName = placementProfile.Lastname == null ? string.Empty : placementProfile.Lastname,
|
|
||||||
citizenId = placementProfile.CitizenId == null ? string.Empty : placementProfile.CitizenId,
|
|
||||||
position = placementProfile.positionName == null ? string.Empty : placementProfile.positionName,
|
|
||||||
posLevelId = placementProfile.posLevelId == null ? string.Empty : placementProfile.posLevelId,
|
|
||||||
posTypeId = placementProfile.posTypeId == null ? string.Empty : placementProfile.posTypeId,
|
|
||||||
email = placementProfile.Email == null ? string.Empty : placementProfile.Email,
|
|
||||||
phone = placementProfile.MobilePhone == null ? string.Empty : placementProfile.MobilePhone,
|
|
||||||
keycloak = string.Empty,
|
|
||||||
isProbation = true,
|
|
||||||
isLeave = false,
|
|
||||||
dateRetire = (DateTime?)null,
|
|
||||||
dateAppoint = recv.commandAffectDate,
|
|
||||||
dateStart = recv.commandAffectDate,
|
|
||||||
govAgeAbsent = 0,
|
|
||||||
govAgePlus = 0,
|
|
||||||
birthDate = placementProfile.DateOfBirth == null ? (DateTime?)null : placementProfile.DateOfBirth,
|
|
||||||
reasonSameDate = (DateTime?)null,
|
|
||||||
ethnicity = placementProfile.Race == null ? string.Empty : placementProfile.Race,
|
|
||||||
telephoneNumber = placementProfile.Telephone == null ? string.Empty : placementProfile.Telephone,
|
|
||||||
nationality = placementProfile.Nationality == null ? string.Empty : placementProfile.Nationality,
|
|
||||||
gender = placementProfile.Gender == null ? string.Empty : placementProfile.Gender,
|
|
||||||
relationship = placementProfile.Relationship == null ? string.Empty : placementProfile.Relationship,
|
|
||||||
religion = placementProfile.Religion == null ? string.Empty : placementProfile.Religion,
|
|
||||||
bloodGroup = string.Empty,
|
|
||||||
registrationAddress = placementProfile.RegistAddress == null ? string.Empty : placementProfile.RegistAddress,
|
|
||||||
registrationProvinceId = (String?)null,
|
|
||||||
registrationDistrictId = (String?)null,
|
|
||||||
registrationSubDistrictId = (String?)null,
|
|
||||||
registrationZipCode = placementProfile.RegistZipCode == null ? string.Empty : placementProfile.RegistZipCode,
|
|
||||||
currentAddress = placementProfile.CurrentAddress == null ? string.Empty : placementProfile.CurrentAddress,
|
|
||||||
currentProvinceId = (String?)null,
|
|
||||||
currentDistrictId = (String?)null,
|
|
||||||
currentSubDistrictId = (String?)null,
|
|
||||||
currentZipCode = placementProfile.CurrentZipCode == null ? string.Empty : placementProfile.CurrentZipCode,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
profileId = JsonConvert.DeserializeObject<PlacementProfileId>(_result).result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (placementProfile.PlacementEducations != null)
|
|
||||||
{
|
|
||||||
var apiUrlEdu = $"{_configuration["API"]}/org/profile/educations";
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
foreach (var edu in placementProfile.PlacementEducations)
|
|
||||||
{
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlEdu, new
|
|
||||||
{
|
|
||||||
profileId = profileId,
|
|
||||||
country = edu.Country == null ? string.Empty : edu.Country,
|
|
||||||
degree = edu.Degree == null ? string.Empty : edu.Degree,
|
|
||||||
duration = edu.Duration == null ? string.Empty : edu.Duration,
|
|
||||||
durationYear = edu.DurationYear == null ? 0 : edu.DurationYear,
|
|
||||||
field = edu.Field == null ? string.Empty : edu.Field,
|
|
||||||
finishDate = edu.FinishDate == null ? (DateTime?)null : edu.FinishDate,
|
|
||||||
fundName = edu.FundName == null ? string.Empty : edu.FundName,
|
|
||||||
gpa = edu.Gpa == null ? string.Empty : edu.Gpa,
|
|
||||||
institute = edu.Institute == null ? string.Empty : edu.Institute,
|
|
||||||
other = edu.Other == null ? string.Empty : edu.Other,
|
|
||||||
startDate = edu.StartDate == null ? (DateTime?)null : edu.StartDate,
|
|
||||||
endDate = edu.EndDate == null ? (DateTime?)null : edu.EndDate,
|
|
||||||
educationLevel = edu.EducationLevel == null ? string.Empty : edu.EducationLevel.Name,
|
|
||||||
educationLevelId = string.Empty,
|
|
||||||
positionPath = edu.PositionPath == null ? null : edu.PositionPath,
|
|
||||||
positionPathId = string.Empty,
|
|
||||||
isDate = edu.IsDate,
|
|
||||||
isEducation = edu.IsEducation,
|
|
||||||
note = string.Empty,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (placementProfile.PlacementCertificates != null)
|
|
||||||
{
|
|
||||||
var apiUrlCer = $"{_configuration["API"]}/org/profile/certificate";
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
foreach (var cer in placementProfile.PlacementCertificates)
|
|
||||||
{
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlCer, new
|
|
||||||
{
|
|
||||||
profileId = profileId,
|
|
||||||
expireDate = cer.ExpireDate == null ? (DateTime?)null : cer.ExpireDate,
|
|
||||||
issueDate = cer.IssueDate == null ? (DateTime?)null : cer.IssueDate,
|
|
||||||
certificateNo = cer.CertificateNo == null ? string.Empty : cer.CertificateNo,
|
|
||||||
certificateType = cer.CertificateType == null ? string.Empty : cer.CertificateType,
|
|
||||||
issuer = cer.Issuer == null ? string.Empty : cer.Issuer,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var apiUrlSalary = $"{_configuration["API"]}/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 _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
|
||||||
{
|
|
||||||
profileId = profileId,
|
|
||||||
date = recv.commandAffectDate,
|
|
||||||
amount = placementProfile.Amount,
|
|
||||||
positionSalaryAmount = placementProfile.PositionSalaryAmount,
|
|
||||||
mouthSalaryAmount = placementProfile.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 == null ? string.Empty : placementProfile.positionName,
|
|
||||||
positionLine = string.Empty,
|
|
||||||
positionPathSide = string.Empty,
|
|
||||||
positionExecutive = string.Empty,
|
|
||||||
positionType = placementProfile.posTypeName == null ? string.Empty : placementProfile.posTypeName,
|
|
||||||
positionLevel = placementProfile.posLevelName == null ? string.Empty : 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 = profileId,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
}
|
|
||||||
// update placementstatus
|
|
||||||
placementProfile.PlacementStatus = "DONE";//DONE
|
|
||||||
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ออกคำสั่ง C-PM-02 บรรจุและแต่งตั้งผู้ได้รับคัดเลือก (NEW)
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200"></response>
|
|
||||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpPost("candidate/report/excecute-new")]
|
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteCandidateNew([FromBody] ReportExecuteRequest req)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -2308,9 +1930,9 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
profileId = string.Empty,
|
profileId = string.Empty,
|
||||||
date = r.commandAffectDate,
|
date = r.commandAffectDate,
|
||||||
amount = p.Amount,
|
amount = r.amount,
|
||||||
positionSalaryAmount = p.PositionSalaryAmount,
|
positionSalaryAmount = r.positionSalaryAmount,
|
||||||
mouthSalaryAmount = p.MouthSalaryAmount,
|
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||||
posNo = p.posMasterNo == null ? "" :
|
posNo = p.posMasterNo == null ? "" :
|
||||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||||
|
|
|
||||||
|
|
@ -998,31 +998,78 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
on p.Id.ToString() equals r.refId
|
on p.Id.ToString() equals r.refId
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
profileId = p.profileId,
|
bodyProfile = new
|
||||||
date = r.commandAffectDate,
|
{
|
||||||
amount = r.amount,
|
rank = string.Empty,
|
||||||
positionSalaryAmount = r.positionSalaryAmount,
|
prefix = p.prefix == null ? string.Empty : p.prefix,
|
||||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
firstName = p.firstName == null ? string.Empty : p.firstName,
|
||||||
posNo = p.posMasterNo == null ? "" :
|
lastName = p.lastName == null ? string.Empty : p.lastName,
|
||||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
citizenId = p.citizenId == null ? string.Empty : p.citizenId,
|
||||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
position = p.position == null ? string.Empty : p.position,
|
||||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
posLevelId = p.posLevelId == null ? string.Empty : p.posLevelId,
|
||||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
posTypeId = p.posTypeId == null ? string.Empty : p.posTypeId,
|
||||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
email = (String?)null,
|
||||||
position = p.position,
|
phone = (String?)null,
|
||||||
positionLine = "",
|
keycloak = string.Empty,
|
||||||
positionPathSide = "",
|
isProbation = true,
|
||||||
positionExecutive = "",
|
isLeave = false,
|
||||||
positionType = p.posTypeName,
|
dateRetire = (DateTime?)null,
|
||||||
positionLevel = p.posLevelName,
|
dateAppoint = r.commandAffectDate,
|
||||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
dateStart = r.commandAffectDate,
|
||||||
templateDoc = r.templateDoc,
|
govAgeAbsent = 0,
|
||||||
posmasterId = p.posmasterId,
|
govAgePlus = 0,
|
||||||
positionId = p.positionId,
|
birthDate = p.DateOfBirth == null ? (DateTime?)null : p.DateOfBirth,
|
||||||
|
reasonSameDate = (DateTime?)null,
|
||||||
|
ethnicity = p.Race == null ? string.Empty : p.Race,
|
||||||
|
telephoneNumber = (String?)null,
|
||||||
|
nationality = p.Nationality == null ? string.Empty : p.Nationality,
|
||||||
|
gender = p.Gender == null ? string.Empty : p.Gender,
|
||||||
|
relationship = p.Relationship == null ? string.Empty : p.Relationship,
|
||||||
|
religion = p.Religion == null ? string.Empty : p.Religion,
|
||||||
|
bloodGroup = string.Empty,
|
||||||
|
registrationAddress = (String?)null,
|
||||||
|
registrationProvinceId = (String?)null,
|
||||||
|
registrationDistrictId = (String?)null,
|
||||||
|
registrationSubDistrictId = (String?)null,
|
||||||
|
registrationZipCode = (String?)null,
|
||||||
|
currentAddress = (String?)null,
|
||||||
|
currentProvinceId = (String?)null,
|
||||||
|
currentDistrictId = (String?)null,
|
||||||
|
currentSubDistrictId = (String?)null,
|
||||||
|
currentZipCode = (String?)null,
|
||||||
|
},
|
||||||
|
bodySalarys = new
|
||||||
|
{
|
||||||
|
profileId = string.Empty,
|
||||||
|
date = r.commandAffectDate,
|
||||||
|
amount = r.amount,
|
||||||
|
positionSalaryAmount = r.positionSalaryAmount,
|
||||||
|
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||||
|
posNo = p.posMasterNo == null ? "" :
|
||||||
|
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||||
|
position = p.position == null ? string.Empty : p.position,
|
||||||
|
positionLine = string.Empty,
|
||||||
|
positionPathSide = string.Empty,
|
||||||
|
positionExecutive = string.Empty,
|
||||||
|
positionType = p.posTypeName == null ? string.Empty : p.posTypeName,
|
||||||
|
positionLevel = p.posLevelName == null ? string.Empty : p.posLevelName,
|
||||||
|
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||||
|
templateDoc = r.templateDoc
|
||||||
|
},
|
||||||
|
bodyPosition = new
|
||||||
|
{
|
||||||
|
posmasterId = p.posmasterId,
|
||||||
|
positionId = p.positionId
|
||||||
|
}
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
var baseAPIOrg = _configuration["API"];
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
//var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||||
|
var apiUrlOrg = $"{_configuration["API"]}/org/command/excexute/create-officer-profile";
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue