# 一、概况

本系统本着开源开放的原则,针对云原生应用平台 (opens new window)开发的一套开放式工单系统,包含基础的工单管理、权限管理以及可配置的流程与模板等,致力于提升资产云平台接入应用服务支持效率,同时,也通过集中化的服务数据管理,及时了解应用的服务效率。

# 1.1 目标

  1. 前期设计工单系统以云服务器管理应用过程为基础进行开发,以解决其售后问题和答疑流程管理;
  2. 产品设计和开发直接能够满足作为三方接入应用在业务中调用,并在业务应用接入过程中,通过迭代,进一步保证足够的开放性、兼容性;

# 1.2 接入条件

  1. 已接入云原生应用平台基础用户体系
  2. 联系工单系统负责单位配置工单 -- @生芽教育

# 二、接入方式

工单模块的接入支持2种方式:

2.1 方式一:(推荐)

采用嵌入页面形式进行工单配置和管理,减少应用开发商对接时间,降低对接复杂度

示例:

   发起工单页面 /workorder-launch-flow

   我的工单页面 /myProcess

2.2 方式二:

通过API自主进行开发相关页面和功能开发,相关页面设计规范符合资产云统一设计规范 (opens new window)

# 三、应用说明

用户端:

  1. 发起工单,并根据表单信息如实填写工单内容,并提交工单
  2. 通过工单引擎配置规则,工单流转到响应的处理人处理;
  3. 和处理人进行工单问题互动,并最终解决问题,关闭工单;

应用管理端:

  1. 根据工单引擎配置的规则,接收工单;
  2. 判断工单问题是否可以解答,会出现3种处理方式:
    1. 工单可以处理,直接回复工单
    2. 工单不明确,需要和用户
    3. 工单无法处理,需要流转协助,则将工单流转给其他相关人员处理;
  3. 根据工单处理的状态,持续进行 处理 ,直至工单关闭或者解决

# 四、接口列表

# 1 查询工单流程

接口名称: /asset-work-order/flowable/processDefinition/workorder

请求方式: GET

请求参数:

返回参数

{
    "code":200,
    "msg":"操作成功",
    "data":{
        "id":"workOrder:6:60c0993f-66c4-11eb-b36a-568c874f86c5",
        "key":"workOrder",
        "version":6,
        "name":"工单",
        "formKey":"problem"
    }
}

返回参数说明

参数名 类型 说明
data.id String 工单流程id
data.key String 工单流程key
data.version String 当前版本
data.name String 名称
data.formKey String 发起流程的表单可以

# 2查询发起工单的表单

接口名称: asset-work-order/flowable/processDefinition/renderedStartForm

请求方式: GET

请求参数:

参数名 必选 类型 说明
processDefinitionId String 工单流程id 通过接口 (1 查询工单流程)获取

返回示例

{
    "code":200,
    "msg":"操作成功",
    "data":{
        "renderedStartForm":"{"list":[{"type":"input","icon":"icon-input","options":{"width":"100%","defaultValue":"","required":true,"dataType":"string","pattern":"","placeholder":"","disabled":false,"remoteFunc":"func_1612234883000_34472"},"name":"标题","key":"1612234883000_34472","model":"input_1612234883000_34472","rules":[{"type":"string","message":"标题格式不正确"},{"required":true,"message":"标题必须填写"}]},{"type":"radio","icon":"icon-radio-active","options":{"inline":false,"defaultValue":"","showLabel":false,"options":[{"value":"Bug提报","label":"Option 1"},{"value":"业务问题","label":"Option 2"},{"value":"平台问题","label":"Option 3"}],"required":true,"width":"","remote":false,"remoteOptions":[],"props":{"value":"value","label":"label"},"remoteFunc":"func_1612328628000_66440","disabled":false},"name":"工单类型","key":"1612328628000_66440","model":"radio_1612328628000_66440","rules":[{"required":true,"message":"工单类型必须填写"}]},{"type":"input","icon":"icon-input","options":{"width":"100%","defaultValue":"","required":true,"dataType":"string","pattern":"","placeholder":"","disabled":false,"remoteFunc":"func_1612328703000_23055"},"name":"系统模块","key":"1612328703000_23055","model":"input_1612328703000_23055","rules":[{"type":"string","message":"系统模块格式不正确"},{"required":true,"message":"系统模块必须填写"}]},{"type":"textarea","icon":"icon-diy-com-textarea","options":{"width":"100%","defaultValue":"","required":true,"disabled":false,"pattern":"","placeholder":"","remoteFunc":"func_1612234889000_78644"},"name":"描述","key":"1612234889000_78644","model":"textarea_1612234889000_78644","rules":[{"required":true,"message":"描述必须填写"}]},{"type":"accessory","icon":"icon-fuwenbenkuang","options":{"disabled":false,"size":{"width":100,"height":100},"remoteFunc":"func_1612328733000_79711"},"width":"","disabled":false,"amount":8,"multiple":true,"canDelete":false,"canEdit":false,"accessoryUrls":[],"zcyToken":"","action":"","name":"上传附件","key":"1612328733000_79711","model":"accessory_1612328733000_79711","rules":[]}],"config":{"labelWidth":100,"labelPosition":"right","size":"small"}}"
    }
}

返回参数说明

参数名 类型 说明
data.renderedStartForm json 表单表单定义信息

# 3发起工单

接口名称: /asset-work-order/flowable/processInstance/start

请求方式: POST

请求示例:

{
    "processDefinitionId":"workOrder:6:60c0993f-66c4-11eb-b36a-568c874f86c5",
    "values":{
        "processInstanceFormData":"{"input_1612234883000_34472":"1","radio_1612328628000_66440":"Bug提报","input_1612328703000_23055":"1","textarea_1612234889000_78644":"1","accessory_1612328733000_79711":[]}",
        "input_1612234883000_34472":"1",
        "radio_1612328628000_66440":"Bug提报",
        "input_1612328703000_23055":"1",
        "textarea_1612234889000_78644":"1",
        "accessory_1612328733000_79711":[

        ]
    },
    "ccToVos":[

    ]
}

参数:

参数名 必选 类型 说明
processDefinitionId String 工单流程id 通过接口 (1 查询工单流程)获取
values object 表单内容
values.processInstanceFormData json 表单字段数据集合 input_1612234883000_34472,radio_1612328628000_66440 为表单字段key
ccToVos list 空数组

返回示例

{
    "code":200,
    "msg":"操作成功",
    "data":{

    }
}

# 4查询我的工单列表

接口名称: /asset-work-order/flowable/processInstance/listMyInvolved

请求方式: GET

请求示例:

参数:

参数名 必选 类型 说明
current Integer 页数
size Integer 个数
startedByMe Boolean 查询自己的工单 参数为:true
processDefinitionKey 工单流程key 通过接口 (1 查询工单流程)获取
finished Boolean 是否查询已完成工单
unfinished Boolean 是否查询未完成工单

返回示例

{
    "code":200,
    "msg":"操作成功",
    "data":{
        "records":[
            {
                "id":"97056bc0-66c4-11eb-b36a-568c874f86c5",
                "name":"xxx发起的工单",
                "processDefinitionId":"workOrder:6:60c0993f-66c4-11eb-b36a-568c874f86c5",
                "processDefinitionName":"工单",
                "processDefinitionKey":"workOrder",
                "processDefinitionVersion":6,
                "startTime":"2021-02-04 16:40:09",
                "endTime":"2021-02-04 16:41:29",
                "durationInMillis":79821,
                "startUserId":"1272914195944538829",
                "startActivityId":"StartEvent",
                "superProcessInstanceId":"",
                "tenantId":"",
                "startUserName":"xxx",
                "isCanEnd":false
            }
        ],
        "total":7,
        "size":10,
        "current":0,
        "orders":[

        ],
        "offset":0
    }
}

返回参数说明

参数名 类型 说明
id String 流程实例id
name String 实例名称
processDefinitionId String 流程id
processDefinitionName String 流程名称
processDefinitionKey String 流程key
processDefinitionVersion String 流程版本
startTime String 开始时间
endTime String 结束时间
startUserId String 发起人id
startUserName String 发起人名称

# 5查询表单信息

接口名称: asset-work-order/flowable/processInstance/formData

请求方式: GET

参数:

参数名 必选 类型 说明
processInstanceId String 流程实例id

返回示例

{
    "code":200,
    "msg":"操作成功",
    "data":{
        "businessKey":"",
        "variables":{
            "processInstanceFormData":"{"input_1612234883000_34472":"1","radio_1612328628000_66440":"Bug提报","input_1612328703000_23055":"1","textarea_1612234889000_78644":"1","accessory_1612328733000_79711":[]}",
            "input_1612234883000_34472":"1",
            "__initiator__":"1272914195944538829",
            "textarea_1612234889000_78644":"1",
            "radio_1612328628000_66440":"Bug提报",
            "accessory_1612328733000_79711":[

            ],
            "input_1612328703000_23055":"1"
        },
        "renderedStartForm":"{"list":[{"type":"input","icon":"icon-input","options":{"width":"100%","defaultValue":"","required":true,"dataType":"string","pattern":"","placeholder":"","disabled":false,"remoteFunc":"func_1612234883000_34472"},"name":"标题","key":"1612234883000_34472","model":"input_1612234883000_34472","rules":[{"type":"string","message":"标题格式不正确"},{"required":true,"message":"标题必须填写"}]},{"type":"radio","icon":"icon-radio-active","options":{"inline":false,"defaultValue":"","showLabel":false,"options":[{"value":"Bug提报","label":"Option 1"},{"value":"业务问题","label":"Option 2"},{"value":"平台问题","label":"Option 3"}],"required":true,"width":"","remote":false,"remoteOptions":[],"props":{"value":"value","label":"label"},"remoteFunc":"func_1612328628000_66440","disabled":false},"name":"工单类型","key":"1612328628000_66440","model":"radio_1612328628000_66440","rules":[{"required":true,"message":"工单类型必须填写"}]},{"type":"input","icon":"icon-input","options":{"width":"100%","defaultValue":"","required":true,"dataType":"string","pattern":"","placeholder":"","disabled":false,"remoteFunc":"func_1612328703000_23055"},"name":"系统模块","key":"1612328703000_23055","model":"input_1612328703000_23055","rules":[{"type":"string","message":"系统模块格式不正确"},{"required":true,"message":"系统模块必须填写"}]},{"type":"textarea","icon":"icon-diy-com-textarea","options":{"width":"100%","defaultValue":"","required":true,"disabled":false,"pattern":"","placeholder":"","remoteFunc":"func_1612234889000_78644"},"name":"描述","key":"1612234889000_78644","model":"textarea_1612234889000_78644","rules":[{"required":true,"message":"描述必须填写"}]},{"type":"accessory","icon":"icon-fuwenbenkuang","options":{"disabled":false,"size":{"width":100,"height":100},"remoteFunc":"func_1612328733000_79711"},"width":"","disabled":false,"amount":8,"multiple":true,"canDelete":false,"canEdit":false,"accessoryUrls":[],"zcyToken":"","action":"","name":"上传附件","key":"1612328733000_79711","model":"accessory_1612328733000_79711","rules":[]}],"config":{"labelWidth":100,"labelPosition":"right","size":"small"}}",
        "showBusinessKey":false
    }
}

# 6结束工单

接口名称: /asset-work-order/flowable/processInstance/stopProcessInstance

请求方式: POST

请求示例:
{ "processInstanceId":"e40e09e6-66de-11eb-b541-de81a41f325f" } 参数:

参数名 必选 类型 说明
processInstanceId String 流程实例id

返回示例

{
    "code":200,
    "msg":"操作成功",
    "data":{

    }
}

# 7 查询工单过程意见

接口名称: asset-work-order/flowable/processInstance/comments

请求方式: GET

参数:

参数名 必选 类型 说明
processInstanceId String 流程实例id

返回示例

{
    "code":200,
    "msg":"操作成功",
    "data":[
        {
            "id":"7676e43a-66e1-11eb-b541-de81a41f325f",
            "userId":"1272914195944538829",
            "userName":"qingfeng",
            "type":"ZZ",
            "typeDesc":"终止",
            "time":"2021-02-04 20:06:50",
            "taskId":"e412c3e7-66de-11eb-b541-de81a41f325f",
            "taskName":"处理任务",
            "taskDefinitionKey":"",
            "taskDefinitionName":"",
            "processInstanceId":"e40e09e6-66de-11eb-b541-de81a41f325f",
            "message":"",
            "fullMessage":"终止流程"
        }
    ]
}

返回参数说明

参数名 类型 说明
data.userId String 处理人id
data.userName String 处理人名称
data.taskName String 任务节点
data.typeDesc String 操作类型描述
data.fullMessage String 意见
data.time String 操作时间

# 8查询回复列表

请求URL: /asset-work-order/flowable/work/order/list

请求方式: GET

参数:

参数名 必选 类型 说明
processInstanceId String 流程实例id

返回示例

{
    "code":200,
    "msg":"操作成功",
    "data":[
        {
            "id":36,
            "processInstanceId":"904802ed-66c9-11eb-b541-de81a41f325f",
            "taskId":"",
            "userName":"潘朝晖",
            "userId":"1272914195944538829",
            "content":"sddd",
            "parentId":0,
            "type":0,
            "isRead":"0",
            "createTime":"2021-02-04 17:15:57"
        }
    ]
}

返回参数说明

参数名 类型 说明
data.id Long 回复表id
data.processInstanceId String 流程实例id
data.content String 回复内容内容
data.type Integer 回复类型 0-平台回复 1-是客户回复
data.createTime String 回复时间
data.userName String 回复人

# 9回复工单

请求URL:

  • /asset-work-order/flowable/work/order/reply

请求方式:

  • POST

请求示例

{
   "processInstanceId":"904802ed-66c9-11eb-b541-de81a41f325f",
   "userName":"回复人名称",
   "content":"内容",
   "parentId":"0",
   "type":"1"
}

参数:

参数名 必选 类型 说明
processInstanceId String 流程实例id
userName Stirng String 用户名
content String 回复内容
parentId Long 上一条回复id 默认0
type Integer 回复类型 0-平台回复 1-是客户回复

返回示例

{
   "code":200,
   "msg":"操作成功",
   "data":{
       "id":37,
       "processInstanceId":"1ad19942-66cb-11eb-b541-de81a41f325f",
       "userName":"回复人名称",
       "userId":"1272914195944538",
       "content":"内容",
       "parentId":0,
       "type":0,
       "createTime":"2021-02-04 18:38:25"
   }
}

返回参数说明

参数名 类型 说明
data.id Long 回复表id
data.processInstanceId String 流程实例id
data.content String 回复内容内容
data.type Integer 回复类型 0-平台回复 1-是客户回复
data.createTime String 回复时间
data.userName String 回复人名称
data.userId String 回复人id

备注 返回参数 可用于回复对话框回显

Last Updated: 3/10/2022, 10:39:52 PM