3 天以前 b852254d90e7d1955db31db154193ec8ee84d8b3
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
package cn.iocoder.yudao.module.hrm.controller.admin.workhour;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.hrm.controller.admin.workhour.vo.HrmWorkHourSummaryPageReqVO;
import cn.iocoder.yudao.module.hrm.controller.admin.workhour.vo.HrmWorkHourSummaryRespVO;
import cn.iocoder.yudao.module.hrm.service.workhour.HrmWorkHourSummaryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - HRM 月度工时汇总")
@RestController
@RequestMapping("/hrm/work-hour-summary")
@Validated
public class HrmWorkHourSummaryController {
 
    @Resource
    private HrmWorkHourSummaryService workHourSummaryService;
 
    @PostMapping("/generate-monthly")
    @Operation(summary = "生成月度工时汇总")
    @Parameter(name = "period", description = "核算周期,格式 yyyy-MM", required = true, example = "2026-08")
    @PreAuthorize("@ss.hasPermission('hrm:work-hour:generate')")
    public CommonResult<Boolean> generateMonthly(@RequestParam("period") String period) {
        workHourSummaryService.generateMonthly(period);
        return success(true);
    }
 
    @GetMapping("/page")
    @Operation(summary = "获得月度工时汇总分页")
    @PreAuthorize("@ss.hasPermission('hrm:work-hour:query')")
    public CommonResult<PageResult<HrmWorkHourSummaryRespVO>> getPage(
            @Valid HrmWorkHourSummaryPageReqVO pageReqVO) {
        return success(workHourSummaryService.getWorkHourSummaryPage(pageReqVO));
    }
 
}