This commit is contained in:
parent
4382e779d7
commit
ae3d5dab70
2 changed files with 19 additions and 19 deletions
|
|
@ -1554,27 +1554,27 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
|
||||
// เพิ่มเติมการดึงคนตามสิทธิ์แบบที่ bright ทำ #1462
|
||||
var profileList = new List<GetProfileByKeycloakIdRootDto>();
|
||||
if (req.ProfileType.Trim().ToUpper() == "OFFICER")
|
||||
{
|
||||
//// เพิ่มเติมการดึงคนตามสิทธิ์แบบที่ bright ทำ #1462
|
||||
//var profileList = new List<GetProfileByKeycloakIdRootDto>();
|
||||
//if (req.ProfileType.Trim().ToUpper() == "OFFICER")
|
||||
//{
|
||||
|
||||
profileList = await _userProfileRepository.GetProfileWithNoneValidateKeycloakAllOfficerAndRevision(AccessToken, req.Node, req.NodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.RevisionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// profileList = await _userProfileRepository.GetProfileWithNoneValidateKeycloakAllOfficerAndRevision(AccessToken, req.Node, req.NodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.RevisionId);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
|
||||
profileList = await _userProfileRepository.GetProfileWithNoneValidateKeycloakAllEmployeeAndRevision(AccessToken, req.Node, req.NodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.RevisionId);
|
||||
}
|
||||
// profileList = await _userProfileRepository.GetProfileWithNoneValidateKeycloakAllEmployeeAndRevision(AccessToken, req.Node, req.NodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.RevisionId);
|
||||
//}
|
||||
|
||||
var keycloakList = new List<Guid>();
|
||||
if(profileList != null)
|
||||
{
|
||||
keycloakList = profileList.Where(x => x.Keycloak != null).Select(x => x.Keycloak!.Value).ToList();
|
||||
}
|
||||
|
||||
var rawData = await _leaveRequestRepository.GetLeaveRequestForAdminWithAuthAsync(req.Year, req.Type, req.Status, req.StartDate, req.EndDate, keycloakList);
|
||||
//var keycloakList = new List<Guid>();
|
||||
//if(profileList != null)
|
||||
//{
|
||||
// keycloakList = profileList.Where(x => x.Keycloak != null).Select(x => x.Keycloak!.Value).ToList();
|
||||
//}
|
||||
|
||||
//var rawData = await _leaveRequestRepository.GetLeaveRequestForAdminWithAuthAsync(req.Year, req.Type, req.Status, req.StartDate, req.EndDate, keycloakList);
|
||||
var rawData = await _leaveRequestRepository.GetLeaveRequestForAdminAsync(req.Year, req.Type, req.Status, req.StartDate, req.EndDate);
|
||||
var result = new List<GetLeaveRequestForAdminResultDto>();
|
||||
|
||||
foreach (var item in rawData)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest
|
|||
|
||||
public string ProfileType { get; set; } = string.Empty;
|
||||
|
||||
public string NodeId { get; set; } = string.Empty;
|
||||
public string? NodeId { get; set; } = string.Empty;
|
||||
|
||||
public int Node { get; set; }
|
||||
public int? Node { get; set; }
|
||||
|
||||
public string? RevisionId { get; set; } = string.Empty;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue