xiaoyi
4 天以前 c9d4ba37c1f681b12e24014013fa9a28734bad42
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
package cn.iocoder.yudao.module.hrm.controller.admin.workhour;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.hrm.controller.admin.workhour.vo.HrmEmployeeWorkHourReqVO;
import cn.iocoder.yudao.module.hrm.controller.admin.workhour.vo.HrmEmployeeWorkHourRespVO;
import cn.iocoder.yudao.module.hrm.service.workhour.HrmWorkHourStatisticsService;
import cn.iocoder.yudao.module.mes.api.task.dto.MesProWorkHourSummaryReqDTO;
import cn.iocoder.yudao.module.mes.api.task.dto.MesProWorkHourSummaryRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - HRM 工时统计")
@RestController
@RequestMapping("/hrm/work-hour-statistics")
@Validated
public class HrmWorkHourStatisticsController {
 
    @Resource
    private HrmWorkHourStatisticsService workHourStatisticsService;
 
    @GetMapping("/employee-summary")
    @Operation(summary = "员工工时统计(考勤口径)")
    @PreAuthorize("@ss.hasPermission('hrm:work-hour-statistics:query')")
    public CommonResult<List<HrmEmployeeWorkHourRespVO>> getEmployeeWorkHourSummary(
            HrmEmployeeWorkHourReqVO reqVO) {
        return success(workHourStatisticsService.getEmployeeWorkHourSummary(reqVO));
    }
 
    @GetMapping("/team-summary")
    @Operation(summary = "班组工时统计(报工口径)")
    @PreAuthorize("@ss.hasPermission('hrm:work-hour-statistics:query')")
    public CommonResult<List<MesProWorkHourSummaryRespDTO>> getTeamWorkHourSummary(
            MesProWorkHourSummaryReqDTO reqDTO) {
        return success(workHourStatisticsService.getTeamWorkHourSummary(reqDTO));
    }
 
}