get report by node
This commit is contained in:
parent
b532eefa61
commit
8813668b43
3 changed files with 11 additions and 9 deletions
|
|
@ -243,7 +243,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllOfficer(string? accessToken, string? node, string? nodeId)
|
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllOfficer(string? accessToken, int? node, string? nodeId, bool isAll)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -253,6 +253,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
{
|
{
|
||||||
node = node,
|
node = node,
|
||||||
nodeId = nodeId,
|
nodeId = nodeId,
|
||||||
|
isAll = isAll,
|
||||||
};
|
};
|
||||||
|
|
||||||
var profiles = new List<SearchProfileDto>();
|
var profiles = new List<SearchProfileDto>();
|
||||||
|
|
@ -273,7 +274,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllEmployee(string? accessToken, string? node, string? nodeId)
|
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllEmployee(string? accessToken, int? node, string? nodeId, bool isAll)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -283,6 +284,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
{
|
{
|
||||||
node = node,
|
node = node,
|
||||||
nodeId = nodeId,
|
nodeId = nodeId,
|
||||||
|
isAll = isAll,
|
||||||
};
|
};
|
||||||
|
|
||||||
var profiles = new List<SearchProfileDto>();
|
var profiles = new List<SearchProfileDto>();
|
||||||
|
|
|
||||||
|
|
@ -757,11 +757,11 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
var profile = new List<GetProfileByKeycloakIdRootDto>();
|
var profile = new List<GetProfileByKeycloakIdRootDto>();
|
||||||
if (type.Trim().ToUpper() == "OFFICER")
|
if (type.Trim().ToUpper() == "OFFICER")
|
||||||
{
|
{
|
||||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId);
|
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId);
|
profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||||
}
|
}
|
||||||
// get leave day
|
// get leave day
|
||||||
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByTypeAndRange(req.StartDate, req.EndDate);
|
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByTypeAndRange(req.StartDate, req.EndDate);
|
||||||
|
|
@ -950,11 +950,11 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
var profile = new List<GetProfileByKeycloakIdRootDto>();
|
var profile = new List<GetProfileByKeycloakIdRootDto>();
|
||||||
if (type.Trim().ToUpper() == "OFFICER")
|
if (type.Trim().ToUpper() == "OFFICER")
|
||||||
{
|
{
|
||||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId);
|
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId);
|
profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||||
}
|
}
|
||||||
var date = req.StartDate.Date;
|
var date = req.StartDate.Date;
|
||||||
|
|
||||||
|
|
@ -1273,6 +1273,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||||
}
|
}
|
||||||
|
Console.WriteLine(jsonData["result"]);
|
||||||
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByRootAndRange(req.StartDate, req.EndDate, type);
|
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByRootAndRange(req.StartDate, req.EndDate, type);
|
||||||
var enddate = req.EndDate.Date == req.StartDate.Date ? "" : $" - {req.EndDate.Date.ToThaiShortDate().ToThaiNumber()}";
|
var enddate = req.EndDate.Date == req.StartDate.Date ? "" : $" - {req.EndDate.Date.ToThaiShortDate().ToThaiNumber()}";
|
||||||
var result = new
|
var result = new
|
||||||
|
|
@ -1281,8 +1282,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
reportName = "LeaveHalfYear-Officer",
|
reportName = "LeaveHalfYear-Officer",
|
||||||
data = new
|
data = new
|
||||||
{
|
{
|
||||||
leaveDateStart = $"ณ วันที่ {req.StartDate.Date.ToThaiShortDate().ToThaiNumber()}{enddate}",
|
dateTimeStamp = $"ณ วันที่ {req.StartDate.Date.ToThaiShortDate().ToThaiNumber()}{enddate}",
|
||||||
leaveDateEnd = req.EndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
|
||||||
employees = leaveDays
|
employees = leaveDays
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace BMA.EHR.Leave.Service.DTOs.Reports
|
||||||
public DateTime StartDate { get; set; } = DateTime.MinValue;
|
public DateTime StartDate { get; set; } = DateTime.MinValue;
|
||||||
public DateTime EndDate { get; set; } = DateTime.MinValue;
|
public DateTime EndDate { get; set; } = DateTime.MinValue;
|
||||||
public string? Type { get; set; } = string.Empty;
|
public string? Type { get; set; } = string.Empty;
|
||||||
public string? node { get; set; } = string.Empty;
|
public int? node { get; set; }
|
||||||
public string? nodeId { get; set; } = string.Empty;
|
public string? nodeId { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue