Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return Promise.all([
- UB.Repository('hr_employee')
- .attrs(['datName', 'shortFIO', 'sexType', 'firstName', 'middleName', 'lastName'])
- .selectById(employeeID),
- employeeNumberRs.selectSingle()
- ]).then(([employee, employeeNumber]) => (
- Promise.all([
- UB.Repository('hr_employeePosition')
- .attrs(['departmentID', 'positionID', 'employeeID'])
- .where('dateFrom', '<=', pDate)
- .where('dateTo', '>=', pDate)
- .where('employeeNumberID', '=', (employeeNumber ? employeeNumber.ID : 0))
- .selectSingle()
- ]).then(([employeePosition]) => (
- Promise.all([
- UB.Repository('hr_position')
- .attrs(['nameGen', 'name', 'positionType', 'psCategory.shortName', 'dictStatePayID'])
- .where('mi_data_id', '=', employeePosition ? employeePosition.positionID : 0)
- .where('state', '=', 'ACTIVE')
- .misc({ __mip_ondate: pDate })
- .selectSingle(),
- UB.Repository('hr_publServRang')
- .attrs(['dictRankID.code'])
- .where('employeeID', '=', (employeePosition ? employeePosition.employeeID : 0))
- .where('dateFrom', '<=', pDate)
- .where('dateTo', '>=', pDate)
- .selectSingle()
- ]).then(([ position, servRank ]) => (
- Promise.all([
- UB.Repository('hr_dictStatePay')
- .attrs(['groupN'])
- .selectById((position && position.dictStatePayID) || 0)
- ]).then(([statePay]) => ({
- employee,
- employeeNumber,
- employeePosition,
- position,
- servRank,
- statePay,
- respPosInfo,
- orgToName,
- reportViewCode
- }))
- ))
- ))
- ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement