ปรับการแสดงผลจัดการรอบคัดเลือกอื่นๆ #11

This commit is contained in:
harid 2026-06-10 12:24:08 +07:00
parent 09e12ea888
commit bc4c6a2ea7
5 changed files with 19 additions and 4 deletions

View file

@ -86,6 +86,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.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"];
#endregion
@ -487,6 +488,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
Note = req.Note,
AnnouncementDate = req.AnnouncementDate,
CheckDisability = true,
OrganizationId = req.rootDnaId,
CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "System Administrator",
@ -499,7 +501,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
using (var client = new HttpClient())
{
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 _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -668,8 +670,16 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
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()
.Where(x => x.CheckDisability == true)
.Where(x => string.IsNullOrEmpty(rootDnaId) || x.OrganizationId == Guid.Parse(rootDnaId))
.Include(x => x.ImportFile)
.Include(x => x.Disables)
.Include(x => x.ScoreImport)