Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m20s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m20s
This commit is contained in:
commit
79e0fe7f1b
2 changed files with 258 additions and 36 deletions
|
|
@ -165,9 +165,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
leaveDetail = data.LeaveDetail.ToThaiNumber(),
|
leaveDetail = data.LeaveDetail.ToThaiNumber(),
|
||||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
|
|
@ -228,9 +247,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
wifeDayName = data.WifeDayName ?? "",
|
wifeDayName = data.WifeDayName ?? "",
|
||||||
wifeDayDateBorn = data.WifeDayDateBorn == null || data.WifeDayDateBorn == "" ? "" : DateTime.Parse(data.WifeDayDateBorn).ToThaiShortDate().ToThaiNumber(),
|
wifeDayDateBorn = data.WifeDayDateBorn == null || data.WifeDayDateBorn == "" ? "" : DateTime.Parse(data.WifeDayDateBorn).ToThaiShortDate().ToThaiNumber(),
|
||||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
|
|
@ -289,9 +327,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
restDayOldTotal = extendLeave.ToString().ToThaiNumber(),
|
restDayOldTotal = extendLeave.ToString().ToThaiNumber(),
|
||||||
restDayCurrentTotal = (10).ToString().ToThaiNumber(),
|
restDayCurrentTotal = (10).ToString().ToThaiNumber(),
|
||||||
|
|
@ -357,9 +414,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
|
|
||||||
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
|
|
@ -393,9 +469,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
leavebirthDate = data.LeaveBirthDate == null ? "" : data.LeaveBirthDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
leavebirthDate = data.LeaveBirthDate == null ? "" : data.LeaveBirthDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
|
|
@ -454,9 +549,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
absentDaySummon = data.AbsentDaySummon.ToThaiNumber(),
|
absentDaySummon = data.AbsentDaySummon.ToThaiNumber(),
|
||||||
absentDayLocation = data.AbsentDayLocation.ToThaiNumber(),
|
absentDayLocation = data.AbsentDayLocation.ToThaiNumber(),
|
||||||
|
|
@ -509,9 +623,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
leavebirthDate = data.LeaveBirthDate == null ? "" : data.LeaveBirthDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
leavebirthDate = data.LeaveBirthDate == null ? "" : data.LeaveBirthDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
|
|
@ -587,9 +720,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
fullnameEng = "",
|
fullnameEng = "",
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
|
|
@ -679,9 +831,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
leaveSalary = data.LeaveSalary == null ? "" : data.LeaveSalary.Value.ToNumericText().ToThaiNumber(),
|
leaveSalary = data.LeaveSalary == null ? "" : data.LeaveSalary.Value.ToNumericText().ToThaiNumber(),
|
||||||
leaveSalaryText = data.LeaveSalaryText.ToThaiNumber(),
|
leaveSalaryText = data.LeaveSalaryText.ToThaiNumber(),
|
||||||
|
|
@ -748,9 +919,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||||
fullname = fullName,
|
fullname = fullName,
|
||||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||||
|
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: profile.Position
|
||||||
|
: profile.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(profile.Position)
|
||||||
|
? "-"
|
||||||
|
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||||
|
? profile.Position
|
||||||
|
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
posExecutiveName = profile.PosExecutiveName,
|
||||||
|
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||||
|
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||||
|
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||||
|
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||||
|
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||||
|
|
||||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||||
|
|
@ -2606,11 +2796,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
var _default = new
|
var _default = new
|
||||||
{
|
{
|
||||||
fullName = "......................",
|
fullName = "............................................",
|
||||||
positionName = "......................",
|
positionName = "............................................",
|
||||||
positionSign = "......................",
|
posExOrg = Array.Empty<string>(),
|
||||||
updatedAt = "...... /...... /......",
|
positionSign = "............................................",
|
||||||
comment = "......................",
|
updatedAt = "............/............/............",
|
||||||
|
comment = "......................................................................................................................................................................",
|
||||||
approveType = ""
|
approveType = ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2618,37 +2809,61 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
fullName = $"{(x.Prefix ?? "")}{(x.FirstName ?? "")} {(x.LastName ?? "")}".Trim(),
|
fullName = $"{(x.Prefix ?? "")}{(x.FirstName ?? "")} {(x.LastName ?? "")}".Trim(),
|
||||||
positionName = x.PositionName ?? "......................",
|
positionName = (!string.IsNullOrEmpty(x.PositionLevelName) &&
|
||||||
positionSign = x.PositionSign ?? "......................",
|
(x.PositionLevelName.Contains("อำนวยการ") || x.PositionLevelName.Contains("บริหาร"))
|
||||||
|
? string.IsNullOrEmpty(x.PosExecutiveName)
|
||||||
|
? string.IsNullOrEmpty(x.PositionName)
|
||||||
|
? "............................................"
|
||||||
|
: x.PositionName
|
||||||
|
: x.PosExecutiveName
|
||||||
|
: string.IsNullOrEmpty(x.PositionName)
|
||||||
|
? "............................................"
|
||||||
|
: string.IsNullOrEmpty(x.PositionLevelName)
|
||||||
|
? x.PositionName
|
||||||
|
: $"{x.PositionName}{x.PositionLevelName}").ToThaiNumber(),
|
||||||
|
posExOrg = !string.IsNullOrEmpty(x.PositionLevelName) &&
|
||||||
|
(x.PositionLevelName.Contains("อำนวยการ") || x.PositionLevelName.Contains("บริหาร"))
|
||||||
|
? new[] { (x!.OrganizationName!.ToThaiNumber()) }
|
||||||
|
: !string.IsNullOrEmpty(x.PosExecutiveName)
|
||||||
|
? new[] { (x.PosExecutiveName.ToThaiNumber()), (x!.OrganizationName!.ToThaiNumber()) }
|
||||||
|
: new[] { (x!.OrganizationName!.ToThaiNumber()) },
|
||||||
|
positionSign = !string.IsNullOrEmpty(x.PositionSign)
|
||||||
|
? x.PositionSign.Replace("\r", "").Replace("\n", " ")
|
||||||
|
: "............................................",
|
||||||
updatedAt = x.LastUpdatedAt.HasValue
|
updatedAt = x.LastUpdatedAt.HasValue
|
||||||
? x.LastUpdatedAt.Value.Date.ToThaiShortDate().ToThaiNumber()
|
? x.LastUpdatedAt.Value.Date.ToThaiShortDate().ToThaiNumber()
|
||||||
: "...... /...... /......",
|
: "............/............/............",
|
||||||
comment = !string.IsNullOrEmpty(x.Comment)
|
comment = !string.IsNullOrEmpty(x.Comment)
|
||||||
? x.Comment.Replace("\r", "").Replace("\n", "").Trim()
|
? x.Comment.Replace("\r", "").Replace("\n", " ").Trim()
|
||||||
: "......................",
|
: "......................................................................................................................................................................",
|
||||||
approveType = (x.ApproveType ?? "").Trim().ToUpper()
|
approveType = (x.ApproveType ?? "").Trim().ToUpper()
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
// การเจ้าหน้าที่
|
||||||
var sender = approvers
|
var sender = approvers
|
||||||
.FirstOrDefault(x => x.approveType == "SENDER")
|
.FirstOrDefault(x => x.approveType == "SENDER")
|
||||||
?? _default;
|
?? _default;
|
||||||
|
|
||||||
var approver = approvers
|
// ผู้บังคับบัญชา (มีได้มากกว่า 1 คน)
|
||||||
.FirstOrDefault(x => x.approveType == "APPROVER")
|
|
||||||
?? _default;
|
|
||||||
|
|
||||||
var commanders = approvers
|
var commanders = approvers
|
||||||
.Where(x => x.approveType == "COMMANDER")
|
.Where(x => x.approveType == "COMMANDER")
|
||||||
.DefaultIfEmpty(_default)
|
.DefaultIfEmpty(_default)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
// ผู้มีอำนาจ
|
||||||
|
var approver = approvers
|
||||||
|
.FirstOrDefault(x => x.approveType == "APPROVER")
|
||||||
|
?? _default;
|
||||||
|
|
||||||
return new
|
return new
|
||||||
{
|
{
|
||||||
|
sign = "............................................",
|
||||||
sender = sender,
|
sender = sender,
|
||||||
approver = approver,
|
approver = approver,
|
||||||
commanders = commanders
|
commanders = commanders
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,14 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
ProfileId = r.ProfileId,
|
ProfileId = r.ProfileId,
|
||||||
KeycloakId = r.KeycloakId,
|
KeycloakId = r.KeycloakId,
|
||||||
ApproveStatus = "PENDING",
|
ApproveStatus = "PENDING",
|
||||||
ApproveType = type.Trim().ToUpper()
|
ApproveType = type.Trim().ToUpper(),
|
||||||
|
|
||||||
|
CreatedFullName = FullName ?? "",
|
||||||
|
CreatedUserId = UserId!,
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
LastUpdateFullName = FullName ?? "",
|
||||||
|
LastUpdateUserId = UserId!,
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2033,7 +2040,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
Prefix = profile.Prefix ?? "",
|
Prefix = profile.Prefix ?? "",
|
||||||
FirstName = profile.FirstName ?? "",
|
FirstName = profile.FirstName ?? "",
|
||||||
LastName = profile.LastName ?? "",
|
LastName = profile.LastName ?? "",
|
||||||
PositionName = $"{profile.Position ?? ""}{profile.PositionLeaveName ?? ""}",
|
PositionName = $"{profile.Position ?? ""}",
|
||||||
ProfileId = profile.Id,
|
ProfileId = profile.Id,
|
||||||
KeycloakId = Guid.Parse(UserId!),
|
KeycloakId = Guid.Parse(UserId!),
|
||||||
ApproveType = "SENDER",
|
ApproveType = "SENDER",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue