查询设备关联的任务&子任务列表(API名称:getSceneTaskList)
功能介绍
用于用户系统查询设备关联的任务、子任务列表
相关接口
接口名称 |
调用说明 |
---|---|
调用该接口获取到Token,再调用其他接口时,需要在请求消息头中添加“Authorization”,其值即为Token。 |
URL
请求方式 |
HTTPS地址 |
服务架构 |
消息体类型 |
---|---|---|---|
POST |
https://isdp+域名/openapi/v1/openSceneTaskObject/getSceneTaskList |
OpenAPI |
application/json |
请求头
KEY |
VALUE |
是否必填 |
描述 |
---|---|---|---|
Content-Type |
application/json |
是 |
无 |
Authorization |
bearer ${access_token} |
是 |
bearer +“ ”+5.2.1中获取的access_token的值 |
请求参数
参数 |
类型 |
是否必填 |
描述 |
---|---|---|---|
page.start |
int |
是 |
分页起始行 |
page.count |
int |
是 |
分页大小 |
queryType |
int |
是 |
查询类型(1:查询巡检计划列表;2:查询巡检历史列表) |
status |
String |
否 |
任务、子任务状态(仅支持1:待执行;2:执行中;3:已完成状态。)多个任务状态用英文逗号隔开; |
orderType |
int |
否 |
排序(1:升序;2:降序。如果queryType为1,按照计划完成时间升、降序排,queryType为2,按照实际完成时间升降序排),为空则按照升序排 |
timeRangeList |
List<Long> |
否 |
计划完成、实际完成过滤范围,设置开始、结束时间的毫秒数 |
sourceObjectIdList |
List<String> |
是 |
设备id集合,单次请求最多100个 |
响应参数
参数 |
类型 |
描述 |
---|---|---|
stateCode |
String |
接口响应编码,0成功,非0失败 |
errorMessage |
String |
接口错误提示信息 |
result |
Map |
接口响应数据。 |
result出参:
参数 |
类型 |
描述 |
---|---|---|
result.data |
List<Map<String,Object>> |
任务、子任务列表 |
data.taskName |
String |
任务、子任务名称 |
data. taskType |
int |
1:任务;2:子任务 |
data. sceneTaskId |
Long |
任务、子任务主键id |
data. sceneMode |
int |
任务模式 |
data.isNa |
int |
是否子任务na |
data.status |
int |
任务、子任务状态(1:待执行;2:执行中;3:已完成) |
data.endTimestamp |
Long |
任务、子任务计划完成时间,毫秒数 |
data.parentCategory |
String |
领域 |
data.sceneName |
String |
场景 |
data. adminOrganization |
String |
组织单元 |
data.actualEndTime |
Long |
实际完成时间,毫秒数 |
data.executorList |
List<Map<String,Object>> |
执行人 |
data.executorList.userId |
Long |
执行人ID |
data.executorList.userName |
String |
执行人名称 |
data.executorList.userType |
int |
执行人类型1:个人;2:群组 |
data.executorList.sceneTaskId |
Long |
执行人关联的任务、子任务ID |
data.totalCount |
int |
进展任务总数 |
data.finishCount |
int |
进展完成任务数 |
data.isExpire |
String |
是否逾期0:未逾期;1:逾期 |
pos |
int |
当前查询起始行 |
total_count |
int |
任务总数 |
entityName |
String |
实体名称 |
totalCount |
int |
任务总数 |
请求示例
{ "page": { "count": 15, "start": 0 }, "queryType": 1, "sourceObjectIdList": [ "H06041--1" ] }
响应示例
{ "stateCode": "0", "errorMessage": null, "result": { "data": [ { "taskName": "1_20220908_144225", "taskType": 2, "sceneTaskId": 1919494, "sceneMode": 4, "isNa": 0, "status": 1, "endTimestamp": null, "parentTaskId": 2949685, "parentCategory": "", "sceneName": "", "adminOrganization": "", "actualEndTime": null, "executorList": [ { "userId": 153169, "userName": "lyl09修改", "userType": 1, "sceneTaskId": 1919494 } ], "totalCount": 1, "finishCount": 0, "isExpire": 0 }, { "taskName": "2_20220908_144225", "taskType": 2, "sceneTaskId": 1919495, "sceneMode": 4, "isNa": 0, "status": 1, "endTimestamp": null, "parentTaskId": 2949685, "parentCategory": "", "sceneName": "", "adminOrganization": "", "actualEndTime": null, "executorList": [ { "userId": 153169, "userName": "lyl09修改", "userType": 1, "sceneTaskId": 1919495 } ], "totalCount": 1, "finishCount": 0, "isExpire": 0 }, { "taskName": "1_20220908_144443", "taskType": 2, "sceneTaskId": 1919498, "sceneMode": 4, "isNa": 0, "status": 1, "endTimestamp": null, "parentTaskId": 2949686, "parentCategory": "", "sceneName": "", "adminOrganization": "", "actualEndTime": null, "executorList": [ { "userId": 153169, "userName": "lyl09修改", "userType": 1, "sceneTaskId": 1919498 } ], "totalCount": 1, "finishCount": 0, "isExpire": 0 }, { "taskName": "1_20220909_151311", "taskType": 2, "sceneTaskId": 1919657, "sceneMode": 4, "isNa": 0, "status": 1, "endTimestamp": null, "parentTaskId": 2951381, "parentCategory": "", "sceneName": "", "adminOrganization": "", "actualEndTime": null, "executorList": [ { "userId": 153169, "userName": "lyl09修改", "userType": 1, "sceneTaskId": 1919657 } ], "totalCount": 1, "finishCount": 0, "isExpire": 0 }, { "taskName": "子任务1_20220914_142712", "taskType": 2, "sceneTaskId": 1920826, "sceneMode": 4, "isNa": 0, "status": 1, "endTimestamp": 1663136980000, "parentTaskId": 2955633, "parentCategory": "", "sceneName": "", "adminOrganization": "", "actualEndTime": null, "executorList": [ { "userId": 25804, "userName": "刘月", "userType": 1, "sceneTaskId": 1920826 } ], "totalCount": 1, "finishCount": 0, "isExpire": 1 }, { "taskName": "14:40_20220908_144225", "taskType": 1, "sceneTaskId": 2949685, "sceneMode": 4, "isNa": 0, "status": 1, "endTimestamp": null, "parentTaskId": 0, "parentCategory": "", "sceneName": "14:40", "adminOrganization": "杨凌作业系统测试№", "actualEndTime": null, "executorList": [ { "userId": 153169, "userName": "lyl09修改", "userType": 1, "sceneTaskId": 2949685 } ], "totalCount": 2, "finishCount": 0, "isExpire": 0 }, { "taskName": "测试计划结束", "taskType": 1, "sceneTaskId": 2955633, "sceneMode": 4, "isNa": 0, "status": 1, "endTimestamp": 1663136980000, "parentTaskId": 0, "parentCategory": "", "sceneName": "测试统计计划结束时间", "adminOrganization": "杨凌作业系统测试№", "actualEndTime": null, "executorList": [ { "userId": 25804, "userName": "刘月", "userType": 1, "sceneTaskId": 2955633 } ], "totalCount": 1, "finishCount": 0, "isExpire": 1 } ], "pos": 0, "total_count": 7, "entityName": null, "totalCount": 7 } }
状态码
状态码请参见状态码。
错误码
错误码请参见错误码。