fix กจ. ไม่เห็นรายชื่อผู้สอบผ่านหลังจากเผยแพร่โครงสร้าง Task #2219
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m11s

This commit is contained in:
harid 2026-01-21 17:00:45 +07:00
parent c3901d56b3
commit d3501e831c
2 changed files with 12 additions and 7 deletions

View file

@ -155,6 +155,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var child2Id = "";
var child3Id = "";
var child4Id = "";
var rootDnaId = "";
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position-act";
using (var client = new HttpClient())
{
@ -173,11 +174,12 @@ namespace BMA.EHR.Placement.Service.Controllers
// child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
// child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
// child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
rootDnaId = org.result.rootDnaId == null ? "" : org.result.rootDnaId;
var data1 = await _context.PlacementProfiles
.Where(x => x.Placement.Id == examId)
.Where(x => x.Draft == true)
.Where(x => x.PlacementStatus != "UN-CONTAIN")
.Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id)))))
.Where(x => rootDnaId == "" ? true : (child1Id == "" ? x.rootDnaId == rootDnaId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id)))))
.Select(x => new
{
Id = x.Id,
@ -694,6 +696,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var child2Id = "";
var child3Id = "";
var child4Id = "";
var rootDnaId = "";
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position-act";
using (var client = new HttpClient())
{
@ -713,16 +716,17 @@ namespace BMA.EHR.Placement.Service.Controllers
// child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
// child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
// child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
rootDnaId = org.result.rootDnaId == null ? "" : org.result.rootDnaId;
var placement = await _context.Placements
.Where(x => x.Id == examId)
.Select(x => new
{
Total = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Count(),
UnContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
PrepareContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
Report = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
Done = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
Disclaim = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
Total = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootDnaId == "" ? true : (child1Id == "" ? x.rootDnaId == rootDnaId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Count(),
UnContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootDnaId == "" ? true : (child1Id == "" ? x.rootDnaId == rootDnaId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
PrepareContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootDnaId == "" ? true : (child1Id == "" ? x.rootDnaId == rootDnaId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
Report = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootDnaId == "" ? true : (child1Id == "" ? x.rootDnaId == rootDnaId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
Done = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootDnaId == "" ? true : (child1Id == "" ? x.rootDnaId == rootDnaId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
Disclaim = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootDnaId == "" ? true : (child1Id == "" ? x.rootDnaId == rootDnaId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
}).FirstOrDefaultAsync();
if (placement == null)
return Error(GlobalMessages.DataNotFound, 404);

View file

@ -15,5 +15,6 @@ namespace BMA.EHR.Placement.Service.Requests
public string? child2Id { get; set; }
public string? child3Id { get; set; }
public string? child4Id { get; set; }
public string? rootDnaId { get; set; }
}
}