|
|
@@ -13,6 +13,12 @@ create table `ac_company` (
|
|
|
update_time datetime
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司';
|
|
|
|
|
|
+create table `ac_company_app` (
|
|
|
+ company_id int unsigned not null,
|
|
|
+ app_id varchar(100) not null,
|
|
|
+ primary key(company_id, app_id)
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司绑定应用';
|
|
|
+
|
|
|
create table `ac_account` (
|
|
|
id int unsigned primary key not null auto_increment,
|
|
|
username varchar(100) not null comment '账号',
|
|
|
@@ -21,7 +27,7 @@ create table `ac_account` (
|
|
|
realname varchar(100) comment '真实姓名',
|
|
|
email varchar(100) comment '邮箱',
|
|
|
mobile varchar(100) not null comment '手机号',
|
|
|
- type int comment '账户类型 0, 1',
|
|
|
+ type int comment '账户类型 0 - 管理账户, 1 - 普通账户',
|
|
|
enabled bool comment '是否启用',
|
|
|
creator_id int unsigned,
|
|
|
create_time datetime,
|
|
|
@@ -31,7 +37,8 @@ create table `ac_account` (
|
|
|
|
|
|
create table `ac_account_company` (
|
|
|
company_id int unsigned,
|
|
|
- account_id int unsigned
|
|
|
+ account_id int unsigned,
|
|
|
+ primary key(company_id, account_id)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户绑定企业';
|
|
|
|
|
|
create table `ac_role` (
|
|
|
@@ -39,6 +46,7 @@ create table `ac_role` (
|
|
|
code varchar(100) not null comment '编号',
|
|
|
name varchar(300) not null comment '名称',
|
|
|
description varchar(1000) comment '描述',
|
|
|
+ type int comment '角色类型 0 - 管理角色, 1 - 普通角色',
|
|
|
company_id int unsigned,
|
|
|
creator_id int unsigned,
|
|
|
create_time datetime,
|
|
|
@@ -48,40 +56,133 @@ create table `ac_role` (
|
|
|
|
|
|
create table `ac_account_role` (
|
|
|
account_id int unsigned,
|
|
|
- role_id int unsigned
|
|
|
+ role_id int unsigned,
|
|
|
+ primary key(account_id, role_id)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户绑定角色';
|
|
|
|
|
|
+create table `ac_resource_module` (
|
|
|
+ id int unsigned primary key not null auto_increment,
|
|
|
+ app_id varchar(100) comment '应用',
|
|
|
+ name varchar(100) comment '名称'
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源模块';
|
|
|
+
|
|
|
+create table `ac_resource_group` (
|
|
|
+ id int unsigned primary key not null auto_increment,
|
|
|
+ module_id int unsigned not null,
|
|
|
+ name varchar(100) comment '名称'
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源分组';
|
|
|
+
|
|
|
create table `ac_resource` (
|
|
|
id int unsigned primary key not null auto_increment,
|
|
|
- code varchar(100) not null comment '编号',
|
|
|
- name varchar(300) not null comment '名称',
|
|
|
- description varchar(1000) comment '描述',
|
|
|
+ group_id int unsigned not null,
|
|
|
+ name varchar(1000) comment '名称',
|
|
|
type varchar(100) comment '类型 MENU,BUTTON,API',
|
|
|
url varchar(300) comment 'URL',
|
|
|
method varchar(10) comment 'Http Method: POST/GET/PUT/DELETE',
|
|
|
- order_num int,
|
|
|
- company_id int unsigned,
|
|
|
- creator_id int unsigned,
|
|
|
- create_time datetime,
|
|
|
- updater_id int unsigned,
|
|
|
- update_time datetime
|
|
|
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色';
|
|
|
+ classify varchar(30) comment '分组'
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源';
|
|
|
|
|
|
create table `ac_role_resource` (
|
|
|
role_id int unsigned,
|
|
|
- resource_id int unsigned
|
|
|
+ resource_id int unsigned,
|
|
|
+ primary key(role_id, resource_id)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色绑定资源';
|
|
|
|
|
|
+# 账号
|
|
|
insert into ac_account(id,username,password,salt,realname,email,mobile,type,enabled,
|
|
|
creator_id,create_time,updater_id,update_time)
|
|
|
values (1,'18888888888','3e8451e274a8ee847872194e584a4145','18888888888','Administrator',
|
|
|
'admin@usoftchina.com', '18888888888', 0, 1, 1, now(), 1, now());
|
|
|
|
|
|
-insert into ac_company(name, business_code, address, logo_url, creator_id, create_time, updater_id, update_time)
|
|
|
-values ('测试账套', '000000000000000000','深圳市南山区粤海街道高新技术产业园科技南五路英唐大厦六楼',
|
|
|
+# 公司
|
|
|
+insert into ac_company(id, name, business_code, address, logo_url, creator_id, create_time, updater_id, update_time)
|
|
|
+values (1, '测试账套', '000000000000000000','深圳市南山区粤海街道高新技术产业园科技南五路英唐大厦六楼',
|
|
|
'https://co-image.qichacha.com/CompanyImage/104eb3c232bbac93393a5e204d6a47d1.jpg?x-oss-process=style/qcc_cmp',
|
|
|
1, now(), 1, now());
|
|
|
|
|
|
+insert into ac_company_app(company_id, app_id) values (1, 'trade-app');
|
|
|
insert into ac_account_company(account_id, company_id) values (1, 1);
|
|
|
|
|
|
+# 角色
|
|
|
+insert into ac_role(id,code,name,description,type,company_id,creator_id,create_time,updater_id,update_time)
|
|
|
+ values (1, 'ROLE_ADMIN', '管理员', '公司管理人员,拥有所有权限', 0, 1, 1, now(), 1, now());
|
|
|
+insert into ac_role(id,code,name,description,type,company_id,creator_id,create_time,updater_id,update_time)
|
|
|
+values (2, 'ROLE_NORMAL', '普通用户', '公司普通用户', 0, 1, 1, now(), 1, now());
|
|
|
+insert into ac_account_role(account_id, role_id) values (1, 1);
|
|
|
+
|
|
|
+# 资源模块
|
|
|
+insert into ac_resource_module(id, app_id, name) values (1, 'trade-app', '采购');
|
|
|
+insert into ac_resource_module(id, app_id, name) values (2, 'trade-app', '销售');
|
|
|
+insert into ac_resource_module(id, app_id, name) values (3, 'trade-app', '库存');
|
|
|
+insert into ac_resource_module(id, app_id, name) values (4, 'trade-app', '资金');
|
|
|
+insert into ac_resource_module(id, app_id, name) values (5, 'trade-app', '资料');
|
|
|
+# 资源组
|
|
|
+insert into ac_resource_group(id, module_id, name) values (1, 1, '采购单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (2, 1, '采购验收单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (3, 1, '采购验退单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (4, 1, '采购询价单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (5, 1, '采购明细表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (6, 1, '采购付款一览表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (7, 2, '销售订单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (8, 2, '销售出货单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (9, 2, '销售退货单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (10, 2, '以销定购');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (11, 2, '销售明细表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (12, 2, '销售收款一览表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (13, 2, '销售利润表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (14, 3, '调拨单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (15, 3, '制造单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (16, 3, '其它入库单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (17, 3, '其它出库单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (18, 3, '盘点单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (19, 3, '物料出入库明细表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (20, 3, '物料收发汇总表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (21, 3, '物料库存数量金额表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (22, 4, '付款单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (23, 4, '收款单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (24, 4, '核销单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (25, 4, '其它收支单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (26, 4, '资金转存');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (27, 4, '供应商对账单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (28, 4, '应付账款明细表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (29, 4, '客户对账单');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (30, 4, '应收款明细表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (31, 4, '资金账户余额表');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (32, 5, '客户资料');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (33, 5, '供应商管理');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (34, 5, '商品管理');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (35, 5, '仓库管理');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (36, 5, '职员管理');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (37, 5, '账户管理');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (38, 5, '发货地址管理');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (39, 5, '客户类别');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (40, 5, '供应商类别');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (41, 5, '商品类别');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (42, 5, '支出类别');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (43, 5, '收入类别');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (44, 5, '物料品牌');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (45, 5, '计量单位');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (46, 5, '结算方式');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (47, 5, '辅助属性');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (48, 5, '客户物料编码');
|
|
|
+insert into ac_resource_group(id, module_id, name) values (49, 5, '单据编码规则');
|
|
|
+# 资源
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (1,'查询',1,'MENU','/api/purchase/purchase/list','GET','QUERY');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (2,'新增',1,'MENU','/api/purchase/purchase/save','POST','ADD');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (3,'修改',1,'BUTTON','/api/purchase/purchase/save','POST','UPDATE');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (4,'审核',1,'BUTTON','/api/purchase/purchase/audit','POST','AUDIT');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (5,'审核',1,'BUTTON','/api/purchase/purchase/batchAudit','POST','AUDIT');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (6,'反审核',1,'BUTTON','/api/purchase/purchase/unAudit','POST','UNAUDIT');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (7,'反审核',1,'BUTTON','/api/purchase/purchase/batchUnAudit','POST','UNAUDIT');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (8,'删除',1,'BUTTON','/api/purchase/purchase/delete','GET','DELETE');
|
|
|
+insert into ac_resource(id, name, group_id, type, url, method, classify) values
|
|
|
+ (9,'打印',1,'BUTTON','/api/purchase/purchase/print','GET','PRINT');
|
|
|
|