EOS Low-Code Platform 8 EOS Low-Code Platform 8
产品简介
安装部署
应用开发
专题场景实战案例
低代码(Low-Code)开发参考手册
高开开发参考手册
流程开发参考手册
AFCenter 使用指南
Governor 使用指南
FAQ
  • 任务中心
  • 概述
  • 功能特性
  • 集成说明
  • bps-server适配任务中心adapter
  • 集成MQ
  • 接口说明
  • 数据库模型
  • 源码组件说明
  • 白名单接口配置

# 任务中心

# 概述

​ 企业信息化的发展,与之而来的是企业业务系统的不断增多,企业的业务分布在不同的业务系统中。业务人员在处理业务的过程中,需要在不同的业务系统之间切换,这样的切换,在一定的程度上不仅浪费的业务人员的时间,也使得其不能将全部的精力专注于业务。为了规避这种不合理的工作方式,我们提出了集中任务中心的解决方案。

​ 集中任务中心通过业务接口接受应用系统推送过来的待处理和已处理的任务,业务人员登录集中任务中心以后对当前自己的任务一目了然,这样即避免了业务人员处理不同业务的时候在不同的业务系统之间的切换,也方便了业务人员对不同业务系统数据之间的比对和分析。使得其将更多的精力专注于业务,进而提升工作效率,节约业务成本。

部署关系图

img

部署架构图

img

# 功能特性

​ 集中任务中心的主要功能是通过业务接口的方式将不同业务系统的数据聚集到集中任务中心,进行统一处理。

taskcenter-1

taskcenter-2

​ 该功能分为待处理任务和已处理任务,用户可以点击对应的菜单,进行界面的切换。待处理任务即是需要处理的任务,点击待处理任务,系统将自动重定向到当前任务对应的业务系统,然后再进行任务的处理。任务处理完成以后,当前任务将自动转入已处理任务中,即已处理任务中,展现的都是已经完成了的任务。

# 集成说明

  1. 集成AFCenter

    在AFCenter的打包项目中添加taskcenter的starter依赖,然后在AFCenter的数据库中执行taskcenter的数据库脚本及相关菜单的脚本后启动即可。

    前端页面需要参考流程任务中心前端说明。

  2. 独立进程

    使用eos-studio创建打包项目然后添加taskcenter的starter依赖,然后初始化taskcenter数据库脚本,同时在afcenter的数据库中执行微应用菜单的脚本,配置打包项目的数据库,修改nginx的代理路径,增加/api/task-center开头的请求路由到独立进程的后端服务。

    前端页面则需要将流程任务中心前端说明中的前端页面放入自己的项目中或者集成到AFCenter。

依赖GAV信息

<!--  adapter      -->
<dependency>
    <groupId>com.primeton.bps</groupId>
    <artifactId>com.primeton.bps.taskcenter.adapter</artifactId>
    <version>${taskcenter.version}</version>
</dependency>
<!--   starter     -->
<dependency>
    <groupId>com.primeton.bps</groupId>
    <artifactId>com.primeton.bps.taskcenter.starter</artifactId>
    <version>${taskcenter.version}</version>
</dependency>

# bps-server适配任务中心adapter

  1. 在bps-server的安装目录lib下添加任务中心的api、model、adapter这三个jar包

  2. 在config目录下的properties配置文件中配置如下属性

    task-center.name=AFCENTER //应用名称 根据集成的模式不同配置的应用名称也不同
    task-center.handleTaskHost=http://localhost:12345 #处理任务的服务地址(协议+IP/域名+端口)
    
  3. 在config/BPS-SERVER/config/wfengine-config.xml文件中找到名称为worklist_change_notify的module,然后将is_notify的值改为true,name的值改为com.primeton.bps.taskcenter.adapter.WorkListChangeNotifier

  4. 重新启动bps-server即可

# 集成MQ

任务中心可以集成任意mq进行任务推送处理,本例中使用rocketmq5.1.4版本做出相应说明,具体mq的安装及使用不在本文档中进行说明。

  1. 添加rocketmq-spring-boot-starter依赖

      <dependency>
        <groupId>org.apache.rocketmq</groupId>
        <artifactId>rocketmq-spring-boot-starter</artifactId>
        <version>2.2.2</version>
      </dependency>
    
  2. 增加消费者配置类

    package com.primeton.bps.taskcenter.core.mq;
    
    import com.primeton.bps.taskcenter.api.ITaskPushService;
    import com.primeton.bps.taskcenter.core.utils.SdoConvertUtil;
    import com.primeton.bps.taskcenter.model.pojo.TaskTodo;
    import org.apache.rocketmq.spring.annotation.ConsumeMode;
    import org.apache.rocketmq.spring.annotation.MessageModel;
    import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
    import org.apache.rocketmq.spring.core.RocketMQListener;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Component;
    
    import java.util.List;
    
    @Component
    @RocketMQMessageListener(topic = "task-center-todo",consumerGroup = "task-center",consumeMode = ConsumeMode.CONCURRENTLY,messageModel = MessageModel.CLUSTERING)
    public class RocketMqConsumer implements RocketMQListener<List<TaskTodo>> {
    
        @Autowired
        private ITaskPushService pushService; //任务推送服务类
    
        @Override
        public void onMessage(List<TaskTodo> taskTodos) {
            //推送待办任务
            pushService.insertTodoTasks(SdoConvertUtil.convertTodo2List(taskTodos));
        }
    }
    
  3. 配置mq地址

    rocketmq.name-server=localhost:14876
    
  4. 启动任务中心服务

上述1-4步为集成mq的基本步骤,其中步骤2中的任务推送消费者还可定义推送已办任务、删除任务、更新待办这三个。根据每个mq的使用方式不同步骤2的消费者创建模式就不同,需要开发者自行根据具体mq去适配。

# 接口说明

# 任务查询接口

序号 方法名称 接口类型 url 描述
1 com.primeton.bps.taskcenter.core.web.TaskCenterController#queryTodoTasksWithPage GET /api/taskcenter/common/page/todos 分页查询待办或者逾期待办
2 com.primeton.bps.taskcenter.core.web.TaskCenterController#queryDoneTasksWithPage GET /api/taskcenter/common/page/dones 分页查询已办或者归档已办
# 接口参数及返回值说明

com.primeton.bps.taskcenter.core.web.TaskCenterController#queryTodoTasksWithPage 分页查询待办或者逾期待办

请求参数:
taskName 任务名称
taskState 任务状态
sysName 系统名称
createTimeStart 创建时间区间开始时间
createTimeEnd 创建时间区间结束时间
page 页码
pageSize 每页条数
overdue 查询待办(false)或逾期待办(true),默认false
返回值:
[
  {
    "pkId": "1",
    "taskId": "462",
    "taskName": "人工活动1",
    "taskPcUrl": "http://localhost:8080/#/module/bfp/page/bfp_proc_framework?pageType=handle&workItemID=462&appName=AFCENTER",
    "taskMobileUrl": "http://localhost:8080/#/module/bfp/page/bfp_proc_framework?pageType=handle&workItemID=462&appName=AFCENTER",
    "taskState": "10",
    "userId": "1",
    "sysId": "1",
    "sysName": "bps-server",
    "createTime": "2024-01-04 10:06:38",
    "receivingTime": "2024-01-04 09:59:12",
    "todoTimeLimit": null,
    "pressNum": 0,
    "lastPressMessage": null,
    "pinToTop": false,
    "todoExtend1": null,
    "todoExtend2": null,
    "todoExtend3": null,
    "todoExtend4": null,
    "todoExtend5": null
  }
]

com.primeton.bps.taskcenter.core.web.TaskCenterController#queryDoneTasksWithPage 分页查询已办或者归档已办

请求参数:
createTimeEnd 创建时间区间结束时间
createTimeStart 创建时间区间开始时间
overdue 查询待办(false)或逾期待办(true),默认false
page 页码
pageSize 每页条数
sysName 系统名称
taskName 任务名称
taskState 任务状态
返回值:
[
  {
    "pkId": "21",
    "taskId": "461",
    "taskName": "人工活动",
    "taskPcUrl": "http://localhost:8080/#/module/bfp/page/bfp_proc_framework?pageType=view&workItemID=461&appName=AFCENTER",
    "taskMobileUrl": "http://localhost:8080/#/module/bfp/page/bfp_proc_framework?pageType=view&workItemID=461&appName=AFCENTER",
    "taskState": "12",
    "userId": "1",
    "sysId": "1",
    "sysName": "bps-server",
    "createTime": "2024-01-04 10:06:38",
    "receivingTime": "2024-01-04 09:59:12",
    "finshTime": "2024-01-04 09:59:12",
    "doneOverdeuTime": null,
    "pressNum": 0,
    "lastPressMessage": null,
    "pinToTop": false,
    "doneExtend1": null,
    "doneExtend2": null,
    "doneExtend3": null,
    "doneExtend4": null,
    "doneExtend5": null
  }
]

# 任务推送接口

序号 方法名称 接口类型 url 描述
1 com.primeton.bps.taskcenter.core.web.TaskPushController#insertTodoTasks POST /api/taskcenter/push-task/todo 推送待办任务
2 com.primeton.bps.taskcenter.core.web.TaskPushController#insertDoneTasks POST /api/taskcenter/push-task/done 推送已办任务
3 com.primeton.bps.taskcenter.core.web.TaskPushController#deleteTasks DELETE /api/taskcenter/push-task/task 删除任务
4 com.primeton.bps.taskcenter.core.web.TaskPushController#updateTaskTodo PUT /api/taskcenter/push-task/task 更新待办及逾期待办,任务名称、任务状态、催办次数和催办消息
5 com.primeton.bps.taskcenter.core.web.TaskPushController#deleteProcess DELETE /api/taskcenter/push-task/process/inst 删除流程实例
6 com.primeton.bps.taskcenter.core.web.TaskPushController#deleteActivity DELETE /api/taskcenter/push-task/activity/inst 删除活动实例
7 com.primeton.bps.taskcenter.core.web.TaskPushController#finishTask POST /api/taskcenter/push-task/task/finish 完成工作项
8 com.primeton.bps.taskcenter.core.web.TaskPushController#updateTaskTodo POST /api/taskcenter/push-task/task/todo 完全更新待办
9 com.primeton.bps.taskcenter.core.web.TaskPushController#updateTaskInfo PUT /api/taskcenter/push-task/task/info 更新工作项信息
10 com.primeton.bps.taskcenter.core.web.TaskPushController#updateProcess PUT /api/taskcenter/push-task/task/process 更新流程
11 com.primeton.bps.taskcenter.core.web.TaskPushController#updateActivity PUT /api/taskcenter/push-task/task/activity 更新活动
12 com.primeton.bps.taskcenter.core.web.TaskPushController#receive POST /api/taskcenter/push-task/task/receive 领取任务
13 com.primeton.bps.taskcenter.core.web.TaskPushController#removePersonTask DELETE /api/taskcenter/push-task/task/person 删除某个人的任务
# 接口参数及返回值说明

com.primeton.bps.taskcenter.core.web.TaskPushController#insertTodoTasks 推送待办任务

请求参数:
{
    "tasks":[
              {
                "createTime": "2024-01-04T06:12:35.994Z",
                "lastPressMessage": "string",
                "pinToTop": true,
                "pressNum": 0,
                "receivingTime": "2024-01-04T06:12:35.994Z",
                "sysId": "string", //必填
                "sysName": "string", //必填
                "taskId": "string", //必填
                "taskMobileUrl": "string",
                "taskName": "string", //必填
                "taskPcUrl": "string", //必填
                "taskState": "string",
                "todoExtend1": "string",
                "todoExtend2": "string",
                "todoExtend3": "string",
                "todoExtend4": "string",
                "todoExtend5": "string",
                "todoTimeLimit": "2024-01-04T06:12:35.994Z",
                "userId": "string" //必填
              }
            ]
}
其中必填项已经标注,其他都是选填项,建议将时间等必要信息都带上,以便于任务中心查询使用
返回值:
{
    "code":"1002",
    "message":"收到任务总数xx,成功创建待办任务数xx,taskId或者sysId缺失任务数xx,taskId & userId重复任务数xx"
}
注释:
插入待办会校验taskId&sysId,同时会校验同一个人的待办是否会重复,结果会返回给调用方

com.primeton.bps.taskcenter.core.web.TaskPushController#insertDoneTasks 推送已办任务

请求参数:
{
    "tasks":[
              {
                "archiveTime": "2024-01-04T02:56:33.396Z",
                "createTime": "2024-01-04T02:56:33.396Z",
                "doneExtend1": "string",
                "doneExtend2": "string",
                "doneExtend3": "string",
                "doneExtend4": "string",
                "doneExtend5": "string",
                "doneOverdueTime": "2024-01-04T02:56:33.396Z",
                "finishTime": "2024-01-04T02:56:33.396Z",
                "lastPressMessage": "string",
                "pinToTop": true,
                "pressNum": 0,
                "receivingTime": "2024-01-04T02:56:33.396Z",
                "sysId": "string", //必填
                "sysName": "string", //必填
                "taskId": "string", //必填
                "taskMobileUrl": "string",
                "taskName": "string",  //必填
                "taskPcUrl": "string", //必填
                "taskState": "string",
                "userId": "string"  //必填
              }
            ]
}
其中必填项已经标注,其他都是选填项,建议将时间等必要信息都带上,以便于任务中心查询使用
返回值:
{
    "code":"1003",
    "message":"收到任务总数xx,成功创建已办任务数xx,taskId或者sysId缺失任务数xx,taskId & userId重复任务数xx"
}
注释:
插入以办会校验taskId&sysId,同时会校验同一个人的待办是否会重复,结果会返回给调用方

com.primeton.bps.taskcenter.core.web.TaskPushController#deleteTasks 删除任务

请求参数:
{
  "sysId": "", //系统id 必填
  "taskIds": [  //任务ID列表 必填
    ""
  ]
}
返回值:
{
    "code":"1000",
    "message":"sucess"
}

com.primeton.bps.taskcenter.core.web.TaskPushController#updateTaskTodo 更新待办,任务名称、任务状态、催办次数和催办消息、超时时间

请求参数:
{
    "tasks":[
              {
                "createTime": "2024-01-08T06:43:33.766Z",
                "lastPressMessage": "string",
                "pinToTop": true,
                "pressNum": 0,
                "processInstName": "string",
                "receivingTime": "2024-01-08T06:43:33.766Z",
                "sortBy": 0,
                "sysId": "string", //必填
                "sysName": "string", 
                "taskId": "string", //必填
                "taskMobileUrl": "string",
                "taskName": "string", 
                "taskPcUrl": "string",
                "taskState": "string",
                "todoExtend1": "string",
                "todoExtend2": "string",
                "todoExtend3": "string",
                "todoExtend4": "string",
                "todoExtend5": "string",
                "todoTimeLimit": "2024-01-08T06:43:33.766Z",
                "userId": "string" //必填
              }
            ]
}
其中必填项已经标注,其他都是选填项,建议将时间等必要信息都带上,以便于任务中心查询使用
返回值:
{
    "code":"1003",
    "message":"收到任务总数xx,更新待办任务数xx,taskId或者sysId缺失任务数xx"
}
注释:
更新待办会校验taskId&sysId,结果会返回给调用方

# 数据库模型

# taskcenter_sys[任务系统表]

序号 列名 类型 长度 是否为空 默认值 小数位 注释
1 sys_id varchar(64) 64 否 -- 0 系统id
2 sys_name varchar(255) 255 否 -- 0 系统名称
3 sys_dict_type_code varchar(128) 128 是 -- 0 系统状态字典项类型编码
4 sys_desc varchar(255) 255 是 -- 0 系统说明
5 extend1 varchar(255) 255 是 -- 0 扩展字段
6 extend2 varchar(255) 255 是 -- 0 扩展字段
7 extend3 varchar(255) 255 是 -- 0 扩展字段
8 extend4 varchar(255) 255 是 -- 0 扩展字段
9 extend5 varchar(255) 255 是 -- 0 扩展字段

# taskcenter_task_done[已办表]

序号 列名 类型 长度 是否为空 默认值 小数位 注释
1 pk_id varchar(64) 64 否 -- 0 主键
2 task_id varchar(64) 64 否 -- 0 任务id
3 task_name varchar(255) 255 否 -- 0 任务名称
4 process_inst_id varchar(64) 64 否 -- 0 流程实例id
5 process_inst_name varchar(256) 256 是 -- 0 流程实例名称
6 activity_inst_id varchar(64) 64 否 -- 0 活动实例id
7 activity_inst_name varchar(256) 256 否 -- 0 活动实例名称
8 task_pc_url varchar(255) 255 否 -- 0 任务查看url
9 task_mobile_url varchar(255) 255 是 -- 0 移动端任务查看url
10 task_state varchar(10) 10 是 -- 0 业务状态,存储字典编码,前端确认显示字典
11 user_id varchar(64) 64 否 -- 0 参与者id
12 sys_id varchar(64) 64 否 -- 0 系统id
13 sys_name varchar(255) 255 否 -- 0 系统名称
14 create_time datetime -- 是 -- 0 任务创建时间
15 receiving_time datetime -- 是 -- 0 任务接收时间
16 finsh_time datetime -- 是 -- 0 任务完成时间
17 done_overdeu_time datetime -- 是 -- 0 已办任务超时时间
18 press_num int(11) 11 是 -- 0 催办次数
19 last_press_message varchar(255) 255 是 -- 0 催办消息,只记录最新的
20 pin_to_top tinyint(1) 1 否 0 0 是否置顶(默认是0不置顶,否则是1置顶)
21 done_extend1 varchar(255) 255 是 -- 0 扩展属性
22 done_extend2 varchar(255) 255 是 -- 0 扩展属性
23 done_extend3 varchar(255) 255 是 -- 0 扩展属性
24 done_extend4 varchar(255) 255 是 -- 0 扩展属性
25 done_extend5 varchar(255) 255 是 -- 0 扩展属性

# taskcenter_task_done_archive[归档表]

序号 列名 类型 长度 是否为空 默认值 小数位 注释
1 pk_id varchar(64) 64 否 -- 0 主键
2 task_id varchar(64) 64 否 -- 0 任务id
3 task_name varchar(255) 255 否 -- 0 任务名称
4 process_inst_id varchar(64) 64 否 -- 0 流程实例id
5 process_inst_name varchar(256) 256 是 -- 0 流程实例名称
6 activity_inst_id varchar(64) 64 否 -- 0 活动实例id
7 activity_inst_name varchar(256) 256 否 -- 0 活动实例名称
8 task_pc_url varchar(255) 255 否 -- 0 任务处理url
9 task_mobile_url varchar(255) 255 是 -- 0 任务处理url
10 task_state varchar(10) 10 是 -- 0 业务状态,存储字典编码,前端确认显示字典
11 user_id varchar(64) 64 否 -- 0 参与者id
12 sys_id varchar(64) 64 否 -- 0 系统id
13 sys_name varchar(255) 255 否 -- 0 系统名称
14 create_time datetime -- 是 -- 0 任务创建时间
15 receiving_time datetime -- 是 -- 0 任务接收时间
16 finsh_time datetime -- 是 -- 0 任务完成时间
17 done_overdeu_time datetime -- 是 -- 0 已办任务超期时间
18 archive_time datetime -- 是 -- 0 归档时间
19 press_num int(11) 11 是 -- 0 催办次数
20 last_press_message varchar(255) 255 是 -- 0 催办消息,只记录最新的
21 pin_to_top tinyint(1) 1 否 0 0 是否置顶(默认是0不置顶,否则是1置顶)
22 done_extend1 varchar(255) 255 是 -- 0 扩展属性
23 done_extend2 varchar(255) 255 是 -- 0 扩展属性
24 done_extend3 varchar(255) 255 是 -- 0 扩展属性
25 done_extend4 varchar(255) 255 是 -- 0 扩展属性
26 done_extend5 varchar(255) 255 是 -- 0 扩展属性

# taskcenter_task_todo[待办任务表]

序号 列名 类型 长度 是否为空 默认值 小数位 注释
1 pk_id varchar(64) 64 否 -- 0 主键
2 task_id varchar(64) 64 否 -- 0 任务id
3 task_name varchar(255) 255 否 -- 0 任务名称
4 process_inst_id varchar(64) 64 否 -- 0 流程实例id
5 process_inst_name varchar(256) 256 是 -- 0 流程实例名称
6 activity_inst_id varchar(64) 64 否 -- 0 活动实例id
7 activity_inst_name varchar(256) 256 否 -- 0 活动实例名称
8 task_pc_url varchar(255) 255 否 -- 0 任务处理url
9 task_mobile_url varchar(255) 255 是 -- 0 移动端任务处理url
10 task_state varchar(10) 10 是 -- 0 业务状态,存储字典编码,前端确认显示字典
11 user_id varchar(64) 64 否 -- 0 参与者id
12 sys_id varchar(64) 64 否 -- 0 系统id
13 sys_name varchar(255) 255 否 -- 0 系统名称
14 create_time datetime -- 是 -- 0 任务创建时间
15 receiving_time datetime -- 是 -- 0 任务接收时间
16 todo_time_limit datetime -- 是 -- 0 待办任务超时时间
17 press_num int(11) 11 是 -- 0 催办次数
18 last_press_message varchar(255) 255 是 -- 0 催办消息,只记录最新的
19 pin_to_top tinyint(1) 1 否 0 0 是否置顶(默认是0不置顶,否则是1置顶)
20 sort_by int(11) 11 是 0 0 排序字段
21 todo_extend1 varchar(255) 255 是 -- 0 扩展属性
22 todo_extend2 varchar(255) 255 是 -- 0 扩展属性
23 todo_extend3 varchar(255) 255 是 -- 0 扩展属性
24 todo_extend4 varchar(255) 255 是 -- 0 扩展属性
25 todo_extend5 varchar(255) 255 是 -- 0 扩展属性

# 数据库脚本

任务中心数据库脚本

create table taskcenter_sys
(
    sys_id             varchar(64)  not null comment '系统id'
        primary key,
    sys_name           varchar(255) not null comment '系统名称',
    sys_dict_type_code varchar(128) null comment '系统状态字典项类型编码',
    sys_desc           varchar(255) null comment '系统说明',
    extend1            varchar(255) null comment '扩展字段',
    extend2            varchar(255) null comment '扩展字段',
    extend3            varchar(255) null comment '扩展字段',
    extend4            varchar(255) null comment '扩展字段',
    extend5            varchar(255) null comment '扩展字段'
)
    comment '任务系统表';

create table taskcenter_task_done
(
    pk_id              varchar(64)          not null comment '主键'
        primary key,
    task_id            varchar(64)          not null comment '任务id',
    task_name          varchar(255)         not null comment '任务名称',
    process_inst_id    varchar(64)          null comment '流程实例id',
    process_inst_name  varchar(256)         null comment '流程实例名称',
    activity_inst_id   varchar(64)          null comment '活动实例id',
    activity_inst_name varchar(256)         null comment '活动实例名称',
    task_pc_url        varchar(255)         not null comment '任务查看url',
    task_mobile_url    varchar(255)         null comment '移动端任务查看url',
    task_state         varchar(10)          null comment '业务状态,存储字典编码,前端确认显示字典',
    user_id            varchar(64)          not null comment '参与者id',
    sys_id             varchar(64)          not null comment '系统id',
    sys_name           varchar(255)         not null comment '系统名称',
    create_time        datetime             null comment '任务创建时间',
    receiving_time     datetime             null comment '任务接收时间',
    finsh_time         datetime             null comment '任务完成时间',
    done_overdeu_time  datetime             null comment '已办任务超时时间,任务超时后才会有值',
    press_num          int                  null comment '催办次数',
    last_press_message varchar(255)         null comment '催办消息,只记录最新的',
    pin_to_top         tinyint(1) default 0 not null comment '是否置顶(默认是0不置顶,否则是1置顶)',
    done_extend1       varchar(255)         null comment '扩展属性',
    done_extend2       varchar(255)         null comment '扩展属性',
    done_extend3       varchar(255)         null comment '扩展属性',
    done_extend4       varchar(255)         null comment '扩展属性',
    done_extend5       varchar(255)         null comment '扩展属性'
)
    comment '已办表';

create table taskcenter_task_done_archive
(
    pk_id              varchar(64)          not null comment '主键'
        primary key,
    task_id            varchar(64)          not null comment '任务id',
    task_name          varchar(255)         not null comment '任务名称',
    process_inst_id    varchar(64)          null comment '流程实例id',
    process_inst_name  varchar(256)         null comment '流程实例名称',
    activity_inst_id   varchar(64)          null comment '活动实例id',
    activity_inst_name varchar(256)         null comment '活动实例名称',
    task_pc_url        varchar(255)         not null comment '任务处理url',
    task_mobile_url    varchar(255)         null comment '任务处理url',
    task_state         varchar(10)          null comment '业务状态,存储字典编码,前端确认显示字典',
    user_id            varchar(64)          not null comment '参与者id',
    sys_id             varchar(64)          not null comment '系统id',
    sys_name           varchar(255)         not null comment '系统名称',
    create_time        datetime             null comment '任务创建时间',
    receiving_time     datetime             null comment '任务接收时间',
    finsh_time         datetime             null comment '任务完成时间',
    done_overdeu_time  datetime             null comment '已办任务超期时间',
    archive_time       datetime             null comment '归档时间',
    press_num          int                  null comment '催办次数',
    last_press_message varchar(255)         null comment '催办消息,只记录最新的',
    pin_to_top         tinyint(1) default 0 not null comment '是否置顶(默认是0不置顶,否则是1置顶)',
    done_extend1       varchar(255)         null comment '扩展属性',
    done_extend2       varchar(255)         null comment '扩展属性',
    done_extend3       varchar(255)         null comment '扩展属性',
    done_extend4       varchar(255)         null comment '扩展属性',
    done_extend5       varchar(255)         null comment '扩展属性'
)
    comment '归档表';

