| | |
| | | import cn.iocoder.yudao.module.hrm.service.employee.HrmEmployeeService; |
| | | import cn.iocoder.yudao.module.system.api.dept.DeptApi; |
| | | import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | private HrmEmployeeService employeeService; |
| | | @Resource |
| | | private DeptApi deptApi; |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "新增考勤异常申请") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:create')") |
| | | public CommonResult<Long> createAttendanceException(@Valid @RequestBody HrmAttendanceExceptionSaveReqVO createReqVO) { |
| | | return success(attendanceExceptionService.createAttendanceException(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新考勤异常申请") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:update')") |
| | | public CommonResult<Boolean> updateAttendanceException(@Valid @RequestBody HrmAttendanceExceptionSaveReqVO updateReqVO) { |
| | | attendanceExceptionService.updateAttendanceException(updateReqVO); |
| | | return success(true); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除考勤异常申请") |
| | | @Parameter(name = "id", description = "申请ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:delete')") |
| | | public CommonResult<Boolean> deleteAttendanceException(@RequestParam("id") Long id) { |
| | | attendanceExceptionService.deleteAttendanceException(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得考勤异常申请") |
| | | @Parameter(name = "id", description = "申请ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:query')") |
| | | public CommonResult<HrmAttendanceExceptionRespVO> getAttendanceException(@RequestParam("id") Long id) { |
| | | HrmAttendanceExceptionDO attendanceException = attendanceExceptionService.getAttendanceException(id); |
| | | if (attendanceException == null) { |
| | |
| | | respVO.setDeptName(dept.getName()); |
| | | } |
| | | } |
| | | respVO.setAttachmentList(storageAttachmentApi.listAttachments("hrm_attendance_exception", id)); |
| | | return success(respVO); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得考勤异常申请分页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:query')") |
| | | public CommonResult<PageResult<HrmAttendanceExceptionRespVO>> getAttendanceExceptionPage(@Valid HrmAttendanceExceptionPageReqVO pageReqVO) { |
| | | PageResult<HrmAttendanceExceptionDO> pageResult = attendanceExceptionService.getAttendanceExceptionPage(pageReqVO); |
| | | List<HrmAttendanceExceptionRespVO> list = BeanUtils.toBean(pageResult.getList(), HrmAttendanceExceptionRespVO.class); |
| | |
| | | |
| | | @PostMapping("/submit") |
| | | @Operation(summary = "提交考勤异常申请") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:submit')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:submit')") |
| | | public CommonResult<Boolean> submitAttendanceException( |
| | | @RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |