Merge branch 'develop'
* develop: leave v2
This commit is contained in:
commit
a7f76fe1a7
2 changed files with 46 additions and 9 deletions
|
|
@ -157,7 +157,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw;
|
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
|
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)
|
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllOfficerRetireFilterAndRevision(string? accessToken, int? node, string? nodeId, bool isAll, bool? isRetirement, string? revisionId)
|
||||||
{
|
{
|
||||||
try
|
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
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1658,7 +1658,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
|
|
||||||
if (type.Trim().ToUpper() == "OFFICER")
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1778,7 +1778,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
|
|
||||||
|
|
||||||
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
|
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
|
||||||
if(leaveRange != leaveRangeEnd)
|
if (leaveRange != leaveRangeEnd)
|
||||||
{
|
{
|
||||||
if (leaveRangeEnd == "MORNING")
|
if (leaveRangeEnd == "MORNING")
|
||||||
remarkStr += " - ครึ่งวันเช้า";
|
remarkStr += " - ครึ่งวันเช้า";
|
||||||
|
|
@ -2114,7 +2114,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
// remarkStr += "ครึ่งวันบ่าย";
|
// remarkStr += "ครึ่งวันบ่าย";
|
||||||
|
|
||||||
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
|
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
|
||||||
if(leaveRange != leaveRangeEnd)
|
if (leaveRange != leaveRangeEnd)
|
||||||
{
|
{
|
||||||
if (leaveRangeEnd == "MORNING")
|
if (leaveRangeEnd == "MORNING")
|
||||||
remarkStr += " - ครึ่งวันเช้า";
|
remarkStr += " - ครึ่งวันเช้า";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue