From db20be6e503599d9df2ca50fc46728fc5047559f Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 8 Apr 2025 17:44:59 +0700 Subject: [PATCH] =?UTF-8?q?Noti=20=E0=B8=9E=E0=B8=99=E0=B8=B1=E0=B8=81?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B8=9A=E0=B8=AD=E0=B8=B8=E0=B8=97=E0=B8=98=E0=B8=A3?= =?UTF-8?q?=E0=B8=93=E0=B9=8C=20&=20filter=20=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=94?= =?UTF-8?q?=E0=B8=B3=E0=B9=80=E0=B8=99=E0=B8=B4=E0=B8=99=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=97=E0=B8=B2=E0=B8=87=E0=B8=A7=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DisciplineComplaint_AppealController.cs | 6 ++- .../Controllers/DisciplineReportController.cs | 52 +++++++++++++------ 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs index 5efde9da..0b063984 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs @@ -401,7 +401,8 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers } } var baseAPIOrg = _configuration["API"]; - var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director"; + var system = "SYS_DISCIPLINE_APPEAL"; + var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director/{system}"; var refId = new List(); using (var client = new HttpClient()) @@ -508,7 +509,8 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers } } var baseAPIOrg = _configuration["API"]; - var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director"; + var system = "SYS_DISCIPLINE_APPEAL"; + var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director/{system}"; var refId = new List(); using (var client = new HttpClient()) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineReportController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineReportController.cs index f819e6a0..d189108a 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineReportController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineReportController.cs @@ -74,20 +74,20 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers { return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden); } - var profile = new List(); - if (type.Trim().ToUpper() == "OFFICER") - { - profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD"); - } - else - { - profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD"); - } + //var profile = new List(); + //if (type.Trim().ToUpper() == "OFFICER") + //{ + // profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD"); + //} + //else + //{ + // profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD"); + //} - if (req.posLevel != null || req.posType != null) - { - profile = profile.Where(x => x.PositionType == req.posType || x.PositionLevel == req.posLevel).ToList(); - } + //if (req.posLevel != null || req.posType != null) + //{ + // profile = profile.Where(x => x.PositionType == req.posType || x.PositionLevel == req.posLevel).ToList(); + //} var data_search = await _context.DisciplineDisciplinarys .Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates) @@ -122,9 +122,25 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers : "" : "", faultLevel = d.DisciplinaryFaultLevel, + Child4Id = profile.child4Id, + Child4 = profile.child4, + Child3Id = profile.child3Id, + Child3 = profile.child3, + Child2Id = profile.child2Id, + Child2 = profile.child2, + Child1Id = profile.child1Id, + Child1 = profile.child1, + RootId = profile.rootId, + Root = profile.root, + PosType = profile.posTypeName, + PosLevel = profile.posLevelName })) - .Where(x => - x.citizenId != null && profile.Any(p => p.CitizenId == x.citizenId)) + //.Where(x => + // x.citizenId != null && profile.Any(p => p.CitizenId == x.citizenId)) + .Where(x => req.node == 4 ? x.Child4Id == req.nodeId : (req.node == 3 ? x.Child3Id == req.nodeId : (req.node == 2 ? x.Child2Id == req.nodeId : (req.node == 1 ? x.Child1Id == req.nodeId : (req.node == 0 ? x.RootId == req.nodeId : (req.node == null ? true : true)))))) + .Where(x => jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD" ? true : (req.node == 0 ? x.Child1Id == null : (req.node == 1 ? x.Child2Id == null : (req.node == 2 ? x.Child3Id == null : (req.node == 3 ? x.Child4Id == null : true))))) + .Where(x => string.IsNullOrEmpty(req.posType) || x.PosType == req.posType) + .Where(x => string.IsNullOrEmpty(req.posLevel) || x.PosLevel == req.posLevel) .OrderByDescending(x => x.CreatedAt) .ToList(); @@ -139,7 +155,11 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers citizenId = p.citizenId, position = p.position, posLevel = p.posLevel, - oc = profile.FirstOrDefault(x => x.CitizenId == p.citizenId)?.Oc ?? "", + oc = (p.Child4 == null ? "" : p.Child4 + "\n") + + (p.Child3 == null ? "" : p.Child3 + "\n") + + (p.Child2 == null ? "" : p.Child2 + "\n") + + (p.Child1 == null ? "" : p.Child1 + "\n") + + (p.Root == null ? "" : p.Root), offense = p.offense, faultLevel = p.faultLevel, one = 0,