quuuuj/hrm
Hrm人事系统:Flowable审批流 + RAG知识库 + 智能问答
数智人事 (HRM System) – AI強化型人事管理
概要
- Spring Boot 3.4(Java 17)をバックエンド、Vue 2.6 + Element UI をフロントエンドに採用したフルスタックHRM(人事管理)プラットフォームです。
- 通常の人事機能(組織図、従業員ライフサイクル、勤怠、休暇、残業、給与、社会保険、RBAC、ワークフロー)に加え、大規模言語モデル(LLM)サービス(DashScope または OpenAI 互換)を利用して従業員の人事関連の質問に回答できるRAGベースのナレッジベースを組み込んでいます。
重要性
- 製品全体を書き直すことなく、従来のエンタープライズシステムに生成AI機能を追加できる方法を示しています。
- フレームワークから独立してユニットテスト可能な純計算ドメインロジック(残業、給与)の明確な分離を示しています。
- Flowable 8.0 ワークフローエンジン、Spring Security JWT ダブルトークン認証、セマンティック検索用の**ベクターストア(PostgreSQL + pgvector)**の統合の、すぐに実行可能な例を提供します。
コア機能
| カテゴリ | 概要 |
|---|---|
| HRコア | 組織/部門管理、従業員プロフィール、きめ細かいRBAC、勤怠・打刻、休暇・残業申請、給与・社保設定。 |
| ワークフロー | Flowable 8.0 ネイティブ統合、ワークフローデータ用の独立したMySQL DB、副作用(例:休暇残数の更新)のためのリスナー。 |
| AI搭載Q&A | RAGパイプライン:ドキュメントアップロード → MinIO保存 → チャンク分割 → 埋め込み(DashScope/OpenAI)→ pgvectorベクトルDB → セマンティック検索 → 従業員コンテキスト(部門、役割)を含むLLM生成回答。 |
| セキュリティ | HttpOnlyダブルトークン(アクセス+リフレッシュ)を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=
関連
- プロジェクト
- プロジェクト
- プロジェクト
- プロジェクト