quuuuj/hrm

Hrm人事系统:Flowable审批流 + RAG知识库 + 智能问答

数智人事 (HRM System) – AI‑enhanced Human‑Resources Management

What it is

  • A full‑stack HRM (Human Resources Management) platform built with Spring Boot 3.4 (Java 17) on the back‑end and Vue 2.6 + Element UI on the front‑end.
  • Besides the usual HR functions (org chart, employee lifecycle, attendance, leave, overtime, payroll, social‑insurance, RBAC, workflow), it embeds a RAG‑based knowledge base that can answer employee HR questions using large‑language‑model (LLM) services (DashScope or OpenAI compatible).

Why it matters

  • Shows how a traditional enterprise system can be upgraded with generative‑AI features without rewriting the whole product.
  • Demonstrates a clean separation of pure‑calculation domain logic (overtime, salary) that can be unit‑tested independently of the framework.
  • Provides a ready‑to‑run example of integrating Flowable 8.0 workflow engine, Spring Security JWT double‑token auth, and a vector store (PostgreSQL + pgvector) for semantic search.

Core Features

Category Highlights
HR Core Org/department management, employee profile, fine‑grained RBAC, attendance & clock‑in, leave & overtime requests, payroll & social‑insurance configuration.
Workflow Flowable 8.0 native integration, separate MySQL DB for workflow data, listeners for side‑effects (e.g., leave balance updates).
AI‑Powered Q&A RAG pipeline: document upload → MinIO storage → chunking → embedding (DashScope/OpenAI) → pgvector vector DB → semantic retrieval → LLM‑generated answer with employee context (department, role).
Security HttpOnly double‑token (access + refresh) stored in cookies, transparent refresh via Axios interceptor, XSS‑resistant, Spring Security RBAC.
Infrastructure Multi‑engine persistence: MySQL (business), PostgreSQL + pgvector (vectors), Redis (cache & captcha), MinIO (object storage).
Observability Swagger‑UI (OpenAPI 3.1) auto‑generated docs, ECharts dashboards for attendance analytics.

Architecture at a Glance

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

  1. Start middleware
    docker compose -f docker/local/docker-compose.yml up -d
    
    (MySQL 8.1, Redis 5, PostgreSQL 16 with pgvector, MinIO)
  2. 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
    
  3. Configure AI credentials (optional for the smart Q&A)
    # create hrm-server/.env (see .env.example)
    LLM_API_KEY="your‑key"
    JWT_SECRET="random‑secret"
    LLM_BASE_URL="https://dashscope.aliyuncs.com/compatible-mode"
    LLM_CHAT_MODEL="qwen3.7-flash"
    LLM_EMBEDDING_MODEL="qwen3.7-text-embedding"
    
  4. Run the back‑end
    cd hrm-server
    mvn spring-boot:run   # starts on port 8888
    
    Swagger UI: http://localhost:8888/swagger-ui.html
  5. Run the front‑end
    cd hrm-admin
    npm ci
    npm run serve   # starts on port 8080
    
  6. Login
    • URL: http://localhost:8080
    • User: admin
    • Password: 123456
    • Captcha is stored in Redis; the UI fetches it automatically.

Typical Use Cases

  • Employee self‑service – view personal profile, submit leave/overtime, check payroll, query HR policies via the AI chat.
  • HR admin – manage org structure, configure RBAC, define approval processes, upload policy documents that become searchable by the RAG engine.
  • Manager – approve/reject requests, see attendance analytics, receive notifications generated by workflow listeners.
  • AI‑enhanced support – an employee asks “How many days of annual leave do I have left?” → system retrieves the relevant policy snippet, combines it with the employee’s leave balance, and the LLM returns a concise answer.

Who Might Benefit

  • SMEs & startups looking for a ready‑made, AI‑augmented HR platform that can be self‑hosted.
  • Enterprises that want to experiment with RAG‑based internal knowledge bases without building the pipeline from scratch.
  • Developers interested in seeing a real‑world integration of Flowable, Spring AI, and pgvector within a monolithic Spring Boot app.

License & Contribution

The README does not specify a license, so check the repository root for a LICENSE file before commercial use. Contributions appear welcome; the project includes a docs/ folder with development specs and test reports, and the back‑end is organized by domain, making it easy to add new modules or swap the LLM provider via configuration.


Bottom line: 数智人事 is a genuine, production‑grade HRM system that showcases how generative AI (RAG) can be layered on top of classic enterprise software, offering a concrete reference implementation for developers building AI‑enhanced business applications.

Related

  • Project
  • Project
  • Project
  • Project