| | |
| | | |
| | | @PostMapping("/clock-in") |
| | | @Operation(summary = "上班打卡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:clock')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:clock')") |
| | | public CommonResult<HrmAttendanceRecordRespVO> clockIn(@RequestParam("location") String location) { |
| | | Long loginUserId = getLoginUserId(); |
| | | HrmEmployeeDO employee = employeeService.getEmployeeByUserId(loginUserId); |
| | |
| | | |
| | | @PostMapping("/clock-out") |
| | | @Operation(summary = "下班打卡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:clock')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:clock')") |
| | | public CommonResult<HrmAttendanceRecordRespVO> clockOut(@RequestParam("location") String location) { |
| | | Long loginUserId = getLoginUserId(); |
| | | HrmEmployeeDO employee = employeeService.getEmployeeByUserId(loginUserId); |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得考勤记录分页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:query')") |
| | | public CommonResult<PageResult<HrmAttendanceRecordRespVO>> getAttendanceRecordPage(@Valid HrmAttendanceRecordPageReqVO pageReqVO) { |
| | | PageResult<HrmAttendanceRecordDO> pageResult = attendanceRecordService.getAttendanceRecordPage(pageReqVO); |
| | | // 转换为 VO |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得考勤记录") |
| | | @Parameter(name = "id", description = "记录ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:query')") |
| | | public CommonResult<HrmAttendanceRecordRespVO> getAttendanceRecord(@RequestParam("id") Long id) { |
| | | HrmAttendanceRecordDO attendanceRecord = attendanceRecordService.getAttendanceRecord(id); |
| | | if (attendanceRecord == null) { |
| | |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导出考勤记录 Excel") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:export')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportAttendanceRecordExcel(@Valid HrmAttendanceRecordPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |