| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | 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; |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/staff/analytics") |
| | | @Api(tags = "员工分析") |
| | | public class AnalyticsController { |
| | | |
| | | @Resource |
| | | private AnalyticsService analyticsService; |
| | | |
| | | @GetMapping("/reason") |
| | | @ApiOperation("员工离职原因分析") |
| | | @Log(title = "员工离职原因分析", businessType = BusinessType.OTHER) |
| | | public AjaxResult staffLeaveReasonAnalytics() { |
| | | return AjaxResult.success(analyticsService.staffLeaveReasonAnalytics()); |
| | | } |
| | | |
| | | @GetMapping("/monthly_turnover_rate") |
| | | @ApiOperation("12个月员工离职率分析") |
| | | @Log(title = "12个月员工离职率分析", businessType = BusinessType.OTHER) |
| | | public AjaxResult getMonthlyTurnoverRateFor12Months() { |
| | | return AjaxResult.success(analyticsService.getMonthlyTurnoverRateFor12Months()); |
| | | } |
| | | |
| | | @GetMapping("/total_statistic") |
| | | @ApiOperation("员工总统计分析") |
| | | @Log(title = "员工总统计分析", businessType = BusinessType.OTHER) |
| | | public AjaxResult getTotalStatistic() { |
| | | return AjaxResult.success(analyticsService.getTotalStatistic()); |
| | | } |