feat(hrm): 添加请假统计功能
- 在控制器中新增 /stats 接口用于获取请假统计数据 - 新增 HrmLeaveStatsVo 数据传输对象定义统计结构 - 在数据访问层添加多个统计查询方法,包括按类型、部门、月份统计 - 实现服务层统计业务逻辑,包括请假汇总、分类统计、员工状态统计 - 配置 MyBatis 映射文件实现各维度统计 SQL 查询 - 添加员工总数和请假中员工数的统计功能
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
package com.ruoyi.hrm.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HrmLeaveStatsVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 总请假申请数
|
||||
*/
|
||||
private Integer totalLeaveRequests;
|
||||
|
||||
/**
|
||||
* 总请假时长(小时)
|
||||
*/
|
||||
private BigDecimal totalLeaveHours;
|
||||
|
||||
/**
|
||||
* 按请假类型统计
|
||||
*/
|
||||
private List<LeaveTypeStats> leaveByType;
|
||||
|
||||
/**
|
||||
* 按部门统计
|
||||
*/
|
||||
private List<DeptStats> leaveByDept;
|
||||
|
||||
/**
|
||||
* 按月份统计(本年)
|
||||
*/
|
||||
private List<MonthStats> leaveByMonth;
|
||||
|
||||
/**
|
||||
* 总员工数
|
||||
*/
|
||||
private Integer totalEmployees;
|
||||
|
||||
/**
|
||||
* 请假中员工数
|
||||
*/
|
||||
private Integer leavingEmployees;
|
||||
|
||||
@Data
|
||||
public static class LeaveTypeStats {
|
||||
private String leaveType;
|
||||
private Integer count;
|
||||
private BigDecimal totalHours;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DeptStats {
|
||||
private Long deptId;
|
||||
private String deptName;
|
||||
private Integer count;
|
||||
private BigDecimal totalHours;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class MonthStats {
|
||||
private String month; // YYYY-MM
|
||||
private Integer count;
|
||||
private BigDecimal totalHours;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user