huminmin
10 天以前 eeeccc7389757ae4a766ab7267fcbc2b008faf9c
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
package com.ruoyi.staff.controller;
 
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.staff.service.AnalyticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
@RestController
@RequestMapping("/staff/analytics")
@Api(tags = "员工分析")
public class AnalyticsController {
 
    @Resource
    private AnalyticsService analyticsService;
 
    @ApiOperation("离职原因分析")
    @GetMapping("/reason")
    public AjaxResult staffLeaveReasonAnalytics() {
        return AjaxResult.success(analyticsService.staffLeaveReasonAnalytics());
    }
 
    @ApiOperation("12个月离职率分析")
    @GetMapping("/monthly_turnover_rate")
    public AjaxResult getMonthlyTurnoverRateFor12Months() {
        return AjaxResult.success(analyticsService.getMonthlyTurnoverRateFor12Months());
    }
 
    @ApiOperation("总统计分析")
    @GetMapping("/total_statistic")
    public AjaxResult getTotalStatistic() {
        return AjaxResult.success(analyticsService.getTotalStatistic());
    }
}