This commit is contained in:
Suphonchai Phoonsawat 2025-03-31 10:59:06 +07:00
parent 31625d0418
commit 82a2dc42e6
3 changed files with 46 additions and 2 deletions

View file

@ -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

View file

@ -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);

View file

@ -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; }
}
}