## Hr Server项目结构 ```Project |—— api └── version1 └── empower |—— router |—— initialization └── database └── nosql └── app └── route |identification |—— config └── database └── nosql └── app |—— models |—— overall |—— middleware ``` ## Hr 文件结构说明 | 文件夹 | 说明 | 描述| |--------- |------ |-----| | `api` | api相关业务 | api业务实现 | | `--version1` | 业务版本文件夹 | 版本界定 | | `--empower` |OAuth 2.0 授权 |授权Token| | `router` | 路由器 | 业务路由设定 | | `initialization` | 初始化相关业务 | 系统初始化方面的实现 | | `--database` | 数据库业务 | 数据库业务初始化实现 | | `--nosql` | nosql数据库业务 | nosql业务初始化实现(例:Redis) | | `--app` | app数据库业务 | app业务初始化实现 | | `--route` | 路由初始化 | 路由初始化 | | `identification` | 授权验证器 | 授权验证器 | | `config` | 系统配置相关业务 | 系统系统配置方面的实现 | | `--database` | 数据库业务 | 数据库业务系统配置实现 | | `--nosql` | nosql数据库业务 | nosql业务系统配置实现(例:Redis) | | `--app` | app数据库业务 | app业务系统配置实现 | | `models` | 数据模型 | 数据库方面的配置 | | `overall` | 全局对象 | 全局对象| | `middleware` | 中间件 | 中间件 | ## 加密规则 ``` 1、分解步骤 one = md5(CodeString)+md5(AppKey) two = md5(one)+AppKey therr = md5(two) 2、合并 md5(md5(md5(CodeString)+md5(AppKey))+AppKey) ``` ## 接口访问规则 1、以POST方式访问 http://xxxx/empower/gaintoken #### 参数 ```json { "username":"jindie", "password":"jindie123" } ``` | 参数 | 说明 | |---------|---------| | username | 账号 | | password | 密码 | #### 返回值 ```json { "code": 0, "msg": "成功", "data": { "token": "6235a9de7109ba50852f3f9d3b3052ae", "number": "16534571868477" } } ``` | 参数 | 说明 | | |---------|---------|---------| | code | | 状态码 | | msg | | 信息 | | data | | 附加值 | | | token | Token(有效时间为180分钟) | | | number | 随机数 | 1、以POST方式访问 http://xxxx/接口 #### Header参数 | 参数 | 说明 | |---------|---------| | token | 获取到得参数 | | number | 加密后得随机数(参考加密规则) | | Content-Type | 内容类型 | | Origin | 站点信息 | | User-Agent | 用户代理 | #### Body参数 (接口需要得添加参数) ```json { "page":"1", "pagesize":"20" } ``` | 参数 | 说明 | |---------|---------| | page | 页码 | | pagesize | 每页显示多少条 | #### 返回值 ```json { "code": 0, "msg": "成功", "data": { "count": 20, "page": 1, "pageSize": 20, "total": 1147, "list": [] } } ``` | 参数 | 说明 | | |---------|---------|---------| | code | | 状态码 | | msg | | 信息 | | data | | 附加值 | | | count | 本页共多少数据 | | | page | 当前页码 | | | pageSize | 每页显示多少条 | | | .... | .... | ## 视图说明 | 视图名 | 说明 | |---------|---------| | duties_class_leve | 职务及类别和等级 | | org_cont_type | 行政组织及类别 | ## Log ``` 2022.04.19 建立人员信息相关数据模型 2022.04.20 处理员工档案的增删改查 ``` ``` 2022.06.13 创建人员档案主表 ``` ```mysql CREATE TABLE `person_archives` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `number` varchar(30) NOT NULL DEFAULT '' COMMENT '工号', `name` varchar(50) NOT NULL DEFAULT '', `icon` varchar(255) DEFAULT '' COMMENT '头像', `hire_class` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '雇佣类型(1:雇佣入职;2:再入职;)', `emp_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '用工关系(1:实习生;2:待分配;3:试用员工;4:正式员工;5:停薪留职;6:退休;7:辞退;8:离职)', `company` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '入职公司', `maindeparment` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '主部门', `deparment` text COMMENT '部门', `admin_org` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '所属行政组织', `position` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '职位', `job_class` bigint(20) unsigned DEFAULT '2' COMMENT '职务分类', `job_id` bigint(20) unsigned DEFAULT '0' COMMENT '职务', `job_leve` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '职务等级', `time` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '写入时间', `eite_time` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '编辑时间', `wechat` varchar(255) DEFAULT '' COMMENT '微信UserId', `work_wechat` varchar(255) DEFAULT '' COMMENT '企业微信UserId', `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(1:启用;2:禁用;3:删除)', `key` bigint(50) unsigned NOT NULL DEFAULT '0' COMMENT 'key', `is_admin` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管)', `password` varchar(255) DEFAULT '' COMMENT '密码', `role` longtext COMMENT '角色', PRIMARY KEY (`id`) USING BTREE, KEY `number` (`number`) USING BTREE, KEY `position` (`position`,`admin_org`,`company`) USING BTREE, KEY `key` (`key`) USING BTREE, FULLTEXT KEY `deparment` (`deparment`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='员工档案(主)'; ``` ``` 2022.06.14 人员主表写入 人员附表写入 双职工表编辑与写入 紧急联系人 员工家属 ```