create table taskcenter_task_todo
(
    pk_id              varchar(64)          not null comment '主键'
        primary key,
    task_id            varchar(64)          not null comment '任务id',
    task_name          varchar(255)         not null comment '任务名称',
    process_inst_id    varchar(64)          null comment '流程实例id',
    process_inst_name  varchar(256)         null comment '流程实例名称',
    activity_inst_id   varchar(64)          null comment '活动实例id',
    activity_inst_name varchar(256)         null comment '活动实例名称',
    task_pc_url        varchar(255)         not null comment '任务处理url',
    task_mobile_url    varchar(255)         null comment '移动端任务处理url',
    task_state         varchar(10)          null comment '业务状态,存储字典编码,前端确认显示字典',
    user_id            varchar(64)          not null comment '参与者id',
    sys_id             varchar(64)          not null comment '系统id',
    sys_name           varchar(255)         not null comment '系统名称',
    create_time        datetime             null comment '任务创建时间',
    receiving_time     datetime             null comment '任务接收时间',
    todo_time_limit    datetime             null comment '待办任务超时时间',
    press_num          int                  null comment '催办次数',
    last_press_message varchar(255)         null comment '催办消息,只记录最新的',
    pin_to_top         tinyint(1) default 0 not null comment '是否置顶(默认是0不置顶,否则是1置顶)',
    sort_by            int        default 0 null comment '排序字段',
    todo_extend1       varchar(255)         null comment '扩展属性',
    todo_extend2       varchar(255)         null comment '扩展属性',
    todo_extend3       varchar(255)         null comment '扩展属性',
    todo_extend4       varchar(255)         null comment '扩展属性',
    todo_extend5       varchar(255)         null comment '扩展属性'
)
    comment '待办任务表';

AFCenter菜单脚本

INSERT INTO AFC_RES_GROUP_TEMPLATE (ID, NAME, CODE, TYPES, RES_TPL_TYPE, DESCRIPTION, APP_TPL_ID, BUSINESS_OBJ_ID,
                                    IS_FIXED, SORT_NO, IS_PLATFORM, REUSE_TYPES)
VALUES ('801', '任务中心', 'taskcenter', NULL, NULL, NULL, '501', NULL, NULL, 54, '2', NULL);
INSERT INTO AFC_RESOURCE_TEMPLATE (ID, NAME, CODE, TYPES, APP_TPL_ID, RES_GROUP_TPL_ID, SUB_TYPE, DESCRIPTION,
                                   BUSINESS_OBJ_ID, CONTENT, IS_FIXED, IS_PLATFORM, ROLE_TPL_CODE)
VALUES ('4821', '我的待办', 'taskcenter_todo', 'url', '1', '801', null, '我的待办页面', null,
        '{"openType":"microApp","mark":"taskcenter_todo","url":null,"params":null,"microUrl":null,"microMark":"taskcenter","isLowOrHigh":"high","resourceCode":null,"formStatus":null,"resourceType":null,"viewType":null,"appCode":"AFCENTER","query":null,"processDefName":null,"biId":null,"biType":null,"bicode":null}',
        null, '2', 'afc-role-tenant-manager');
INSERT INTO AFC_RESOURCE_TEMPLATE (ID, NAME, CODE, TYPES, APP_TPL_ID, RES_GROUP_TPL_ID, SUB_TYPE, DESCRIPTION,
                                   BUSINESS_OBJ_ID, CONTENT, IS_FIXED, IS_PLATFORM, ROLE_TPL_CODE)
