|
@@ -35,45 +35,45 @@ public class InitService {
|
|
|
sql = getCreateOrgCompanySql(groupCode);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
-// /** 部门 */
|
|
|
-// sql = getCreateOrgDeptSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 部门分类 */
|
|
|
-// sql = getCreateOrgDeptClassifySql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 岗位 */
|
|
|
-// sql = getCreateOrgJobSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 岗位分类 */
|
|
|
-// sql = getCreateOrgJobClassifySql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 岗位分类关系 */
|
|
|
-// sql = getCreateOrgJobClassifyRelSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 项目表 */
|
|
|
-// sql = getCreateOrgProjectSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 公司与项目关系表 */
|
|
|
-// sql = getCreateOrgCompanyProjectRelSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 人员表 */
|
|
|
-// sql = getCreateOrgUserSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 集团与应用关系表 */
|
|
|
-// sql = getCreateOrgGroupAppRelSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
-//
|
|
|
-// /** 集团与功能关系表 */
|
|
|
-// sql = getCreateOrgGroupFunctionRelSql(groupCode);
|
|
|
-// statement.executeUpdate(sql);
|
|
|
+ /** 部门 */
|
|
|
+ sql = getCreateOrgDeptSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 部门分类 */
|
|
|
+ sql = getCreateOrgDeptClassifySql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 岗位 */
|
|
|
+ sql = getCreateOrgJobSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 岗位分类 */
|
|
|
+ sql = getCreateOrgJobClassifySql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 岗位分类关系 */
|
|
|
+ sql = getCreateOrgJobClassifyRelSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 项目表 */
|
|
|
+ sql = getCreateOrgProjectSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 公司与项目关系表 */
|
|
|
+ sql = getCreateOrgCompanyProjectRelSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 人员表 */
|
|
|
+ sql = getCreateOrgUserSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 集团与应用关系表 */
|
|
|
+ sql = getCreateOrgGroupAppRelSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
+
|
|
|
+ /** 集团与功能关系表 */
|
|
|
+ sql = getCreateOrgGroupFunctionRelSql(groupCode);
|
|
|
+ statement.executeUpdate(sql);
|
|
|
|
|
|
/** 任务 */
|
|
|
/** 任务配置表 */
|
|
@@ -109,9 +109,9 @@ public class InitService {
|
|
|
" `parent_id` varchar(80) DEFAULT NULL COMMENT '上级公司ID',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL COMMENT '备注',\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司';";
|
|
@@ -153,9 +153,9 @@ public class InitService {
|
|
|
" `manager` varchar(80) NOT NULL COMMENT '部门负责人',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门';";
|
|
@@ -177,9 +177,9 @@ public class InitService {
|
|
|
" `group_code` varchar(80) NOT NULL COMMENT '集团ID',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门分类';";
|
|
@@ -203,9 +203,9 @@ public class InitService {
|
|
|
" `resource_from` varchar(80) DEFAULT NULL COMMENT '部门来源',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位';";
|
|
@@ -226,9 +226,9 @@ public class InitService {
|
|
|
" `order_num` int(11) NOT NULL COMMENT '排序',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位分类';";
|
|
@@ -249,9 +249,9 @@ public class InitService {
|
|
|
" `group_code` varchar(80) NOT NULL COMMENT '集团编码',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位分类与应用功能关系';";
|
|
@@ -270,9 +270,9 @@ public class InitService {
|
|
|
" `group_code` varchar(80) NOT NULL COMMENT '集团编码',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目';";
|
|
@@ -294,19 +294,19 @@ public class InitService {
|
|
|
" `gender` int(11) DEFAULT NULL COMMENT '性别',\n" +
|
|
|
" `phone` varchar(80) DEFAULT NULL COMMENT '手机号',\n" +
|
|
|
" `mail` varchar(80) DEFAULT NULL COMMENT '邮箱',\n" +
|
|
|
- " `birthday` timestamp NULL DEFAULT NULL COMMENT '生日',\n" +
|
|
|
+ " `birthday` date NULL DEFAULT NULL COMMENT '生日',\n" +
|
|
|
" `head_portrait` varchar(80) DEFAULT NULL COMMENT '头像',\n" +
|
|
|
" `other_account` varchar(80) DEFAULT NULL COMMENT '第三方账号',\n" +
|
|
|
" `user_from` varchar(80) DEFAULT NULL COMMENT '账号来源',\n" +
|
|
|
" `group_code` varchar(80) NOT NULL,\n" +
|
|
|
" `is_admin` varchar(80) DEFAULT NULL COMMENT '是否为PERSAGYADMIN',\n" +
|
|
|
- " `last_login_time` timestamp NULL DEFAULT NULL COMMENT '最后登录时间',\n" +
|
|
|
+ " `last_login_time` datetime NULL DEFAULT NULL COMMENT '最后登录时间',\n" +
|
|
|
" `last_ip` varchar(20) DEFAULT NULL COMMENT '最后登录ip地址',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" `person_id` varchar(80) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
@@ -327,9 +327,9 @@ public class InitService {
|
|
|
" `authority_type` int(11) DEFAULT NULL COMMENT '权限类型(0-权限集,1-权限包)',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL COMMENT '备注',\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集团与应用关系';";
|
|
@@ -349,42 +349,15 @@ public class InitService {
|
|
|
" `authority_type` varchar(255) DEFAULT NULL COMMENT '权限类型(0-权限集,1-权限包)',\n" +
|
|
|
" `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
" `create_user` varchar(80) DEFAULT NULL COMMENT '创建用户',\n" +
|
|
|
- " `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',\n" +
|
|
|
" `update_user` varchar(80) DEFAULT NULL COMMENT '更新用户',\n" +
|
|
|
- " `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',\n" +
|
|
|
+ " `create_time` timestamp default current_timestamp comment '创建时间', \n" +
|
|
|
+ " `update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间', \n" +
|
|
|
" `remark` varchar(500) DEFAULT NULL COMMENT '备注',\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集团与功能关系\\n';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集团与功能关系';";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 任务配置表
|
|
|
- * @param groupCode
|
|
|
- * @return
|
|
|
- */
|
|
|
- private String getCreateTaskCfgSql(String groupCode) {
|
|
|
- String sql = "CREATE TABLE `dpt_task_cfg` (\n" +
|
|
|
- " `id` varchar(80) NOT NULL,\n" +
|
|
|
- " `group_code` varchar(20) DEFAULT NULL COMMENT '集团编码',\n" +
|
|
|
- " `app_id` varchar(80) DEFAULT NULL COMMENT '应用编码',\n" +
|
|
|
- " `project_id` varchar(40) DEFAULT NULL COMMENT '项目ID',\n" +
|
|
|
- " `code` varchar(20) NOT NULL COMMENT '任务编码',\n" +
|
|
|
- " `name` varchar(40) NOT NULL COMMENT '任务名称',\n" +
|
|
|
- " `type` varchar(20) NOT NULL COMMENT '执行方式:http、jms',\n" +
|
|
|
- " `config` json NOT NULL COMMENT '执行方式配置参数',\n" +
|
|
|
- " `params` json NOT NULL COMMENT '调起参数',\n" +
|
|
|
- " `time_rule` json NOT NULL COMMENT '调起频率',\n" +
|
|
|
- " `start_time` timestamp NULL DEFAULT NULL COMMENT '开始时间',\n" +
|
|
|
- " `end_time` timestamp NULL DEFAULT NULL COMMENT '结束时间',\n" +
|
|
|
- " `response_time` int(11) NOT NULL COMMENT '任务接口的处理时长,用于任务启停消峰控制',\n" +
|
|
|
- " `level` varchar(20) NOT NULL COMMENT '优先级,用于任务启停消峰控制',\n" +
|
|
|
- " `status` int(11) NOT NULL COMMENT '状态',\n" +
|
|
|
- " `remark` varchar(200) DEFAULT NULL COMMENT '备注',\n" +
|
|
|
- " PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务配置';";
|
|
|
- return sql;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 任务记录表
|
|
@@ -395,8 +368,8 @@ public class InitService {
|
|
|
String sql = "CREATE TABLE `dpt_task_record` (\n" +
|
|
|
" `id` varchar(40) NOT NULL,\n" +
|
|
|
" `task_id` varchar(40) NOT NULL COMMENT '任务配置ID',\n" +
|
|
|
- " `start_time` timestamp NULL DEFAULT NULL COMMENT '开始时间',\n" +
|
|
|
- " `end_time` timestamp NULL DEFAULT NULL COMMENT '结束时间',\n" +
|
|
|
+ " `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',\n" +
|
|
|
+ " `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',\n" +
|
|
|
" `success` int(11) NOT NULL COMMENT '1是,0否,否表示发生了异常',\n" +
|
|
|
" `error_info` json NOT NULL COMMENT '错误信息',\n" +
|
|
|
" `group_code` varchar(80) DEFAULT NULL COMMENT '集团编码',\n" +
|