|
@@ -1,7 +1,6 @@
|
|
|
package com.persagy.dmp.org.service;
|
|
|
|
|
|
import com.persagy.common.web.MapResponse;
|
|
|
-import com.persagy.dmp.config.DmpParameterStorage;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -20,9 +19,8 @@ public class InitService {
|
|
|
private DataSource dataSource;
|
|
|
|
|
|
@Transactional
|
|
|
- public MapResponse initGroup() {
|
|
|
+ public MapResponse initGroup(String groupCode) {
|
|
|
MapResponse resp = new MapResponse();
|
|
|
- String groupCode = DmpParameterStorage.getGroupCode();
|
|
|
String sql = null;
|
|
|
Connection connection = null;
|
|
|
Statement statement = null;
|
|
@@ -33,46 +31,57 @@ public class InitService {
|
|
|
|
|
|
|
|
|
sql = getCreateOrgCompanySql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgDeptSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgDeptClassifySql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgJobSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgJobClassifySql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgJobClassifyRelSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgProjectSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgCompanyProjectRelSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgUserSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgGroupAppRelSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
|
sql = getCreateOrgGroupFunctionRelSql(groupCode);
|
|
|
+ log.info(sql);
|
|
|
statement.executeUpdate(sql);
|
|
|
|
|
|
|
|
@@ -114,7 +123,7 @@ public class InitService {
|
|
|
" `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='公司';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -131,7 +140,7 @@ public class InitService {
|
|
|
" `project_id` varchar(60) NOT NULL COMMENT '项目ID',\n" +
|
|
|
" `group_code` varchar(80) DEFAULT NULL COMMENT '集团编码',\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司与项目关系';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司与项目关系'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -158,7 +167,7 @@ public class InitService {
|
|
|
" `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='部门';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -182,7 +191,7 @@ public class InitService {
|
|
|
" `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='部门分类';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门分类'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -208,7 +217,7 @@ public class InitService {
|
|
|
" `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='岗位';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -231,7 +240,7 @@ public class InitService {
|
|
|
" `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='岗位分类';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位分类'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -254,7 +263,7 @@ public class InitService {
|
|
|
" `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='岗位分类与应用功能关系';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='岗位分类与应用功能关系'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -275,7 +284,7 @@ public class InitService {
|
|
|
" `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='项目';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -310,7 +319,7 @@ public class InitService {
|
|
|
" `remark` varchar(500) DEFAULT NULL,\n" +
|
|
|
" `person_id` varchar(80) DEFAULT NULL,\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='人员账号';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='人员账号'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -332,7 +341,7 @@ public class InitService {
|
|
|
" `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='集团与应用关系';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集团与应用关系'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -354,7 +363,7 @@ public class InitService {
|
|
|
" `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='集团与功能关系';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集团与功能关系'";
|
|
|
return sql;
|
|
|
}
|
|
|
|
|
@@ -374,7 +383,7 @@ public class InitService {
|
|
|
" `error_info` json NOT NULL COMMENT '错误信息',\n" +
|
|
|
" `group_code` varchar(80) DEFAULT NULL COMMENT '集团编码',\n" +
|
|
|
" PRIMARY KEY (`id`) USING BTREE\n" +
|
|
|
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务执行记录';";
|
|
|
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务执行记录'";
|
|
|
return sql;
|
|
|
}
|
|
|
|