VALUES ('4822', '我的已办', 'taskcenter_done', 'url', '1', '801', null, '我的已办', null,
        '{"openType":"microApp","mark":"taskcenter_done","url":null,"params":null,"microUrl":null,"microMark":"taskcenter","isLowOrHigh":"high","resourceCode":null,"formStatus":null,"resourceType":null,"viewType":null,"appCode":"AFCENTER","query":null,"processDefName":null,"biId":null,"biType":null,"bicode":null}',
        null, '2', 'afc-role-tenant-manager');
INSERT INTO AFC_RESOURCE_TEMPLATE (ID, NAME, CODE, TYPES, APP_TPL_ID, RES_GROUP_TPL_ID, SUB_TYPE, DESCRIPTION,
                                   BUSINESS_OBJ_ID, CONTENT, IS_FIXED, IS_PLATFORM, ROLE_TPL_CODE)
VALUES ('4841', '系统管理', 'taskcenter_system', 'url', '1', '801', null, '任务中心的系统管理', null,
        '{"openType":"microApp","mark":"taskcenter_system","url":null,"params":null,"microUrl":null,"microMark":"taskcenter","isLowOrHigh":"high","resourceCode":null,"formStatus":null,"resourceType":null,"viewType":null,"appCode":"AFCENTER","query":null,"processDefName":null,"biId":null,"biType":null,"bicode":null}',
        null, '2', 'afc-role-tenant-manager');
INSERT INTO AFC_MENU_TEMPLATE (ID, NAME, CODE, RES_TPL_ID, DESCRIPTION, SORT_NO, IS_LEAF, TREE_LEVEL, SEQ, PARENT_ID,
                               IS_FIXED, OPEN_TYPE, MENU_ICON, IS_PLATFORM, MENU_TYPE, APP_ID)
VALUES ('1321', '任务中心', 'taskcenter', null, null, 3, '0', null, null, 'root', null, null, null, null, null, null);
INSERT INTO AFC_MENU_TEMPLATE (ID, NAME, CODE, RES_TPL_ID, DESCRIPTION, SORT_NO, IS_LEAF, TREE_LEVEL, SEQ, PARENT_ID,
                               IS_FIXED, OPEN_TYPE, MENU_ICON, IS_PLATFORM, MENU_TYPE, APP_ID)
VALUES ('1322', '我的待办', 'taskcenter_todo', '4821', null, 3, '1', null, null, '1321', null, null, null, null, null,
        null);
INSERT INTO AFC_MENU_TEMPLATE (ID, NAME, CODE, RES_TPL_ID, DESCRIPTION, SORT_NO, IS_LEAF, TREE_LEVEL, SEQ, PARENT_ID,
                               IS_FIXED, OPEN_TYPE, MENU_ICON, IS_PLATFORM, MENU_TYPE, APP_ID)
VALUES ('1323', '我的已办', 'taskcenter_done', '4822', null, 3, '1', null, null, '1321', null, null, null, null, null,
        null);
INSERT INTO AFC_MENU_TEMPLATE (ID, NAME, CODE, RES_TPL_ID, DESCRIPTION, SORT_NO, IS_LEAF, TREE_LEVEL, SEQ, PARENT_ID,
                               IS_FIXED, OPEN_TYPE, MENU_ICON, IS_PLATFORM, MENU_TYPE, APP_ID)
VALUES ('1341', '系统管理', 'taskcenter_system', '4841', null, 3, '1', null, null, '1321', null, null, null, null, null,
        null);

AFCenter菜单的数据库脚本都是模板表的脚本,添加时需要根据模板表的现有数据去更改id,同时把关联关系id也进行更改,然后初始化最后在AFCenter的通用管理-数据导入-同步资源处进行模板数据的同步即可

这里暂时只提供mysql的脚本,其他数据库请按照数据库方言进行修改

# 源码组件说明

com.primeton.bps.taskcenter.adapter  适配bps-server的组件包
com.primeton.bps.taskcenter.api      api
com.primeton.bps.taskcenter.boot     启动类
com.primeton.bps.taskcenter.core     任务中心、任务推送组件包
com.primeton.bps.taskcenter.model    模型包
com.primeton.bps.taskcenter.starter  任务中心starter

# 白名单接口配置

需要在AFCenter的user-config.xml中配置白名单接口增加如下几个路由,才能正常使用任务中心功能

/api/taskcenter/push-task/*,
/api/afc/afc-proxy/role/find-org-employee-ids-by-role-ids,
/api/afc/afc-proxy/org/find-org-employee-ids-by-org-ids

← 表结构说明 流程任务中心前端说明 →