gaoluyang
昨天 8c65f898ed6e5b0c7a94c792c4562f6ec831dccd
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.mes.controller.admin.pro.worktime;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.mes.controller.admin.pro.worktime.vo.MesProWorktimeCalcReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.pro.worktime.vo.MesProWorktimeCalcRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.pro.worktime.vo.MesProWorktimeReportReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.pro.worktime.vo.MesProWorktimeReportRespVO;
import cn.iocoder.yudao.module.mes.service.pro.worktime.MesProWorktimeReportService;
import cn.iocoder.yudao.module.mes.service.pro.worktime.MesProWorktimeService;
import io.swagger.v3.oas.annotations.Operation;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - MES 工时考核")
@RestController
@RequestMapping("/mes/pro/worktime")
@Validated
public class MesProWorktimeController {
 
    @Resource
    private MesProWorktimeService worktimeService;
    @Resource
    private MesProWorktimeReportService worktimeReportService;
 
    @PostMapping("/calculate")
    @Operation(summary = "试算标准工时", description = "报工表单录入生产长度与辅助项次数后实时试算,不落库")
    @PreAuthorize("@ss.hasPermission('mes:pro-feedback:create')")
    public CommonResult<MesProWorktimeCalcRespVO> calculate(@Valid @RequestBody MesProWorktimeCalcReqVO reqVO) {
        return success(worktimeService.calculate(reqVO));
    }
 
    @GetMapping("/report")
    @Operation(summary = "获得工时考核报表", description = "按人/工序/机台/日期汇总实际工时、标准工时与差异")
    @PreAuthorize("@ss.hasPermission('mes:pro-worktime-report:query')")
    public CommonResult<MesProWorktimeReportRespVO> getReport(@Valid MesProWorktimeReportReqVO reqVO) {
        return success(worktimeReportService.getReport(reqVO));
    }
 
}