根据时间窗滚动查询变动的员工与多条任职信息
POST
/TenantBaseExternal/api/v5/Employee/GetListByTimeWindow
2.查询结果支持返回员工对应的多条任职记录,如需查询员工对应的单条任职记录,请使用【根据时间窗滚动查询变动的员工与单条任职信息GetByTimeWindow】接口
3.主要用于全量数据查询、一段时间内的增量数据查询
2.每批次数据量必须小于等于300
3.滚动查询有过期时间限制。两次滚动查询接口调用间隔不能超出10秒,超出间隔后,查不到下批次数据。故必须通过while循环查出全部数据后再处理具体业务。
4.滚动查询不能跳页,拿了第一页后要拿第三页,滚动查询不支持
5.滚动查询不能回跳,拿了第三页之后要跳回第二页,滚动查询不支持
6.使用滚动查询而非分页查询,是为了防止大批量获取数据时,深分页导致超时
7.自定义字段查询时,由于需要区分是员工信息还是任职记录的自定义字段,故会指定过滤掉不存在的自定义字段,而非校验提示
2.默认排序条件:若排序参数为空,则默认先按照UserID升序,然后按照创建时间降序
3.若删除状态不作为查询条件,默认为未删除
4.只支持查询审批生效的任职记录
5.累计工龄(WorkYearTotal)、累计集团工龄(WorkYearGroupTotal)、累计司龄(WorkYearCompanyTotal)非实时数据,而是每天定时任务刷新,故存在延迟情况
错误码示例
"data": null,
"code": "417",
"message": "只支持查询90天范围内的数据,请分段查询"
}
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://openapi.italent.cn/TenantBaseExternal/api/v5/Employee/GetListByTimeWindow' \
--header 'Content-Type: application/json' \
--data-raw '//示例请求参数
{
"empStatus": [1,2,3,4,5,6,8,12],
"employType": [0,1,2],
"serviceType":[0,1],
"timeWindowQueryType":1,//时间窗查询类型
"startTime":"2021-01-01",//时间范围开始时间
"stopTime":"2021-03-21",//时间范围结束时间
"capacity":100,//每批次数目
"columns":["Name","Email","EmployType"],//查询列
"extQueries": [//自定义字段查询条件
{
"fieldName": "extExtQueryFloat_127666_832132060",
"queryType": 5,//等于
"values": [
"1"
]
},
{
"fieldName": "extExtQueryText_127666_1870946722",
"queryType": 6,//不等于
"values": [
"文本1"
]
},
{
"fieldName": "extExtQueryInt_127666_637453549",
"queryType": 7,//区间
"values": [
"1",
"1000"
],
"includeLowerValue": true,//包含最小值
"includeUpperValue": false//不包含最大值
}
],
"isWithDeleted": false,
"enableTranslate": true,//开启数据源自动翻译功能
"sort":{"Name":1},//排序
"scrollId":"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAVrsaUWdnVycEd3OEFRRm02aEpHRFZQZ2htdw=="//本批次的ScrollId
}
------------------------------------------------------
//do-while调用Scroll接口示例
var allData = new List<XXXQueryV5ResultDTO>();//用于保存全部数据
string scrollId = null;//下批次滚动ID
bool isOver;//是否完成
int totalCount = 0;//数据总数
do
{
//请求参数,注意:scrollId参数,第一次是空,后续为上次结果返回的ScrollId
XXXTimeWindowScrollQueryV5Args args = new XXXTimeWindowScrollQueryV5Args
(
DateTime.Now.AddMonths(-1).Date,//时间范围开始时间
DateTime.Now.Date,//时间范围结束时间
scrollId,//本批次的ScrollId,第一次查询为空,后续为上次结果返回的ScrollId
100 //每批次数目
);
//调用API,注意判断响应结果是否成功后再处理
var result = provider.GetByTimeWindow(args);
if(result!=“200”)
break;//调用接口失败,需要记录错误日志信息便于后续排查
isOver = result.IsLastData;//是否结束
scrollId = result.ScrollId;//注意:scrollId赋值后供下次循环使用
if (result.Data.Count>0)
allData.AddRange(result.Data);
if (totalCount == 0)
totalCount = result.Total;
}
while (isOver != true);'
响应示例响应示例
{
"scrollId": "string",
"isLastData": true,
"total": 0,
"data": [
{
"employeeInfo": {
"userID": 0,
"name": "string",
"_Name": "string",
"gender": 0,
"email": "string",
"iDType": "string",
"iDNumber": "string",
"birthday": "2019-08-24T14:15:22Z",
"workDate": "2019-08-24T14:15:22Z",
"homeAddress": "string",
"mobilePhone": "string",
"weiXin": "string",
"iDPhoto": "string",
"personalHomepage": "string",
"speciality": "string",
"major": "string",
"postalCode": "string",
"passportNumber": "string",
"constellation": "string",
"bloodType": "string",
"residenceAddress": "string",
"joinPartyDate": "2019-08-24T14:15:22Z",
"domicileType": 0,
"emergencyContact": "string",
"emergencyContactRelationship": "string",
"emergencyContactPhone": "string",
"qQ": "string",
"aboutMe": "string",
"homePhone": "string",
"graduateDate": "2019-08-24T14:15:22Z",
"marryCategory": "string",
"politicalStatus": "string",
"nationality": 0,
"nation": "string",
"birthplace": "string",
"registAddress": "string",
"educationLevel": "string",
"lastSchool": "string",
"engName": "string",
"officeTel": "string",
"businessAddress": "string",
"backupMail": "string",
"applicantId": 0,
"age": 0,
"businessModifiedBy": 0,
"businessModifiedTime": "2019-08-24T14:15:22Z",
"sourceType": 0,
"objectId": "string",
"customProperties": {
"property1": {},
"property2": {}
},
"translateProperties": {
"property1": "string",
"property2": "string"
},
"createdBy": 0,
"createdTime": "2019-08-24T14:15:22Z",
"modifiedBy": 0,
"modifiedTime": "2019-08-24T14:15:22Z",
"stdIsDeleted": true
},
"recordInfoList": [
{
"userID": 0,
"pObjectDataID": "string",
"oIdDepartment": 0,
"startDate": "2019-08-24T14:15:22Z",
"stopDate": "2019-08-24T14:15:22Z",
"jobNumber": "string",
"entryDate": "2019-08-24T14:15:22Z",
"lastWorkDate": "2019-08-24T14:15:22Z",
"regularizationDate": "2019-08-24T14:15:22Z",
"probation": 0,
"order": 0,
"employType": 0,
"serviceType": 0,
"serviceStatus": 0,
"approvalStatus": 0,
"employmentSource": "string",
"employmentForm": "string",
"isCharge": "string",
"oIdJobPost": "string",
"oIdJobSequence": "string",
"oIdJobPosition": "string",
"oIdJobLevel": "string",
"oidJobGrade": "string",
"place": "string",
"employeeStatus": "string",
"employmentType": "string",
"employmentChangeID": "string",
"changedStatus": "string",
"pOIdEmpAdmin": 0,
"pOIdEmpReserve2": 0,
"businessTypeOID": "string",
"changeTypeOID": "string",
"workYearBefore": 0,
"workYearGroupBefore": 0,
"workYearCompanyBefore": 0,
"workYearTotal": 0,
"workYearGroupTotal": 0,
"workYearCompanyTotal": 0,
"oIdOrganization": 0,
"whereabouts": "string",
"blackStaffDesc": "string",
"blackListAddReason": "string",
"transitionTypeOID": "string",
"changeReason": "string",
"probationResult": "string",
"probationActualStopDate": "2019-08-24T14:15:22Z",
"probationStartDate": "2019-08-24T14:15:22Z",
"probationStopDate": "2019-08-24T14:15:22Z",
"isHaveProbation": "string",
"remarks": "string",
"addOrNotBlackList": true,
"businessModifiedBy": 0,
"businessModifiedTime": "2019-08-24T14:15:22Z",
"objectId": "string",
"customProperties": {
"property1": {},
"property2": {}
},
"translateProperties": {
"property1": "string",
"property2": "string"
},
"createdBy": 0,
"createdTime": "2019-08-24T14:15:22Z",
"modifiedBy": 0,
"modifiedTime": "2019-08-24T14:15:22Z",
"stdIsDeleted": true
}
]
}
],
"code": "string",
"message": "string"
}
请求参数
Body 参数application/json
返回响应
修改于 超过 3 年前