test
This commit is contained in:
parent
d8520d650f
commit
94b7ca4d8e
1 changed files with 17 additions and 0 deletions
|
|
@ -294,37 +294,50 @@ namespace BMA.EHR.Recruit.Service.Services
|
|||
|
||||
foreach (var candidate in candidates)
|
||||
{
|
||||
Console.WriteLine("5111");
|
||||
if (string.IsNullOrWhiteSpace(candidate.ExamId) ||
|
||||
!recruitScoresDict.TryGetValue(candidate.ExamId, out var recruitScore))
|
||||
continue;
|
||||
Console.WriteLine("5112");
|
||||
|
||||
var org = orgDict.TryGetValue(candidate.CitizenId ?? "", out var orgValue) ? orgValue : null;
|
||||
Console.WriteLine("5113");
|
||||
var isOfficer = org?.result != null;
|
||||
Console.WriteLine("5114");
|
||||
|
||||
// 🚀 Cache repeated calculations
|
||||
var firstAddress = candidate.Addresses?.FirstOrDefault();
|
||||
Console.WriteLine("5115");
|
||||
var firstEducation = candidate.Educations?.FirstOrDefault();
|
||||
Console.WriteLine("5116");
|
||||
var firstCertificate = candidate.Certificates?.FirstOrDefault();
|
||||
Console.WriteLine("5117");
|
||||
var firstOccupation = candidate.Occupations?.FirstOrDefault();
|
||||
|
||||
Console.WriteLine("5118");
|
||||
var registAddress = BuildAddress(firstAddress?.Address, firstAddress?.Moo, firstAddress?.Soi, firstAddress?.Road);
|
||||
Console.WriteLine("5119");
|
||||
var currentAddress = BuildAddress(firstAddress?.Address1, firstAddress?.Moo1, firstAddress?.Soi1, firstAddress?.Road1);
|
||||
|
||||
Console.WriteLine("5120");
|
||||
// หาค่า posLevelName หลังสุด
|
||||
var posLevelObject = posOptions?.result?.FirstOrDefault(x =>
|
||||
!string.IsNullOrWhiteSpace(x.posLevelName) &&
|
||||
!string.IsNullOrWhiteSpace(candidate.PositionName) &&
|
||||
candidate.PositionName.Contains(x.posLevelName));
|
||||
|
||||
Console.WriteLine("5121");
|
||||
// เก็บเฉพาะค่า posLevelName
|
||||
var posLevelName = posLevelObject?.posLevelName;
|
||||
|
||||
// สร้างตัวแปร PositionName ที่ตัดค่า posLevelName ออก
|
||||
var positionNameWithoutLevel = candidate.PositionName ?? "";
|
||||
Console.WriteLine("5122");
|
||||
if (!string.IsNullOrWhiteSpace(posLevelName))
|
||||
{
|
||||
positionNameWithoutLevel = positionNameWithoutLevel.Replace(posLevelName, "").Trim();
|
||||
}
|
||||
Console.WriteLine("5123");
|
||||
|
||||
var placementProfile = new PlacementProfile
|
||||
{
|
||||
|
|
@ -412,7 +425,9 @@ namespace BMA.EHR.Recruit.Service.Services
|
|||
posLevelIdOld = org?.result?.posLevelId ?? "",
|
||||
posLevelNameOld = org?.result?.posLevelName ?? "",
|
||||
};
|
||||
Console.WriteLine("5124");
|
||||
placementProfiles.Add(placementProfile);
|
||||
Console.WriteLine("5125");
|
||||
|
||||
var placementEducation = new PlacementEducation
|
||||
{
|
||||
|
|
@ -432,7 +447,9 @@ namespace BMA.EHR.Recruit.Service.Services
|
|||
CreatedFullName = FullName ?? "",
|
||||
LastUpdateFullName = FullName ?? "",
|
||||
};
|
||||
Console.WriteLine("5125");
|
||||
placementEducations.Add(placementEducation);
|
||||
Console.WriteLine("5126");
|
||||
|
||||
var placementCertificate = new PlacementCertificate
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue