Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m24s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m24s
* develop: leave v2
This commit is contained in:
commit
9fe3c82a9b
2 changed files with 46 additions and 9 deletions
|
|
@ -157,7 +157,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
|
||||
return null;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
|
@ -520,7 +520,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileByAdminRole(string? accessToken, int? node, string? nodeId, string role, string? revisionId, int? reqNode, string? reqNodeId,DateTime? startDate, DateTime? endDate)
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileByAdminRole(string? accessToken, int? node, string? nodeId, string role, string? revisionId, int? reqNode, string? reqNodeId, DateTime? startDate, DateTime? endDate)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -556,6 +556,43 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileByAdminRolev2(string? accessToken, int? node, string? nodeId, string role, string? revisionId, int? reqNode, string? reqNodeId, DateTime? startDate, DateTime? endDate)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/dotnet/officer-by-admin-rolev2";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
var body = new
|
||||
{
|
||||
node = node,
|
||||
nodeId = nodeId,
|
||||
role = role,
|
||||
// revisionId = revisionId,
|
||||
reqNode = reqNode,
|
||||
reqNodeId = reqNodeId,
|
||||
// startDate = startDate,
|
||||
// endDate = endDate
|
||||
date = endDate
|
||||
};
|
||||
|
||||
var profiles = new List<SearchProfileDto>();
|
||||
|
||||
var apiResult = await PostExternalAPIAsync(apiPath, accessToken, body, apiKey);
|
||||
if (apiResult != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetListProfileByKeycloakIdRootResultDto>(apiResult);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllOfficerRetireFilterAndRevision(string? accessToken, int? node, string? nodeId, bool isAll, bool? isRetirement, string? revisionId)
|
||||
{
|
||||
try
|
||||
|
|
@ -688,7 +725,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetEmployeeByAdminRole(string? accessToken, int? node, string? nodeId, string role, string? revisionId, int? reqNode, string? reqNodeId,DateTime? startDate, DateTime? endDate)
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetEmployeeByAdminRole(string? accessToken, int? node, string? nodeId, string role, string? revisionId, int? reqNode, string? reqNodeId, DateTime? startDate, DateTime? endDate)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
LeaveTotal = data.LeaveTotal.ToString().ToThaiNumber(), //data.LeaveStartDate.DiffDay(data.LeaveEndDate).ToString().ToThaiNumber(),
|
||||
leaveAddress = data.LeaveAddress.ToThaiNumber(),
|
||||
leaveNumber = data.LeaveNumber.ToThaiNumber(),
|
||||
|
||||
|
||||
approve = approveResult,
|
||||
leaveStatus = data.LeaveStatus != null && data.LeaveStatus!.ToUpper() == "APPROVE"
|
||||
? "🗹 อนุญาต ☐ ไม่อนุญาต"
|
||||
|
|
@ -1658,7 +1658,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
if (type.Trim().ToUpper() == "OFFICER")
|
||||
{
|
||||
profile = await _userProfileRepository.GetProfileByAdminRole(AccessToken, profileAdmin?.Node, nodeId, role, req.revisionId, req.node, req.nodeId, req.StartDate.Date, req.EndDate.Date);
|
||||
profile = await _userProfileRepository.GetProfileByAdminRolev2(AccessToken, profileAdmin?.Node, nodeId, role, req.revisionId, req.node, req.nodeId, req.StartDate.Date, req.EndDate.Date);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1778,13 +1778,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
|
||||
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
|
||||
if(leaveRange != leaveRangeEnd)
|
||||
if (leaveRange != leaveRangeEnd)
|
||||
{
|
||||
if (leaveRangeEnd == "MORNING")
|
||||
remarkStr += " - ครึ่งวันเช้า";
|
||||
else if (leaveRangeEnd == "AFTERNOON")
|
||||
remarkStr += " - ครึ่งวันบ่าย";
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
remarkStr += leaveReq.Type.Name;
|
||||
|
|
@ -2114,13 +2114,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
// remarkStr += "ครึ่งวันบ่าย";
|
||||
|
||||
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
|
||||
if(leaveRange != leaveRangeEnd)
|
||||
if (leaveRange != leaveRangeEnd)
|
||||
{
|
||||
if (leaveRangeEnd == "MORNING")
|
||||
remarkStr += " - ครึ่งวันเช้า";
|
||||
else if (leaveRangeEnd == "AFTERNOON")
|
||||
remarkStr += " - ครึ่งวันบ่าย";
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
remarkStr += leaveReq.Type.Name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue