เพิ่มเครื่องราชฯ เพิ่มหน้ากรองลูกจ้างประจำก่อนประมวลผล
Some checks failed
release-dev / release-dev (push) Failing after 11s

This commit is contained in:
kittapath 2025-01-25 01:20:08 +07:00
parent d0e5089a06
commit 8a3baab88f
10 changed files with 19516 additions and 2 deletions

View file

@ -6530,8 +6530,13 @@ namespace BMA.EHR.Application.Repositories
var allOfficerProfilesByRoot =
(await _userProfileRepository.GetOfficerProfileByRootIdAsync(ocId, AccessToken));
var allEmployeeProfileByRoot =
(await _userProfileRepository.GetEmployeeProfileByRootIdAsync(ocId, AccessToken));
var period = await _dbContext.Set<InsigniaPeriod>().Include(x => x.InsigniaEmployees).FirstOrDefaultAsync(p => p.Id == periodId);
var allEmployeeProfileByRoot = new List<GetProfileByRootIdDto>();
if (period != null && period.InsigniaEmployees != null)
{
allEmployeeProfileByRoot =
(await _userProfileRepository.GetEmployeeProfileByPositionAsync(period.InsigniaEmployees.Select(x => x.RefId), AccessToken));
}
var type_coin = await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot);
var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot);

View file

@ -129,6 +129,35 @@ namespace BMA.EHR.Application.Repositories
}
}
public async Task<List<GetProfileByRootIdDto>> GetEmployeeProfileByPositionAsync(dynamic empPosId, string? accessToken)
{
try
{
var apiPath = $"{_configuration["API"]}/org/dotnet/find/employee/position";
var apiKey = _configuration["API_KEY"];
var body = new
{
empPosId
};
var apiResult = await PostExternalAPIAsync(apiPath, accessToken, body, apiKey);
if (apiResult != null)
{
var raw = JsonConvert.DeserializeObject<GetProfileByRootIdResultDto>(apiResult);
if (raw != null)
return raw.Result;
}
return null;
}
catch
{
throw;
}
}
public async Task<GetProfileByKeycloakIdDto?> GetProfileByKeycloakIdAsync(Guid keycloakId, string? accessToken)
{
try