quuuuj/hrm
Hrm人事系统:Flowable审批流 + RAG知识库 + 智能问答
数智人事 (HRM System) – AI 增强的人力资源管理
项目简介
- 一个全栈 HRM(人力资源管理)平台,后端基于 Spring Boot 3.4(Java 17),前端基于 Vue 2.6 + Element UI。
- 除常规 HR 功能(组织架构、员工生命周期、考勤、请假、加班、薪资、社保、RBAC、工作流)外,还嵌入了 基于 RAG 的知识库,可使用大语言模型(LLM)服务(DashScope 或兼容 OpenAI 的服务)回答员工的人力资源问题。
项目价值
- 展示了如何在无需重写整个产品的情况下,用生成式 AI 功能升级传统企业系统。
- 演示了纯计算领域逻辑(加班、薪资)与框架解耦的清晰分层,可独立进行单元测试。
- 提供了一个开箱即用的示例,集成 Flowable 8.0 工作流引擎、Spring Security JWT 双令牌认证,以及用于语义搜索的 向量存储(PostgreSQL + pgvector)。
核心功能
| 分类 | 亮点 |
|---|---|
| HR 核心 | 组织/部门管理、员工档案、细粒度 RBAC、考勤与打卡、请假与加班申请、薪资与社保配置。 |
| 工作流 | Flowable 8.0 原生集成,工作流数据独立 MySQL 库,监听器处理副作用(如假期余额更新)。 |
| AI 智能问答 | RAG 流水线:文档上传 → MinIO 存储 → 分块 → 向量化(DashScope/OpenAI)→ pgvector 向量库 → 语义检索 → LLM 结合员工上下文(部门、角色)生成回答。 |
| 安全 | HttpOnly 双令牌(access + refresh)存于 Cookie,Axios 拦截器透明刷新,防 XSS,Spring Security RBAC。 |
| 基础设施 | 多引擎持久化:MySQL(业务)、PostgreSQL + pgvector(向量)、Redis(缓存与验证码)、MinIO(对象存储)。 |
| 可观测性 | Swagger‑UI(OpenAPI 3.1)自动生成文档,ECharts 仪表盘用于考勤分析。 |
架构一览
graph TB
subgraph Front[Vue 2.6 + Element UI]
UI[UI components] --> Router[Vue‑Router (dynamic menus)]
Router --> Store[Vuex (user, token, permissions)]
Store --> Axios[Axios (double‑token refresh)]
end
subgraph Auth[Spring Security]
JWT[JwtAuthenticationFilter] --> RBAC[RBAC checks]
end
subgraph Backend[Spring Boot 3.4]
Service[Application services] --> Domain[Pure‑calc modules (OvertimeCalculator, SalaryCalculation)]
Service --> Flowable[Flowable engine (MySQL flowable DB)]
Service --> Knowledge[KnowledgeService (ETL, vector store)]
Service --> Chat[AI Assistant (LLM & embedding)]
end
subgraph Storage[Persistence]
MySQL[(MySQL – business)]
FlowDB[(MySQL – flowable)]
PG[(PostgreSQL + pgvector – vectors)]
Redis[(Redis – cache/captcha)]
MinIO[(MinIO – files)]
end
Front -->|HTTP/REST| JWT --> Auth --> Service
Service --> MySQL
Service --> FlowDB
Knowledge --> MinIO
Knowledge --> PG
Chat --> LLM[Configurable LLM]
Chat -.retrieval.-> PG
Tech Stack
| Layer | Tools & Versions |
|---|---|
| Language | Java 17, JavaScript (ES6) |
| Back‑end Framework | Spring Boot 3.4.4, Spring Security 6.x, MyBatis‑Plus 3.5.10 |
| Workflow Engine | Flowable 8.0.0 |
| AI Integration | Spring AI 1.0.0 (spring‑ai‑alibaba 1.0.0.2), compatible with DashScope or OpenAI APIs |
| Vector Store | PostgreSQL 16 + pgvector extension |
| Cache / Session | Redis 5.0 |
| Object Storage | MinIO (S3‑compatible) |
| Front‑end | Vue 2.6.14, Element UI 2.15.7, Vue‑Router 3.2, Vuex 3.6, Axios 0.25, ECharts 5.3 |
| Containerisation | Docker Compose (MySQL, Redis, PostgreSQL, MinIO) |
| Docs / API | SpringDoc OpenAPI 2.8 (Swagger UI) |
Getting Started Locally
- Start middleware
(MySQL 8.1, Redis 5, PostgreSQL 16 with pgvector, MinIO)docker compose -f docker/local/docker-compose.yml up -d - Import DB schemas
mysql -h 127.0.0.1 -P 3306 -uroot -p123456 hrm < db/mysql/hrm.sql mysql -h 127.0.0.1 -P 3306 -uroot -p123456 hrm_flowable < db/mysql/hrm_flowable.sql psql -h 127.0.0.1 -p 5432 -U hrm -d hrm_kb -f db/postgresql/knowledge_base.sql - Configure AI credentials (optional for the smart Q&A)
# create hrm-server/.env (see .env.example) LLM_API_KEY=
相关
- 项目
- 项目
- 项目
- 项目