mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-23 10:58:34 +08:00
update 重构 将flowable更换为warm-flow
This commit is contained in:
@@ -1,115 +1,202 @@
|
||||
-- ----------------------------
|
||||
-- 0、warm-flow-all.sql,地址:https://gitee.com/dromara/warm-flow/blob/master/sql/mysql/warm-flow-all.sql
|
||||
-- ----------------------------
|
||||
CREATE TABLE `flow_definition`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键id',
|
||||
`flow_code` varchar(40) NOT NULL COMMENT '流程编码',
|
||||
`flow_name` varchar(100) NOT NULL COMMENT '流程名称',
|
||||
`category` varchar(100) DEFAULT NULL COMMENT '流程类别',
|
||||
`version` varchar(20) NOT NULL COMMENT '流程版本',
|
||||
`is_publish` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否发布(0未发布 1已发布 9失效)',
|
||||
`form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
|
||||
`form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
|
||||
`activity_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '流程激活状态(0挂起 1激活)',
|
||||
`listener_type` varchar(100) DEFAULT NULL COMMENT '监听器类型',
|
||||
`listener_path` varchar(400) DEFAULT NULL COMMENT '监听器路径',
|
||||
`ext` varchar(500) DEFAULT NULL COMMENT '业务详情 存业务表对象json字符串',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='流程定义表';
|
||||
|
||||
CREATE TABLE `flow_node`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键id',
|
||||
`node_type` tinyint(1) NOT NULL COMMENT '节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
|
||||
`definition_id` bigint NOT NULL COMMENT '流程定义id',
|
||||
`node_code` varchar(100) NOT NULL COMMENT '流程节点编码',
|
||||
`node_name` varchar(100) DEFAULT NULL COMMENT '流程节点名称',
|
||||
`permission_flag` varchar(200) DEFAULT NULL COMMENT '权限标识(权限类型:权限标识,可以多个,用逗号隔开)',
|
||||
`node_ratio` decimal(6, 3) DEFAULT NULL COMMENT '流程签署比例值',
|
||||
`coordinate` varchar(100) DEFAULT NULL COMMENT '坐标',
|
||||
`skip_any_node` varchar(100) DEFAULT 'N' COMMENT '是否可以退回任意节点(Y是 N否)即将删除',
|
||||
`any_node_skip` varchar(100) DEFAULT NULL COMMENT '任意结点跳转',
|
||||
`listener_type` varchar(100) DEFAULT NULL COMMENT '监听器类型',
|
||||
`listener_path` varchar(400) DEFAULT NULL COMMENT '监听器路径',
|
||||
`handler_type` varchar(100) DEFAULT NULL COMMENT '处理器类型',
|
||||
`handler_path` varchar(400) DEFAULT NULL COMMENT '处理器路径',
|
||||
`form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
|
||||
`form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
|
||||
`version` varchar(20) NOT NULL COMMENT '版本',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='流程节点表';
|
||||
|
||||
CREATE TABLE `flow_skip`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键id',
|
||||
`definition_id` bigint NOT NULL COMMENT '流程定义id',
|
||||
`now_node_code` varchar(100) NOT NULL COMMENT '当前流程节点的编码',
|
||||
`now_node_type` tinyint(1) DEFAULT NULL COMMENT '当前节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
|
||||
`next_node_code` varchar(100) NOT NULL COMMENT '下一个流程节点的编码',
|
||||
`next_node_type` tinyint(1) DEFAULT NULL COMMENT '下一个节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
|
||||
`skip_name` varchar(100) DEFAULT NULL COMMENT '跳转名称',
|
||||
`skip_type` varchar(40) DEFAULT NULL COMMENT '跳转类型(PASS审批通过 REJECT退回)',
|
||||
`skip_condition` varchar(200) DEFAULT NULL COMMENT '跳转条件',
|
||||
`coordinate` varchar(100) DEFAULT NULL COMMENT '坐标',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='节点跳转关联表';
|
||||
|
||||
CREATE TABLE `flow_instance`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '主键id',
|
||||
`definition_id` bigint NOT NULL COMMENT '对应flow_definition表的id',
|
||||
`business_id` varchar(40) NOT NULL COMMENT '业务id',
|
||||
`node_type` tinyint(1) NOT NULL COMMENT '节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
|
||||
`node_code` varchar(40) NOT NULL COMMENT '流程节点编码',
|
||||
`node_name` varchar(100) DEFAULT NULL COMMENT '流程节点名称',
|
||||
`variable` text COMMENT '任务变量',
|
||||
`flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2 审批通过 3自动通过 4终止 5作废 6撤销 7取回 8已完成 9已退回 10失效)',
|
||||
`activity_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '流程激活状态(0挂起 1激活)',
|
||||
`def_json` text COMMENT '流程定义json',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`ext` varchar(500) DEFAULT NULL COMMENT '扩展字段,预留给业务系统使用',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='流程实例表';
|
||||
|
||||
CREATE TABLE `flow_task`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '主键id',
|
||||
`definition_id` bigint NOT NULL COMMENT '对应flow_definition表的id',
|
||||
`instance_id` bigint NOT NULL COMMENT '对应flow_instance表的id',
|
||||
`node_code` varchar(100) NOT NULL COMMENT '节点编码',
|
||||
`node_name` varchar(100) DEFAULT NULL COMMENT '节点名称',
|
||||
`node_type` tinyint(1) NOT NULL COMMENT '节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
|
||||
`form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
|
||||
`form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='待办任务表';
|
||||
|
||||
CREATE TABLE `flow_his_task`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL COMMENT '主键id',
|
||||
`definition_id` bigint(20) NOT NULL COMMENT '对应flow_definition表的id',
|
||||
`instance_id` bigint(20) NOT NULL COMMENT '对应flow_instance表的id',
|
||||
`task_id` bigint(20) NOT NULL COMMENT '对应flow_task表的id',
|
||||
`node_code` varchar(100) DEFAULT NULL COMMENT '开始节点编码',
|
||||
`node_name` varchar(100) DEFAULT NULL COMMENT '开始节点名称',
|
||||
`node_type` tinyint(1) DEFAULT NULL COMMENT '开始节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
|
||||
`target_node_code` varchar(200) DEFAULT NULL COMMENT '目标节点编码',
|
||||
`target_node_name` varchar(200) DEFAULT NULL COMMENT '结束节点名称',
|
||||
`approver` varchar(40) DEFAULT NULL COMMENT '审批者',
|
||||
`cooperate_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)',
|
||||
`collaborator` varchar(40) DEFAULT NULL COMMENT '协作人',
|
||||
`skip_type` varchar(10) NOT NULL COMMENT '流转类型(PASS通过 REJECT退回 NONE无动作)',
|
||||
`flow_status` varchar(20) NOT NULL COMMENT '流程状态(1审批中 2 审批通过 9已退回 10失效)',
|
||||
`form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
|
||||
`form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
|
||||
`message` varchar(500) DEFAULT NULL COMMENT '审批意见',
|
||||
`variable` TEXT DEFAULT NULL COMMENT '任务变量',
|
||||
`ext` varchar(500) DEFAULT NULL COMMENT '业务详情 存业务表对象json字符串',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '任务开始时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '审批完成时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT ='历史任务记录表';
|
||||
|
||||
|
||||
CREATE TABLE `flow_user`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键id',
|
||||
`type` char(1) NOT NULL COMMENT '人员类型(1待办任务的审批人权限 2待办任务的转办人权限 3待办任务的委托人权限)',
|
||||
`processed_by` varchar(80) DEFAULT NULL COMMENT '权限人',
|
||||
`associated` bigint NOT NULL COMMENT '任务表id',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`create_by` varchar(80) DEFAULT NULL COMMENT '创建人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `user_processed_type` (`processed_by`, `type`)
|
||||
) ENGINE = InnoDB COMMENT ='流程用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 流程分类表
|
||||
-- ----------------------------
|
||||
create table flow_category
|
||||
(
|
||||
category_id bigint(20) not null comment '流程分类ID',
|
||||
tenant_id varchar(20) default '000000' comment '租户编号',
|
||||
parent_id bigint(20) default 0 comment '父流程分类id',
|
||||
ancestors varchar(500) default '' comment '祖级列表',
|
||||
category_name varchar(30) not null comment '流程分类名称',
|
||||
order_num int(4) default 0 comment '显示顺序',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
||||
create_dept bigint(20) null comment '创建部门',
|
||||
create_by bigint(20) null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint(20) null comment '更新者',
|
||||
update_time datetime null comment '更新时间',
|
||||
primary key (category_id)
|
||||
) engine = innodb comment = '流程分类';
|
||||
|
||||
INSERT INTO flow_category values (100, '000000', 0, '0', 'OA审批', 0, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (101, '000000', 100, '0,100', '假勤管理', 0, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (102, '000000', 100, '0,100', '人事管理', 1, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (103, '000000', 101, '0,100,101', '请假', 0, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (104, '000000', 101, '0,100,101', '出差', 1, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (105, '000000', 101, '0,100,101', '加班', 2, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (106, '000000', 101, '0,100,101', '换班', 3, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (107, '000000', 101, '0,100,101', '外出', 4, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (108, '000000', 102, '0,100,102', '转正', 1, '0', 103, 1, sysdate(), null, null);
|
||||
INSERT INTO flow_category values (109, '000000', 102, '0,100,102', '离职', 2, '0', 103, 1, sysdate(), null, null);
|
||||
|
||||
-- ----------------------------
|
||||
-- 请假单信息
|
||||
-- ----------------------------
|
||||
create table test_leave
|
||||
(
|
||||
id bigint not null comment '主键',
|
||||
leave_type varchar(255) not null comment '请假类型',
|
||||
start_date datetime not null comment '开始时间',
|
||||
end_date datetime not null comment '结束时间',
|
||||
leave_days int(10) not null comment '请假天数',
|
||||
remark varchar(255) null comment '请假原因',
|
||||
status varchar(255) null comment '状态',
|
||||
create_dept bigint null comment '创建部门',
|
||||
create_by bigint null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint null comment '更新者',
|
||||
update_time datetime null comment '更新时间',
|
||||
tenant_id varchar(20) null comment '租户编号',
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '请假申请表';
|
||||
|
||||
-- 流程分类信息表
|
||||
create table wf_category
|
||||
(
|
||||
id bigint not null comment '主键'
|
||||
primary key,
|
||||
category_name varchar(255) null comment '分类名称',
|
||||
category_code varchar(255) null comment '分类编码',
|
||||
parent_id bigint null comment '父级id',
|
||||
sort_num int(19) null comment '排序',
|
||||
tenant_id varchar(20) null comment '租户编号',
|
||||
create_dept bigint null comment '创建部门',
|
||||
create_by bigint null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint null comment '更新者',
|
||||
update_time datetime null comment '更新时间',
|
||||
constraint uni_category_code
|
||||
unique (category_code)
|
||||
) engine=innodb comment= '流程分类';
|
||||
INSERT INTO wf_category values (1, 'OA', 'OA', 0, 0, '000000', 103, 1, sysdate(), 1, sysdate());
|
||||
|
||||
create table wf_task_back_node
|
||||
(
|
||||
id bigint not null
|
||||
primary key,
|
||||
node_id varchar(255) not null comment '节点id',
|
||||
node_name varchar(255) not null comment '节点名称',
|
||||
order_no int not null comment '排序',
|
||||
instance_id varchar(255) null comment '流程实例id',
|
||||
task_type varchar(255) not null comment '节点类型',
|
||||
assignee varchar(2000) not null comment '审批人',
|
||||
tenant_id varchar(20) null comment '租户编号',
|
||||
create_dept bigint null comment '创建部门',
|
||||
create_by bigint null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint null comment '更新者',
|
||||
update_time datetime null comment '更新时间'
|
||||
)
|
||||
comment '节点审批记录';
|
||||
|
||||
create table wf_definition_config
|
||||
(
|
||||
id bigint not null comment '主键'
|
||||
primary key,
|
||||
table_name varchar(255) not null comment '表名',
|
||||
definition_id varchar(255) not null comment '流程定义ID',
|
||||
process_key varchar(255) not null comment '流程KEY',
|
||||
version int(10) not null comment '流程版本',
|
||||
create_dept bigint null comment '创建部门',
|
||||
create_by bigint null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint null comment '更新者',
|
||||
update_time datetime null comment '更新时间',
|
||||
remark varchar(500) default '' null comment '备注',
|
||||
tenant_id varchar(20) null comment '租户编号',
|
||||
constraint uni_definition_id
|
||||
unique (definition_id)
|
||||
)
|
||||
comment '流程定义配置';
|
||||
|
||||
create table wf_form_manage
|
||||
(
|
||||
id bigint not null comment '主键'
|
||||
primary key,
|
||||
form_name varchar(255) not null comment '表单名称',
|
||||
form_type varchar(255) not null comment '表单类型',
|
||||
router varchar(255) not null comment '路由地址/表单ID',
|
||||
remark varchar(500) null comment '备注',
|
||||
tenant_id varchar(20) null comment '租户编号',
|
||||
id bigint(20) not null comment 'id',
|
||||
tenant_id varchar(20) default '000000' comment '租户编号',
|
||||
leave_type varchar(255) not null comment '请假类型',
|
||||
start_date datetime not null comment '开始时间',
|
||||
end_date datetime not null comment '结束时间',
|
||||
leave_days int(10) not null comment '请假天数',
|
||||
remark varchar(255) null comment '请假原因',
|
||||
status varchar(255) null comment '状态',
|
||||
create_dept bigint null comment '创建部门',
|
||||
create_by bigint null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint null comment '更新者',
|
||||
update_time datetime null comment '更新时间'
|
||||
)
|
||||
comment '表单管理';
|
||||
|
||||
insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/workflow/leaveEdit/index', NULL, '000000', 103, 1, sysdate(), 1, sysdate());
|
||||
|
||||
create table wf_node_config
|
||||
(
|
||||
id bigint not null comment '主键'
|
||||
primary key,
|
||||
form_id bigint null comment '表单id',
|
||||
form_type varchar(255) null comment '表单类型',
|
||||
node_name varchar(255) not null comment '节点名称',
|
||||
node_id varchar(255) not null comment '节点id',
|
||||
definition_id varchar(255) not null comment '流程定义id',
|
||||
apply_user_task char(1) default '0' comment '是否为申请人节点 (0是 1否)',
|
||||
create_dept bigint null comment '创建部门',
|
||||
create_by bigint null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint null comment '更新者',
|
||||
update_time datetime null comment '更新时间',
|
||||
tenant_id varchar(20) null comment '租户编号'
|
||||
)
|
||||
comment '节点配置';
|
||||
update_time datetime null comment '更新时间',
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '请假申请表';
|
||||
|
||||
Reference in New Issue
Block a user