fix คำนวณเครื่องราชย์
This commit is contained in:
parent
41474b407d
commit
0ed2d4c389
4 changed files with 56 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Http;
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using System.Reflection.Emit;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace BMA.EHR.Application.Repositories
|
||||
|
|
@ -510,6 +511,28 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetActiveRootDto>> GetActiveRootAsync(string? accessToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/active/root";
|
||||
|
||||
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "");
|
||||
if (apiResult != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetActiveRootResultDto>(apiResult);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
namespace BMA.EHR.Application.Responses.Organizations
|
||||
{
|
||||
public class GetActiveRootDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid CreatedUserId { get; set; }
|
||||
public DateTime LastUpdatedAt { get; set; }
|
||||
public Guid LastUpdateUserId { get; set; }
|
||||
public string CreatedFullName { get; set; } = string.Empty;
|
||||
public string LastUpdateFullName { get; set; } = string.Empty;
|
||||
|
||||
public string OrgRootName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
namespace BMA.EHR.Application.Responses.Organizations
|
||||
{
|
||||
public class GetActiveRootResultDto
|
||||
{
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
public int Status { get; set; } = -1;
|
||||
|
||||
public List<GetActiveRootDto> Result { get; set; } = new();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue