diff --git a/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs b/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs index 669d75ef..72213b96 100644 --- a/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs +++ b/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs @@ -67,6 +67,18 @@ namespace BMA.EHR.Application.Responses.Profiles public Guid? CommanderKeycloak { get; set; } + public string? TelephoneNumber { get; set; } + + public string? CurrentAddress { get; set; } + + public string? CurrentSubDistrict { get; set; } + + public string? CurrentDistrict { get; set; } + + public string? CurrentProvince { get; set; } + + public string? CurrentZipCode { get; set; } + } public class PosLevel diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index f461a996..72952db8 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using Org.BouncyCastle.Asn1.Pkcs; using Swashbuckle.AspNetCore.Annotations; using System.Net.Http.Headers; using System.Security.Claims; @@ -716,6 +717,18 @@ namespace BMA.EHR.Leave.Service.Controllers var remainPrev = 0.0; + var orgName = ""; + if (profile.Child1 != null && profile.Child1 != "") + orgName += $" {profile.Child1}"; + if (profile.Child2 != null && profile.Child2 != "") + orgName += $" {profile.Child2}"; + if (profile.Child3 != null && profile.Child3 != "") + orgName += $" {profile.Child3}"; + if (profile.Child4 != null && profile.Child4 != "") + orgName += $" {profile.Child4}"; + if (profile.Root != null && profile.Root != "") + orgName += $" {profile.Root}"; + @@ -779,7 +792,7 @@ namespace BMA.EHR.Leave.Service.Controllers Dear = profile.Commander ?? "", PositionName = profile.Position == null ? "" : profile.Position, PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel, - OrganizationName = profile.Root ?? "", //profile.Oc ?? "", + OrganizationName = orgName, //profile.Oc ?? "", LeaveLimit = leaveLimit, LeaveTotal = sumLeave, @@ -789,7 +802,14 @@ namespace BMA.EHR.Leave.Service.Controllers DateAppoint = profile.DateAppoint == null ? null : profile.DateAppoint.Value.Date, Salary = lastSalary == null ? 0 : lastSalary.Amount == null ? 0 : (int)lastSalary.Amount.Value, SalaryText = lastSalary == null ? "" : lastSalary.Amount == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false), - LeaveLast = leaveLast == null ? null : leaveLast + LeaveLast = leaveLast == null ? null : leaveLast, + + TelephoneNumber = profile.TelephoneNumber ?? "-", + CurrentAddress = profile.CurrentAddress ?? "-", + CurrentSubDistrict = profile.CurrentSubDistrict ?? "-", + CurrentDistrict = profile.CurrentDistrict ?? "-", + CurrentProvince = profile.CurrentProvince ?? "-", + CurrentZipCode = profile.CurrentZipCode ?? "-", }; return Success(result); diff --git a/BMA.EHR.Leave/DTOs/LeaveRequest/GetUserLeaveProfileResultDto.cs b/BMA.EHR.Leave/DTOs/LeaveRequest/GetUserLeaveProfileResultDto.cs index 1aa32a02..ea512127 100644 --- a/BMA.EHR.Leave/DTOs/LeaveRequest/GetUserLeaveProfileResultDto.cs +++ b/BMA.EHR.Leave/DTOs/LeaveRequest/GetUserLeaveProfileResultDto.cs @@ -33,5 +33,17 @@ public string SalaryText { get; set; } public DateTime? LeaveLast { get; set; } + + public string? TelephoneNumber { get; set; } + + public string? CurrentAddress { get; set; } + + public string? CurrentSubDistrict { get; set; } + + public string? CurrentDistrict { get; set; } + + public string? CurrentProvince { get; set; } + + public string? CurrentZipCode { get; set; } } }