test parent

This commit is contained in:
kittapath 2025-10-12 16:51:51 +07:00
parent 84ab5e79d6
commit f97e643ac1
20 changed files with 155 additions and 264 deletions

View file

@ -1296,14 +1296,10 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
//var data = (await _userTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate))
var data = (await _userTimeStampRepository.GetTimeStampHistoryForAdminRoleAsync(startDate, endDate, role, nodeId, profileAdmin?.Node))
@ -1596,14 +1592,11 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
//var resultData = await _processUserTimeStampRepository.GetTimeStampHistoryForAdminAsync(startDate, endDate);
var resultData = await _processUserTimeStampRepository.GetTimeStampHistoryForAdminRoleAsync(startDate, endDate, role, nodeId, profileAdmin?.Node);
var data = new List<CheckInProcessHistoryForAdminDto>();
@ -2436,14 +2429,11 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
//var rawData = await _additionalCheckRequestRepository.GetAdditionalCheckRequests(year, month);
var rawData = await _additionalCheckRequestRepository.GetAdditionalCheckRequestsByAdminRole(year, month, role, nodeId, profileAdmin?.Node);

View file

@ -918,14 +918,10 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
if (type.Trim().ToUpper() == "OFFICER")
{
@ -1539,14 +1535,10 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
if (type.Trim().ToUpper() == "OFFICER")
{
@ -1869,14 +1861,10 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
if (type.Trim().ToUpper() == "OFFICER")
{
@ -2279,14 +2267,11 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
var userTimeStamps = await _processUserTimeStampRepository.GetTimestampByDateLateAsync(type.Trim().ToUpper(), role, nodeId, profileAdmin.Node, req.nodeId, req.node, req.StartDate, req.EndDate);
foreach (var p in userTimeStamps)
{
@ -2391,14 +2376,11 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByRootAndRange(req.StartDate, req.EndDate, type, jsonData["result"]?.ToString(), nodeId, profileAdmin?.Node, req.nodeId, req.node);
var enddate = req.EndDate.Date == req.StartDate.Date ? "" : $" - {req.EndDate.Date.ToThaiShortDate().ToThaiNumber()}";
var result = new

View file

@ -1635,14 +1635,10 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
var rawData = await _leaveRequestRepository.GetListLeaveRequestForAdminAsync(req.Year, req.Type, req.Status, req.StartDate, req.EndDate, role, nodeId, profileAdmin?.Node);
@ -1824,14 +1820,10 @@ namespace BMA.EHR.Leave.Service.Controllers
? profileAdmin?.RootDnaId
: "";
}
else if (role == "ROOT")
else if (role == "ROOT" && role == "PARENT")
{
nodeId = profileAdmin?.RootDnaId;
}
else if (role == "PARENT")
{
nodeId = profileAdmin?.Child1DnaId;
}
var rawData =
await _leaveRequestRepository.GetCancelLeaveRequestForAdminAsync(req.Year, req.Type, req.Status, role, nodeId, profileAdmin?.Node);