文档首页/ ISDP/ API参考/ API接口/ 任务管理/ 任务进展管理/ 批量创建父子任务(API名称:batchCreateSubTaskList)
更新时间:2024-07-22 GMT+08:00
分享

批量创建父子任务(API名称:batchCreateSubTaskList)

功能介绍

用于批量创建父子任务

相关接口

接口名称

调用说明

获取Token

调用该接口获取到Token,再调用其他接口时,需要在请求消息头中添加“Authorization”,其值即为Token。

查询父任务

新增后可以查询是否新增成功

请求头

KEY

VALUE

是否必填

描述

Content-Type

application/json

Authorization

bearer ${access_token}

bearer +“ ”+5.2.1中获取的access_token的值

URL

请求方式

HTTPS地址

服务架构

消息体类型

POST

https://isdp+域名/openapi/v1/openSceneTask/batchCreateSubTaskList

OpenAPI

application/json

请求参数

参数

类型

是否必填

描述

taskQueries

List

入参

taskQueries入参(注意:任务的基础字段是由场景配置的,最大批量创建10个父子任务)

参数

类型

是否必填

描述

customerTaskId

String

客户任务ID

creatorAccount

String

创建人账号(isdp+中存在的人员账号)

taskName

String

父任务名称

signSiteName

String

作业对象名称

sceneName

String

场景名称,取最新版本

projectNo

String

项目编码

assignedUserType

Integer

执行人类型:1-执行人;2-群组

assignedUser

String

执行人(如果是执行人,则传执行人账号,多个用“;”隔开;如果是群组,传群组名称,只能单个)

supplierName

String

供应商名称

reviewRuleName

Long

任务申请审批流名称,需要审批时为必填

collectionReviewName

Long

检查单采集审批流名称,需要审批时为必填(只有挂检查单的场景才有)

beginTimestamp

Long

计划开始时间时间戳

endTimestamp

Long

计划完成时间时间戳

taskRemark

String

任务描述

administrativeDivisionName

String

行政区域

priority

String

优先级

jobDuration

Integer

标准作业时长

projectDuration

Integer

工期

schedulingMode

String

调度模式

address

String

任务地址(最多1000个字符)

requiredStartTime

Long

要求开始时间

requiredEndTime

Long

要求结束时间

skill

Stirng

技能

customerName

String

客户名称

geoType

String

父任务经纬度类型(值只能为BD或者为空)

longitude

String

父任务经度信息

latitude

String

父任务纬度信息

geoType

String

子任务经纬度类型(值只能为BD或者为空)

longitude

String

子任务经度信息

latitude

String

子任务纬度信息

subTaskList

List<Object>

子任务列表,场景配置了多少子任务,这里就要填写多少个,否则会报错

taskExtendList

List<Object>

拓展属性列表

saveDraft

String

保存/提交 0:保存草稿 1:提交

isCustomerTaskIdDuplicate

String

是否允许客户任务ID重复,Y:允许 N:不允许重复为空或默认为N

preTaskList

List

子任务前后置关系

subTaskList列表入参:

参数

类型

是否必填

描述

modeOrder

Int

序号,从1开始,对应场景配置的序号

taskName

String

子任务名称,以入参为准,入参为空则取场景的名称

signSiteName

String

作业对象名称

assignedUserType

Integer

执行人类型:1-执行人;2-群组

assignedUser

String

执行人(如果是执行人,则传执行人账号,多个用“;”隔开;如果是群组,传群组名称,只能单个,如果入参是空,则取场景里的值)

collectionReviewName

String

采集审批流名称,优先取场景里配置的名称,如果没有再取入参的名称

beginTimestamp

Long

计划开始时间时间戳

endTimestamp

Long

计划完成时间时间戳

taskRemark

String

任务描述

administrativeDivisionName

String

行政区域

priority

String

优先级

jobDuration

Integer

标准作业时长

projectDuration

