# activiti-study-demo **Repository Path**: coderbean/activiti-study-demo ## Basic Information - **Project Name**: activiti-study-demo - **Description**: Activiti6流程审批、自定义用户组、审批过程图 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 2 - **Created**: 2020-09-18 - **Last Updated**: 2022-03-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # activiti-study-demo #### 介绍 Activiti流程审批 #### 部署说明 - vacation.bpmn 使用的用户、用户组 ``` insert into `act_id_group`(`ID_`,`REV_`,`NAME_`,`TYPE_`) values ('dirGroup',1,'总监组',NULL), ('empGroup',1,'员工组',NULL), ('manageGroup',1,'经理组',NULL), ; insert into `act_id_user`(`ID_`,`REV_`,`FIRST_`,`LAST_`,`EMAIL_`,`PWD_`,`PICTURE_ID_`) values ('dira',1,NULL,NULL,NULL,'123456',NULL), ('empa',1,NULL,NULL,NULL,'123456',NULL), ('empb',1,NULL,NULL,NULL,'123456',NULL), ('managea',1,NULL,NULL,NULL,'123456',NULL), ('manageb',1,NULL,NULL,NULL,'123456',NULL); insert into `act_id_membership`(`USER_ID_`,`GROUP_ID_`) values ('dira','dirGroup'), ('empa','empGroup'), ('empb','empGroup'), ('managea','manageGroup'), ('manageb','manageGroup'); ``` - studentvaction.bpmn 自定义用户、用户组在db.sql ``` -- ---------------------------- -- 2、用户信息表 -- ---------------------------- drop table if exists sys_user; create table sys_user ( user_id bigint(20) not null auto_increment comment '用户ID', dept_id bigint(20) default null comment '部门ID', login_name varchar(30) not null comment '登录账号', user_name varchar(30) default '' comment '用户昵称', user_type varchar(2) default '00' comment '用户类型(00系统用户 01注册用户)', email varchar(50) default '' comment '用户邮箱', phonenumber varchar(11) default '' comment '手机号码', sex char(1) default '0' comment '用户性别(0男 1女 2未知)', avatar varchar(100) default '' comment '头像路径', password varchar(50) default '' comment '密码', salt varchar(20) default '' comment '盐加密', status char(1) default '0' comment '帐号状态(0正常 1停用)', del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', login_ip varchar(50) default '' comment '最后登陆IP', login_date datetime comment '最后登陆时间', create_by varchar(64) default '' comment '创建者', create_time datetime comment '创建时间', update_by varchar(64) default '' comment '更新者', update_time datetime comment '更新时间', remark varchar(500) default null comment '备注', primary key (user_id) ) engine=innodb auto_increment=100 comment = '用户信息表'; -- ---------------------------- -- 初始化-用户信息表数据 -- ---------------------------- insert into sys_user values(1, 100, 'studenta', 'studenta', '00', 'ry@163.com', '15888888888', '1', '', '123456', '111111', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); insert into sys_user values(2, 100, 'studentb', 'studentb', '00', 'ry@qq.com', '15666666666', '1', '', '123456', '222222', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '测试员'); insert into sys_user values(3, 100, 'teachera', 'teachera', '00', 'ry@163.com', '15888888888', '1', '', '123456', '111111', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); insert into sys_user values(4, 100, 'teacherb', 'teacherb', '00', 'ry@qq.com', '15666666666', '1', '', '123456', '222222', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '测试员'); insert into sys_user values(5, 100, 'teacherc', 'teacherc', '00', 'ry@163.com', '15888888888', '1', '', '123456', '111111', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); insert into sys_user values(6, 100, 'teacherd', 'teacherd', '00', 'ry@qq.com', '15666666666', '1', '', '123456', '222222', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '测试员'); insert into sys_user values(7, 100, 'officera', 'officera', '00', 'ry@163.com', '15888888888', '1', '', '123456', '111111', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); insert into sys_user values(8, 100, 'officerb', 'officerb', '00', 'ry@163.com', '15888888888', '1', '', '123456', '111111', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); insert into sys_user values(9, 100, 'principala', 'principala', '00', 'ry@qq.com', '15666666666', '1', '', '123456', '222222', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '测试员'); -- ---------------------------- -- 4、角色信息表 -- ---------------------------- drop table if exists sys_role; create table sys_role ( role_id bigint(20) not null auto_increment comment '角色ID', role_name varchar(30) not null comment '角色名称', role_key varchar(100) not null comment '角色权限字符串', role_sort int(4) not null comment '显示顺序', data_scope char(1) default '1' comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', status char(1) not null comment '角色状态(0正常 1停用)', del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', create_by varchar(64) default '' comment '创建者', create_time datetime comment '创建时间', update_by varchar(64) default '' comment '更新者', update_time datetime comment '更新时间', remark varchar(500) default null comment '备注', primary key (role_id) ) engine=innodb auto_increment=100 comment = '角色信息表'; -- ---------------------------- -- 初始化-角色信息表数据 -- ---------------------------- insert into sys_role values(1, 'studentGroup', 'studentGroup', 1, 1, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '学生'); insert into sys_role values(2, 'teacherGroup', 'teacherGroup', 2, 2, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '班主任'); insert into sys_role values(3, 'deanOfficeGroup', 'deanOfficeGroup', 1, 1, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '教务处'); insert into sys_role values(4, 'principalGroup', 'principalGroup', 2, 2, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '校长'); -- ---------------------------- -- 6、用户和角色关联表 用户N-1角色 -- ---------------------------- drop table if exists sys_user_role; create table sys_user_role ( user_id bigint(20) not null comment '用户ID', role_id bigint(20) not null comment '角色ID', primary key(user_id, role_id) ) engine=innodb comment = '用户和角色关联表'; alter table sys_user_role add constraint ACT_FK_sys_user_role_GROUP foreign key (role_id) references sys_role (ID); alter table sys_user_role add constraint ACT_FK_sys_user_role_USER foreign key (user_id) references sys_user (ID); -- ---------------------------- -- 初始化-用户和角色关联表数据 -- ---------------------------- insert into sys_user_role values (1, 1); insert into sys_user_role values (2, 1); insert into sys_user_role values (3, 2); insert into sys_user_role values (4, 2); insert into sys_user_role values (5, 2); insert into sys_user_role values (6, 2); insert into sys_user_role values (7, 3); insert into sys_user_role values (8, 3); insert into sys_user_role values (9, 4); drop table if exists sys_dept; create table sys_dept ( dept_id bigint(20) not null auto_increment comment '部门id', parent_id bigint(20) default 0 comment '父部门id', ancestors varchar(50) default '' comment '祖级列表', dept_name varchar(30) default '' comment '部门名称', order_num int(4) default 0 comment '显示顺序', leader varchar(20) default null comment '负责人', phone varchar(11) default null comment '联系电话', email varchar(50) default null comment '邮箱', status char(1) default '0' comment '部门状态(0正常 1停用)', del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', create_by varchar(64) default '' comment '创建者', create_time datetime comment '创建时间', update_by varchar(64) default '' comment '更新者', update_time datetime comment '更新时间', primary key (dept_id) ) engine=innodb auto_increment=200 comment = '部门表'; insert into sys_dept values(100, 0, '0', '科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); ```