fix: create leave request user commander and user oc
Some checks failed
release-dev / release-dev (push) Failing after 13s
Some checks failed
release-dev / release-dev (push) Failing after 13s
fix: create leave handle lastSalary Amount while null value
This commit is contained in:
parent
5d8a0b842a
commit
62f2fd85cc
1 changed files with 26 additions and 17 deletions
|
|
@ -277,10 +277,14 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
case "LV-008":
|
||||
{
|
||||
var lastSalary = profile.ProfileSalary;
|
||||
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount == null ? 0 : lastSalary.Amount;
|
||||
var lastSalaryAmountText = lastSalary == null ? "" : lastSalary.Amount == null ? "" : ((int)lastSalary.Amount).ToThaiBahtText(false);
|
||||
leaveRequest.LeaveSalary = (int)lastSalaryAmount;
|
||||
leaveRequest.LeaveSalaryText = lastSalaryAmountText;
|
||||
//leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||
//leaveRequest.LeaveSalaryText =
|
||||
// lastSalary == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false);
|
||||
|
||||
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||
leaveRequest.LeaveSalaryText =
|
||||
lastSalary == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false);
|
||||
leaveRequest.LeaveBirthDate = profile.BirthDate;
|
||||
leaveRequest.LeaveGovernmentDate = profile.DateStart;
|
||||
|
||||
|
|
@ -297,10 +301,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
case "LV-010":
|
||||
{
|
||||
var lastSalary = profile.ProfileSalary;
|
||||
|
||||
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||
leaveRequest.LeaveSalaryText =
|
||||
lastSalary == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false);
|
||||
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount == null ? 0 : lastSalary.Amount;
|
||||
var lastSalaryAmountText = lastSalary == null ? "" : lastSalary.Amount == null ? "" : ((int)lastSalary.Amount).ToThaiBahtText(false);
|
||||
leaveRequest.LeaveSalary = (int)lastSalaryAmount;
|
||||
leaveRequest.LeaveSalaryText = lastSalaryAmountText;
|
||||
//leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||
//leaveRequest.LeaveSalaryText =
|
||||
// lastSalary == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false);
|
||||
|
||||
leaveRequest.CoupleDayName = req.CoupleDayName ?? "";
|
||||
leaveRequest.CoupleDayPosition = req.CoupleDayPosition ?? "";
|
||||
|
|
@ -321,20 +328,22 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
}
|
||||
|
||||
// add dear and oc_data
|
||||
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
var approver = string.Empty;
|
||||
if (rootOc != null)
|
||||
{
|
||||
var list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
|
||||
if (list.Count > 0)
|
||||
approver = list.First().Name;
|
||||
}
|
||||
//var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
var approver = profile.Commander ?? "";
|
||||
var userOc = profile.Root ?? "";
|
||||
//if (rootOc != null)
|
||||
//{
|
||||
// var list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
|
||||
// if (list.Count > 0)
|
||||
// approver = list.First().Name;
|
||||
//}
|
||||
|
||||
|
||||
leaveRequest.LeaveTypeCode = leaveType.Code;
|
||||
leaveRequest.Dear = approver;
|
||||
leaveRequest.PositionName = profile.Position == null ? "" : profile.Position;
|
||||
leaveRequest.PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel.PosLevelName;
|
||||
leaveRequest.OrganizationName = profile.Root ?? "";
|
||||
leaveRequest.OrganizationName = userOc;
|
||||
|
||||
|
||||
|
||||
|
|
@ -693,7 +702,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var lastSalary = profile.ProfileSalary;
|
||||
|
||||
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
//var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
var approver = profile.Commander ?? "";
|
||||
var userOc = profile.Root ?? "";
|
||||
//if (rootOc != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue