report leave

This commit is contained in:
kittapath 2024-12-12 00:00:43 +07:00
parent 2510009cc6
commit 348da62370
3 changed files with 461 additions and 188 deletions

View file

@ -243,6 +243,66 @@ namespace BMA.EHR.Application.Repositories
}
}
public async Task<List<GetProfileByKeycloakIdDto>> GetProfileWithKeycloakAllOfficer(string? accessToken, string? node, string? nodeId)
{
try
{
var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak-all-officer";
var apiKey = _configuration["API_KEY"];
var body = new
{
node = node,
nodeId = nodeId,
};
var profiles = new List<SearchProfileDto>();
var apiResult = await PostExternalAPIAsync(apiPath, accessToken, body, apiKey);
if (apiResult != null)
{
var raw = JsonConvert.DeserializeObject<GetListProfileByKeycloakIdResultDto>(apiResult);
if (raw != null)
return raw.Result;
}
return null;
}
catch
{
throw;
}
}
public async Task<List<GetProfileByKeycloakIdDto>> GetProfileWithKeycloakAllEmployee(string? accessToken, string? node, string? nodeId)
{
try
{
var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak-all-employee";
var apiKey = _configuration["API_KEY"];
var body = new
{
node = node,
nodeId = nodeId,
};
var profiles = new List<SearchProfileDto>();
var apiResult = await PostExternalAPIAsync(apiPath, accessToken, body, apiKey);
if (apiResult != null)
{
var raw = JsonConvert.DeserializeObject<GetListProfileByKeycloakIdResultDto>(apiResult);
if (raw != null)
return raw.Result;
}
return null;
}
catch
{
throw;
}
}
public async Task<List<SearchProfileDto>> SearchProfile(string? citizenId, string? firstName, string? lastName, string accessToken)
{
try
@ -568,7 +628,7 @@ namespace BMA.EHR.Application.Repositories
}
}
public async Task<List<GetActiveRootDto>> GetActiveRootAsync(string? accessToken,Guid? revisionId)
public async Task<List<GetActiveRootDto>> GetActiveRootAsync(string? accessToken, Guid? revisionId)
{
try
{