更新模块初始化数据库文件

This commit is contained in:
hdm 2022-08-01 10:11:19 +08:00
parent 0d24b97555
commit 5d4afce0c0
3 changed files with 166 additions and 80 deletions

View File

@ -1,4 +1,3 @@
-- ----------------------------
-- Table structure for oa_contract_cate
-- ----------------------------
@ -7,8 +6,8 @@ CREATE TABLE `oa_contract_cate` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '合同类别名称',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '合同类别';
@ -34,7 +33,7 @@ CREATE TABLE `oa_contract` (
`cate_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分类id',
`type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '合同性质0未设置,1普通合同、2框架合同、3补充协议、4其他合同',
`subject_id` varchar(255) NOT NULL DEFAULT '' COMMENT '签约主体',
`customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '客户ID,预设数据',
`customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联客户ID,预设数据',
`customer` varchar(255) NOT NULL DEFAULT '' COMMENT '客户名称',
`customer_name` varchar(255) NOT NULL DEFAULT '' COMMENT '客户代表',
`customer_mobile` varchar(255) NOT NULL DEFAULT '' COMMENT '客户电话',
@ -51,7 +50,12 @@ CREATE TABLE `oa_contract` (
`cost` decimal(15, 2) NOT NULL DEFAULT 0.00 COMMENT '合同金额',
`is_tax` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否含税0未含税,1含税',
`tax` decimal(15, 2) NOT NULL DEFAULT 0.00 COMMENT '税点',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '合同状态0未设置,1已录入,2待审核,3已审核,4已中止,5已作废',
`check_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '合同状态0待审核,1审核中,2审核通过,3审核不通过,4撤销审核,5已中止,6已作废',
`check_step_sort` int(11) NOT NULL DEFAULT 0 COMMENT '当前审批步骤',
`check_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '当前审批人ID如:1,2,3',
`flow_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '历史审批人ID如:1,2,3',
`last_admin_id` varchar(200) NOT NULL DEFAULT '0' COMMENT '上一审批人',
`copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID如:1,2,3',
`check_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核人',
`check_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核时间',
`check_remark` text NULL COMMENT '审核备注信息',
@ -65,9 +69,9 @@ CREATE TABLE `oa_contract` (
`archive_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '归档人',
`archive_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '归档时间',
`remark` text NULL COMMENT '备注信息',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '合同表';
@ -80,9 +84,9 @@ CREATE TABLE `oa_contract_file` (
`contract_id` int(11) UNSIGNED NOT NULL COMMENT '关联合同id',
`file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '合同附件关联表';
@ -99,26 +103,9 @@ CREATE TABLE `oa_contract_log` (
`old_content` text NULL COMMENT '修改前的内容',
`new_content` text NULL COMMENT '修改后的内容',
`remark` text NULL COMMENT '补充备注',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '合同操作记录表';
-- ----------------------------
-- Table structure for oa_data_auth
-- ----------------------------
DROP TABLE IF EXISTS `oa_data_auth`;
CREATE TABLE `oa_data_auth` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '权限名称',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '权限标识唯一,字母',
`desc` text NULL COMMENT '备注描述',
`module` varchar(255) NOT NULL DEFAULT '' COMMENT '所属模块,唯一,字母',
`uids` text NULL COMMENT '权限用户1,2,3',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '数据权限表';
INSERT INTO `oa_data_auth` VALUES ((SELECT MAX(id) +1 FROM `oa_data_auth` a), '合同管理员','contract_admin','拥有该权限的员工可以查看、编辑、审核、作废、中止所有合同。', 'contract', '',0,0,0, 1656143065, 0);
INSERT INTO `oa_data_auth` VALUES ((SELECT MAX(id) +1 FROM `oa_data_auth` a), '合同管理员','contract_admin','拥有该权限的员工可以查看、编辑、作废、中止所有合同。', 'contract', '',0,0,0,'','','',1656143065, 0);

View File

@ -1,28 +1,3 @@
-- ----------------------------
-- Table structure for oa_industry
-- ----------------------------
DROP TABLE IF EXISTS `oa_industry`;
CREATE TABLE `oa_industry` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '行业名称',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '行业';
-- ----------------------------
-- Records of oa_industry
-- ----------------------------
INSERT INTO `oa_industry` VALUES (1, '工业品企业', 1, 1637987189, 0);
INSERT INTO `oa_industry` VALUES (2, '互联网企业', 1, 1637987199, 0);
INSERT INTO `oa_industry` VALUES (3, '服务行业', 1, 1637987199, 0);
INSERT INTO `oa_industry` VALUES (4, '消费品企业', 1, 1637987199, 0);
INSERT INTO `oa_industry` VALUES (5, '原材料企业', 1, 1637987199, 0);
INSERT INTO `oa_industry` VALUES (6, '农业企业', 1, 1637987199, 0);
INSERT INTO `oa_industry` VALUES (7, '科技企业', 1, 1637987199, 0);
INSERT INTO `oa_industry` VALUES (8, '其他行业', 1, 1637987199, 0);
-- ----------------------------
-- Table structure for oa_customer_grade
-- ----------------------------
@ -31,8 +6,8 @@ CREATE TABLE `oa_customer_grade` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户等级名称',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户等级';
@ -53,8 +28,55 @@ CREATE TABLE `oa_customer_source` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户渠道名称',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户来源';
-- ----------------------------
-- Records of oa_customer_source
-- ----------------------------
INSERT INTO `oa_customer_source` VALUES (1, '独立开发', 1, 1637987189, 0);
INSERT INTO `oa_customer_source` VALUES (2, '微信公众号', 1, 1637987199, 0);
INSERT INTO `oa_customer_source` VALUES (3, '今日头条', 1, 1637987199, 0);
INSERT INTO `oa_customer_source` VALUES (4, '百度搜索', 1, 1637987199, 0);
INSERT INTO `oa_customer_source` VALUES (5, '销售活动', 1, 1637987199, 0);
INSERT INTO `oa_customer_source` VALUES (6, '电话来访', 1, 1637987199, 0);
INSERT INTO `oa_customer_source` VALUES (7, '客户介绍', 1, 1637987199, 0);
INSERT INTO `oa_customer_source` VALUES (8, '其他来源', 1, 1637987199, 0);
-- ----------------------------
-- Table structure for oa_customer_grade
-- ----------------------------
DROP TABLE IF EXISTS `oa_customer_grade`;
CREATE TABLE `oa_customer_grade` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户等级名称',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户等级';
-- ----------------------------
-- Records of oa_customer_grade
-- ----------------------------
INSERT INTO `oa_customer_grade` VALUES (1, '普通客户', 1, 1637987189, 0);
INSERT INTO `oa_customer_grade` VALUES (2, 'VIP客户', 1, 1637987199, 0);
INSERT INTO `oa_customer_grade` VALUES (3, '白银客户', 1, 1637987199, 0);
INSERT INTO `oa_customer_grade` VALUES (4, '黄金客户', 1, 1637987199, 0);
INSERT INTO `oa_customer_grade` VALUES (5, '钻石客户', 1, 1637987199, 0);
-- ----------------------------
-- Table structure for oa_customer_source
-- ----------------------------
DROP TABLE IF EXISTS `oa_customer_source`;
CREATE TABLE `oa_customer_source` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '客户渠道名称',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户来源';
@ -103,9 +125,9 @@ CREATE TABLE `oa_customer` (
`tax_num` varchar(100) NOT NULL DEFAULT '' COMMENT '纳税人识别号',
`cperson_mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '开票电话',
`cperson_address` varchar(200) NOT NULL DEFAULT '' COMMENT '开票地址',
`discard_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '废弃时间',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
`discard_time` int(11) NOT NULL DEFAULT 0 COMMENT '废弃时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '客户表';
@ -125,9 +147,9 @@ CREATE TABLE `oa_customer_trace` (
`follow_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '跟进时间',
`next_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '下次跟进时间',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户跟进记录表';
@ -149,9 +171,9 @@ CREATE TABLE `oa_customer_contact` (
`department` varchar(50) NOT NULL DEFAULT '' COMMENT '部门',
`position` varchar(50) NOT NULL DEFAULT '' COMMENT '职务',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户联系人表';
@ -173,9 +195,9 @@ CREATE TABLE `oa_customer_chance` (
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`belong_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属人',
`assist_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '协助人员,如:1,2,3',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户销售机会表';
@ -188,9 +210,9 @@ CREATE TABLE `oa_customer_file` (
`customer_id` int(11) UNSIGNED NOT NULL COMMENT '关联客户id',
`file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户附件关联表';
@ -211,9 +233,8 @@ CREATE TABLE `oa_customer_log` (
`old_content` text NULL COMMENT '修改前的内容',
`new_content` text NULL COMMENT '修改后的内容',
`remark` text NULL COMMENT '补充备注',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '客户操作记录表';
INSERT INTO `oa_data_auth` VALUES ((SELECT MAX(id) +1 FROM `oa_data_auth` a), '客户管理员','customer_admin','拥有该权限的员工可以查看、转移所有客户。', 'customer', '',0,0,0, 1656143065, 0);
INSERT INTO `oa_data_auth` VALUES ((SELECT MAX(id) +1 FROM `oa_data_auth` a), '客户管理员','customer_admin','拥有该权限的员工可以查看、转移所有客户。', 'customer', '',10,0,0,'','','',1656143065, 0);

View File

@ -1,3 +1,39 @@
-- ----------------------------
-- Table structure for oa_step
-- ----------------------------
DROP TABLE IF EXISTS `oa_step`;
CREATE TABLE `oa_step` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action_id` int(11) NOT NULL COMMENT '关联ID',
`flow_name` varchar(255) NOT NULL DEFAULT '' COMMENT '阶段名称',
`flow_uid` int(11) NOT NULL DEFAULT 0 COMMENT '阶段负责人ID',
`flow_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '阶段成员ID (使用逗号隔开) 1,2,3',
`sort` tinyint(4) NOT NULL DEFAULT 0 COMMENT '排序ID',
`type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '阶段类型:1合同,2项目',
`start_time` int(11) NOT NULL DEFAULT 0 COMMENT '开始时间',
`end_time` int(11) NOT NULL DEFAULT 0 COMMENT '结束时间',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '阶段步骤表';
-- ----------------------------
-- Table structure for oa_step_record
-- ----------------------------
DROP TABLE IF EXISTS `oa_step_record`;
CREATE TABLE `oa_step_record` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联ID',
`step_id` int(11) NOT NULL DEFAULT 0 COMMENT '阶段步骤ID',
`check_uid` int(11) NOT NULL DEFAULT 0 COMMENT '审批人ID',
`check_time` int(11) NOT NULL COMMENT '审批时间',
`status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1审核通过2审核拒绝3撤销',
`type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '阶段类型:1合同,2项目',
`content` varchar(500) NOT NULL DEFAULT '' COMMENT '审核意见',
`delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '阶段步骤记录表';
-- ----------------------------
-- Table structure for oa_project
-- ----------------------------
@ -5,11 +41,14 @@ DROP TABLE IF EXISTS `oa_project`;
CREATE TABLE `oa_project` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '项目名称',
`customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联客户ID,预设数据',
`contract_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联合同协议ID',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目负责人',
`start_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目开始时间',
`end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目结束时间',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态状态0未设置,1未开始,2进行中,3已完成,4已关闭',
`step_sort` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '当前审核步骤',
`content` text NULL COMMENT '项目描述',
`md_content` text NULL COMMENT 'markdown项目描述',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
@ -48,6 +87,7 @@ CREATE TABLE `oa_project_task` (
`director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '指派给(负责人)',
`assist_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '协助人员,如:1,2,3',
`cate` tinyint(1) NOT NULL DEFAULT 1 COMMENT '所属工作类型',
`type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '任务类型:1需求,2设计,3研发,4缺陷',
`priority` tinyint(1) NOT NULL DEFAULT 1 COMMENT '优先级:1低,2中,3高,4紧急',
`flow_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '流转状态1待办的,2进行中,3已完成,4已拒绝,5已关闭',
`done_ratio` int(2) NOT NULL DEFAULT 0 COMMENT '完成进度0,20,40,50,60,80,100',
@ -57,7 +97,41 @@ CREATE TABLE `oa_project_task` (
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '任务表';
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目任务表';
-- ----------------------------
-- Table structure for oa_project_document
-- ----------------------------
DROP TABLE IF EXISTS `oa_project_document`;
CREATE TABLE `oa_project_document` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '标题',
`content` text NULL COMMENT '文档内容',
`md_content` text NULL COMMENT 'markdown文档内容',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目文档表';
-- ----------------------------
-- Table structure for oa_project_link
-- ----------------------------
DROP TABLE IF EXISTS `oa_project_link`;
CREATE TABLE `oa_project_link` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
`topic_id` int(11) UNSIGNED NOT NULL COMMENT '关联主题id',
`desc` varchar(255) NOT NULL DEFAULT '' COMMENT '说明',
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '链接',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '链接关联表';
-- ----------------------------
-- Table structure for oa_project_file
@ -100,15 +174,19 @@ CREATE TABLE `oa_project_comment` (
DROP TABLE IF EXISTS `oa_project_log`;
CREATE TABLE `oa_project_log` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块:project,task,document',
`action` varchar(100) NOT NULL DEFAULT 'edit' COMMENT '动作:add,edit,del,upload',
`field` varchar(100) NOT NULL DEFAULT '' COMMENT '字段',
`project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id',
`task_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联任务id',
`document_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联文档id',
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作人',
`old_content` text NULL COMMENT '修改前的内容',
`new_content` text NULL COMMENT '修改后的内容',
`remark` text NULL COMMENT '补充备注',
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目任务操作记录表';
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目任务操作记录表';
INSERT INTO `oa_data_auth` VALUES ((SELECT MAX(id) +1 FROM `oa_data_auth` a), '项目管理员','project_admin','拥有该权限的员工可以查看所有项目。', 'contract', '',0,0,0,'立项阶段|实施阶段|验收阶段|交付阶段','','',1656143065, 0);