Integer

工期

address

String

任务地址(最多1000个字符)

requiredStartTime

Long

要求开始时间

requiredEndTime

Long

要求结束时间

skill

Stirng

技能

taskExtendList

List<Object>

子任务拓展属性列表

procedureList

List<Object>

工序列表,这里只可以给对应的工序配置采集审批流。

taskExtendList列表入参(父子任务的入参一样):

参数

类型

是否必填

描述

fieldName

String

拓展属性字段名称

extendValue

String

拓展属性值(如果是时间和日期,值必须是时间戳)

stage

Integer

任务扩展属性阶段:1创建阶段 2执行阶段 不填写默认为创建阶段(与场景中的扩展属性阶段匹配)

procedureList列表入参:

参数

类型

是否必填

描述

modeOrder

Int

序号,从1开始,对应场景配置的序号

collectionReviewName

Long

检查单采集审批流名称,需要审批时为必填(只有挂检查单的场景才有)

preTaskList子任务前后置关系每个Object字段说明

参数

类型

是否必填

描述

isEnabledScenePre

String

是否继承场景前后置关系 Y:从场景获取,不取接口参数 N :不从场景获取,只取接口入参为准;默认Y,从场景集成

preTaskName

String

前置任务名称

preTaskLocation

String

前置任务位置信息

taskPreName

String

后置任务名称

taskPreLocation

String

后置任务位置

preType

String

前置后置关系

preTaskLocation参数说明:

参数

类型

是否必填

描述

x

int

  1. 无现成子任务关系,则初始值赋 X=50 Y=50
  2. 后置子任务,则在当前子任务基础上赋值:X不变,Y增加250
  3. 兄弟子任务,则在当前子任务基础上赋值:X增加150,Y不变

y

int

taskPreLocation参数说明:

参数

类型

是否必填

描述

x

int

  1. 无现成子任务关系,则初始值赋 X=50 Y=50
  2. 后置子任务,则在当前子任务基础上赋值:X不变,Y增加250
  3. 兄弟子任务,则在当前子任务基础上赋值:X增加150,Y不变

y

int

响应参数

参数

类型

描述

stateCode

String

响应状态码:0-成功;其他-失败

errorMessage

String

响应描述

result

Object

响应结果内容data、分页数据

data出参:

参数

类型

描述

customerTaskId

String

客户任务ID

taskId

Long

创建成功的任务id

status

Integer

返回状态:0-成功;1-失败

message

String

返回的失败消息。

请求示例

