test
This commit is contained in:
parent
2b0151fd67
commit
52f3d6e786
2 changed files with 27 additions and 11 deletions
|
|
@ -184,9 +184,9 @@ namespace BMA.EHR.Recruit.Service.Services
|
|||
var httpClient1 = new HttpClient();
|
||||
httpClient1.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token?.Replace("Bearer ", ""));
|
||||
httpClient1.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var apiUrl1 = $"{_configuration["API"]}/api/v1/org/pos/type";
|
||||
var apiUrl1 = $"{_configuration["API"]}/api/v1/org/pos/level";
|
||||
var response1 = await httpClient1.GetStringAsync(apiUrl1);
|
||||
var posType = JsonConvert.DeserializeObject<RecruitPosTypeRequest>(response1);
|
||||
var posOptions = JsonConvert.DeserializeObject<RecruitPosRequest>(response1);
|
||||
|
||||
var recruitImport = await _context.RecruitImports.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Id == examId);
|
||||
|
|
@ -294,12 +294,28 @@ namespace BMA.EHR.Recruit.Service.Services
|
|||
var registAddress = BuildAddress(firstAddress?.Address, firstAddress?.Moo, firstAddress?.Soi, firstAddress?.Road);
|
||||
var currentAddress = BuildAddress(firstAddress?.Address1, firstAddress?.Moo1, firstAddress?.Soi1, firstAddress?.Road1);
|
||||
|
||||
// หาค่า posLevelName หลังสุด
|
||||
var posLevelObject = posOptions?.result?.FirstOrDefault(x =>
|
||||
!string.IsNullOrWhiteSpace(x.posLevelName) &&
|
||||
!string.IsNullOrWhiteSpace(candidate.PositionName) &&
|
||||
candidate.PositionName.Contains(x.posLevelName));
|
||||
|
||||
// เก็บเฉพาะค่า posLevelName
|
||||
var posLevelName = posLevelObject?.posLevelName;
|
||||
|
||||
// สร้างตัวแปร PositionName ที่ตัดค่า posLevelName ออก
|
||||
var positionNameWithoutLevel = candidate.PositionName ?? "";
|
||||
if (!string.IsNullOrWhiteSpace(posLevelName))
|
||||
{
|
||||
positionNameWithoutLevel = positionNameWithoutLevel.Replace(posLevelName, "").Trim();
|
||||
}
|
||||
|
||||
var placementProfile = new PlacementProfile
|
||||
{
|
||||
Placement = placement,
|
||||
PositionCandidate = candidate.PositionName ?? "",
|
||||
PositionType = candidate.PositionType ?? "",
|
||||
PositionLevel = candidate.PositionLevel ?? "",
|
||||
PositionCandidate = positionNameWithoutLevel,
|
||||
PositionType = posLevelObject?.posTypes?.posLevelName ?? "",
|
||||
PositionLevel = posLevelName ?? "",
|
||||
Prefix = candidate.Prefix ?? "",
|
||||
Firstname = candidate.FirstName ?? "",
|
||||
Lastname = candidate.LastName ?? "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue