static void WorkerInfo(Args _args)
{
HcmWorkerPrimaryPosition hcmWorkerPrimaryPosition;
HcmPositionWorkerAssignment hcmPositionWorkerAssignment;
HcmPosition hcmPosition;
HcmPositionDetail hcmPositionDetail;
HcmPositionId positionId;
//
//OMOperatingUnit omOperatingUnit;
//OMInternalOrganization omInternalOrganization;
//DirOrganizationBase dirOrganizationBase;
//DirPartyTable dirPartyTable;
Name departmentName;
;
select hcmWorkerPrimaryPosition where hcmWorkerPrimaryPosition.Worker == 22565434487 ;
if(hcmWorkerPrimaryPosition)
{
positionId = HcmPosition::find(HcmPositionDetail::findByPosition(HcmPositionWorkerAssignment::find(HcmWorkerPrimaryPosition.PositionAssignment).Position).Position).PositionId;
departmentName = OMOperatingUnit::find(HcmPositionDetail::findByPosition(HcmPositionWorkerAssignment::find(HcmWorkerPrimaryPosition.PositionAssignment).Position).Department,OMOperatingUnitType::OMDepartment).Name;
}
else
{
while select hcmPositionWorkerAssignment where hcmPositionWorkerAssignment.Worker == 22565434487
{
select hcmPosition where hcmPosition.RecId == hcmPositionWorkerAssignment.Position
join hcmPositionDetail where hcmPositionDetail.Position == hcmPosition.RecId;
positionId = hcmPosition.PositionId;
departmentName = OMOperatingUnit::find(HcmPositionDetail::findByPosition(hcmPositionWorkerAssignment.Position).Department,OMOperatingUnitType::OMDepartment).Name;
}
}
info(strFmt('PositionId: %1', positionId));
info(strFmt('Department: %1', departmentName));
}
{
HcmWorkerPrimaryPosition hcmWorkerPrimaryPosition;
HcmPositionWorkerAssignment hcmPositionWorkerAssignment;
HcmPosition hcmPosition;
HcmPositionDetail hcmPositionDetail;
HcmPositionId positionId;
//
//OMOperatingUnit omOperatingUnit;
//OMInternalOrganization omInternalOrganization;
//DirOrganizationBase dirOrganizationBase;
//DirPartyTable dirPartyTable;
Name departmentName;
;
select hcmWorkerPrimaryPosition where hcmWorkerPrimaryPosition.Worker == 22565434487 ;
if(hcmWorkerPrimaryPosition)
{
positionId = HcmPosition::find(HcmPositionDetail::findByPosition(HcmPositionWorkerAssignment::find(HcmWorkerPrimaryPosition.PositionAssignment).Position).Position).PositionId;
departmentName = OMOperatingUnit::find(HcmPositionDetail::findByPosition(HcmPositionWorkerAssignment::find(HcmWorkerPrimaryPosition.PositionAssignment).Position).Department,OMOperatingUnitType::OMDepartment).Name;
}
else
{
while select hcmPositionWorkerAssignment where hcmPositionWorkerAssignment.Worker == 22565434487
{
select hcmPosition where hcmPosition.RecId == hcmPositionWorkerAssignment.Position
join hcmPositionDetail where hcmPositionDetail.Position == hcmPosition.RecId;
positionId = hcmPosition.PositionId;
departmentName = OMOperatingUnit::find(HcmPositionDetail::findByPosition(hcmPositionWorkerAssignment.Position).Department,OMOperatingUnitType::OMDepartment).Name;
}
}
info(strFmt('PositionId: %1', positionId));
info(strFmt('Department: %1', departmentName));
}
No comments:
Post a Comment