{
    "taskQueries": [
        {
            "supplierName": "",
            "taskRemark": "",
            "beginTimestamp": "",
            "collectionReviewName": "",
            "sceneName": "zhang子任务前后置关系_串行",
            "latitude": "",
            "signSiteName": "",
            "isCustomerTaskIdDuplicate": "Y",
            "customerTaskId": "QA2233",
            "projectNo": "",
            "assignedUserType": "1",
            "geoType": "",
            "reviewRuleName": "",
            "taskName": "openapi_批量创建zhang子任务前后置关系_串行02",
            "assignedUser": "Zhang123456",
            "endTimestamp": "",
            "saveDraft": 1,
            "taskExtendList": [],
            "longitude": "",
            "isEnabledScenePre": "Y",
            "preTaskList": [],
            "subTaskList": [
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 1,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                },
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 2,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                },
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 3,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                }
            ]
        },
        {
            "supplierName": "",
            "taskRemark": "",
            "beginTimestamp": "",
            "collectionReviewName": "",
            "sceneName": "zhang子任务无配置关系",
            "latitude": "",
            "signSiteName": "",
            "isCustomerTaskIdDuplicate": "Y",
            "customerTaskId": "QA2414",
            "projectNo": "",
            "assignedUserType": "1",
            "geoType": "",
            "reviewRuleName": "",
            "taskName": "openapi_批量创建zhang子任务无配置关系02",
            "assignedUser": "Zhang123456",
            "endTimestamp": "",
            "taskExtendList": [],
            "longitude": "",
            "saveDraft": 0,
            "isEnabledScenePre": "N",
            "preTaskList": [
                {
                    "preTaskName": "子任务11",
                    "preTaskLocation": "{\"x\":700,\"y\":70}",
                    "taskPreName": "子任务22",
                    "taskPreLocation": "{\"x\":700,\"y\":190}",
                    "preType": "FS"
                },
                {
                    "preTaskName": "子任务11",
                    "preTaskLocation": "{\"x\":700,\"y\":70}",
                    "taskPreName": "子任务33",
                    "taskPreLocation": "{\"x\":700,\"y\":340}",
                    "preType": "FS"
                }
            ],
            "subTaskList": [
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 1,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                },
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 2,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                },
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 3,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                }
            ]
        },
        {
            "supplierName": "",
            "taskRemark": "",
            "beginTimestamp": "",
            "collectionReviewName": "",
            "sceneName": "zhang4个子任务_有一个无配置关系",
            "latitude": "",
            "signSiteName": "",
            "isCustomerTaskIdDuplicate": "Y",
            "customerTaskId": "20qe333",
            "projectNo": "",
            "assignedUserType": "1",
            "geoType": "",
            "reviewRuleName": "",
            "taskName": "openapi_批量创建zhang4个子任务_有一个无配置关系02",
            "assignedUser": "Zhang123456",
            "endTimestamp": "",
            "saveDraft": 0,
            "taskExtendList": [],
            "longitude": "",
            "isEnabledScenePre": "N",
            "preTaskList": [
                {
                    "preTaskName": "子任务11",
                    "preTaskLocation": "{\"x\":700,\"y\":70}",
                    "taskPreName": "子任务22",
                    "taskPreLocation": "{\"x\":700,\"y\":190}",
                    "preType": "FS"
                },
                {
                    "preTaskName": "子任务11",
                    "preTaskLocation": "{\"x\":700,\"y\":70}",
                    "taskPreName": "子任务33",
                    "taskPreLocation": "{\"x\":700,\"y\":340}",
                    "preType": "FS"
                },
                {
                    "preTaskName": "子任务44",
                    "preTaskLocation": "{\"x\":700,\"y\":340}",
                    "taskPreName": "子任务22",
                    "taskPreLocation": "{\"x\":100,\"y\":70}",
                    "preType": "FS"
                }
            ],
            "subTaskList": [
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 1,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                },
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 2,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                },
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 3,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                },
                {
                    "taskExtendList": [],
                    "signSiteName": "",
                    "modeOrder": 4,
                    "projectNo": "",
                    "assignedUserType": 1,
                    "assignedUser": "Zhang123456",
                    "ccPersonType": 4,
                    "ccPerson": "",
                    "ownerType": 5,
                    "owner": "",
                    "supplierName": "",
                    "reviewRuleName": "",
                    "beginTimestamp": "",
                    "endTimestamp": "",
                    "requiredStartTime": "",
                    "longitude": "",
                    "latitude": "",
                    "geoType": "",
                    "requiredEndTime": "",
                    "taskRemark": "",
                    "collectionReviewName": "",
                    "priority": "",
                    "jobDuration": "",
                    "projectDuration": "",
                    "schedulingMode": "",
                    "administrativeDivisionName": "",
                    "address": "",
                    "skill": "",
                    "customerName": "",
                    "procedureList": []
                }
            ]
        }
    ]
}

响应示例

