Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 56s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 56s
This commit is contained in:
commit
37601e2e18
5 changed files with 19 additions and 4 deletions
|
|
@ -86,6 +86,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
private string? RootDnaId => _httpContextAccessor?.HttpContext?.User?.FindFirst("orgRootDnaId")?.Value;
|
||||||
private string? token => _httpContextAccessor.HttpContext.Request.Headers["Authorization"];
|
private string? token => _httpContextAccessor.HttpContext.Request.Headers["Authorization"];
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -487,6 +488,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
Note = req.Note,
|
Note = req.Note,
|
||||||
AnnouncementDate = req.AnnouncementDate,
|
AnnouncementDate = req.AnnouncementDate,
|
||||||
CheckDisability = true,
|
CheckDisability = true,
|
||||||
|
OrganizationId = req.rootDnaId,
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
|
@ -499,7 +501,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
||||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
var _res = await client.SendAsync(_req);
|
var _res = await client.SendAsync(_req);
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
@ -668,8 +670,16 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
{
|
{
|
||||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||||
}
|
}
|
||||||
|
string role = jsonData["result"]?.ToString() ?? string.Empty;
|
||||||
|
string rootDnaId = string.Empty;
|
||||||
|
if (role != "OWNER")
|
||||||
|
{
|
||||||
|
rootDnaId = RootDnaId?.ToString() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
var data = await _context.PeriodExams.AsQueryable()
|
var data = await _context.PeriodExams.AsQueryable()
|
||||||
.Where(x => x.CheckDisability == true)
|
.Where(x => x.CheckDisability == true)
|
||||||
|
.Where(x => string.IsNullOrEmpty(rootDnaId) || x.OrganizationId == Guid.Parse(rootDnaId))
|
||||||
.Include(x => x.ImportFile)
|
.Include(x => x.ImportFile)
|
||||||
.Include(x => x.Disables)
|
.Include(x => x.Disables)
|
||||||
.Include(x => x.ScoreImport)
|
.Include(x => x.ScoreImport)
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
||||||
var req = await client.GetAsync(apiPath);
|
var req = await client.GetAsync(apiPath);
|
||||||
var res = await req.Content.ReadAsStringAsync();
|
var res = await req.Content.ReadAsStringAsync();
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -82,5 +82,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Request.Disables
|
||||||
/// วันที่ประกาศผลสอบ
|
/// วันที่ประกาศผลสอบ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime AnnouncementDate { get; set; }
|
public DateTime AnnouncementDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// รหัส DNA หน่วยงาน
|
||||||
|
/// </summary>
|
||||||
|
public Guid? rootDnaId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2663,7 +2663,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token?.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token?.Replace("Bearer ", ""));
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
||||||
var _res = await client.PostAsJsonAsync(apiUrl, new
|
var _res = await client.PostAsJsonAsync(apiUrl, new
|
||||||
{
|
{
|
||||||
citizenId
|
citizenId
|
||||||
|
|
|
||||||
|
|
@ -2982,7 +2982,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
||||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
var _res = await client.SendAsync(_req);
|
var _res = await client.SendAsync(_req);
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue