gaoluyang
2026-11-05 f3cac4aa2db56d6017c1d1dc035bcfeaec76c3e2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { requestClient } from '#/api/request';
 
export namespace HrmStatisticsApi {
  /** 分布项 */
  export interface Item {
    name: string;
    value: number;
  }
 
  /** 部门工龄统计 */
  export interface DeptTenure {
    deptId?: number;
    deptName: string;
    count: number;
    averageTenureYears: number;
  }
 
  /** 员工工龄明细 */
  export interface TenureEmployee {
    id: number;
    name: string;
    deptName: string;
    hireDate: string;
    tenureYears: number;
  }
 
  /** 入职 / 离职趋势项 */
  export interface Trend {
    month: string; // yyyy-MM
    hireCount: number; // 入职人数
    resignCount: number; // 离职人数
  }
 
  /** 员工人力统计 */
  export interface EmployeeStatistics {
    totalCount: number; // 在岗人数(在职 + 试用)
    activeCount: number; // 在职人数
    probationCount: number; // 试用人数
    resignedCount: number; // 离职人数
    averageTenureYears: number; // 平均工龄(年)
    averageAge: number; // 平均年龄(岁)
    thisYearHireCount: number; // 本年入职人数
    thisYearResignCount: number; // 本年离职人数
    tenureDistribution: Item[]; // 工龄分布
    ageDistribution: Item[]; // 年龄分布
    educationDistribution: Item[]; // 学历分布
    genderDistribution: Item[]; // 性别分布
    statusDistribution: Item[]; // 人员状态构成(在职 / 试用 / 离职)
    deptDistribution: Item[]; // 部门人数分布
    postDistribution: Item[]; // 岗位分布
    marriageDistribution: Item[]; // 婚姻状况分布
    politicalDistribution: Item[]; // 政治面貌分布
    hireResignTrend: Trend[]; // 近 12 个月入职 / 离职趋势
    contractWarning: Item[]; // 合同到期预警
    noContractCount: number; // 在岗未签有效合同人数
    deptTenureList: DeptTenure[]; // 部门工龄统计
    topTenureEmployees: TenureEmployee[]; // 工龄排行
  }
}
 
/** 获得员工人力统计 */
export function getTenureStatistics() {
  return requestClient.get<HrmStatisticsApi.EmployeeStatistics>(
    '/hrm/employee/tenure-statistics',
  );
}