{
    "stateCode": "0",
    "errorMessage": null,
    "result": [
        {
            "reviewRuleId": null,
            "subTaskOrNot": 1,
            "submitBy": 864711,
            "licenseSwitch": null,
            "lastUpdateDate": "2023-04-04 16:42:02",
            "submitDate": 1680597722422,
            "schedulerBy": -1,
            "deleteFlag": 0,
            "lastUpdateTimestamp": 1680597722422,
            "entityName": "SceneTask",
            "isApplyApprove": 0,
            "reviewRuleName": "",
            "creationTimestamp": 1680597722422,
            "schedulerName": "OpenApi",
            "sceneMode": 4,
            "lastUpdatedBy": 864711,
            "operationTimestamp": 1680597722422,
            "address": null,
            "appName": "isdp-task-server",
            "errorMessage": null,
            "creationDate": "2023-04-04 16:42:02",
            "customerTaskId": "QA2233",
            "submitName": "zhang_sit",
            "sceneTaskId": 3245536,
            "signInConfig": null,
            "createdBy": 864711,
            "schedulerTimestamp": 1680597722422,
            "affectedRows": 1,
            "procedureOrNot": 0,
            "tenantId": 886,
            "stateCode": "0",
            "lastUpdateName": "zhang_sit",
            "ticketId": 0,
            "createName": "zhang_sit",
            "schedulerDate": "2023-04-04 16:42:02",
            "status": 1
        },
        {
            "reviewRuleId": null,
            "subTaskOrNot": 1,
            "submitBy": 864711,
            "licenseSwitch": null,
            "lastUpdateDate": "2023-04-04 16:42:02",
            "submitDate": 1680597722408,
            "schedulerBy": -1,
            "deleteFlag": 0,
            "lastUpdateTimestamp": 1680597722408,
            "entityName": "SceneTask",
            "isApplyApprove": 0,
            "reviewRuleName": "",
            "creationTimestamp": 1680597722408,
            "schedulerName": "OpenApi",
            "sceneMode": 4,
            "lastUpdatedBy": 864711,
            "operationTimestamp": 1680597722408,
            "address": null,
            "appName": "isdp-task-server",
            "errorMessage": null,
            "creationDate": "2023-04-04 16:42:02",
            "customerTaskId": "QA2414",
            "submitName": "zhang_sit",
            "sceneTaskId": 3245534,
            "signInConfig": null,
            "createdBy": 864711,
            "schedulerTimestamp": 1680597722408,
            "affectedRows": 1,
            "procedureOrNot": 0,
            "tenantId": 886,
            "stateCode": "0",
            "lastUpdateName": "zhang_sit",
            "ticketId": 0,
            "createName": "zhang_sit",
            "schedulerDate": "2023-04-04 16:42:02",
            "status": 0
        },
        {
            "reviewRuleId": null,
            "subTaskOrNot": 1,
            "submitBy": 864711,
            "licenseSwitch": null,
            "lastUpdateDate": "2023-04-04 16:42:02",
            "submitDate": 1680597722422,
            "schedulerBy": -1,
            "deleteFlag": 0,
            "lastUpdateTimestamp": 1680597722422,
            "entityName": "SceneTask",
            "isApplyApprove": 0,
            "reviewRuleName": "",
            "creationTimestamp": 1680597722422,
            "schedulerName": "OpenApi",
            "sceneMode": 4,
            "lastUpdatedBy": 864711,
            "operationTimestamp": 1680597722422,
            "address": null,
            "appName": "isdp-task-server",
            "errorMessage": null,
            "creationDate": "2023-04-04 16:42:02",
            "customerTaskId": "20qe333",
            "submitName": "zhang_sit",
            "sceneTaskId": 3245535,
            "signInConfig": null,
            "createdBy": 864711,
            "schedulerTimestamp": 1680597722422,
            "affectedRows": 1,
            "procedureOrNot": 0,
            "tenantId": 886,
            "stateCode": "0",
            "lastUpdateName": "zhang_sit",
            "ticketId": 0,
            "createName": "zhang_sit",
            "schedulerDate": "2023-04-04 16:42:02",
            "status": 0
        }
    ]
}

状态码

状态码请参见状态码

错误码

错误码请参见错误码

相关文档