| | |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceExceptionAuditReqVO; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceExceptionPageReqVO; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceExceptionRespVO; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceExceptionSaveReqVO; |
| | |
| | | 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 = "新增考勤异常申请") |
| | |
| | | respVO.setDeptName(dept.getName()); |
| | | } |
| | | } |
| | | respVO.setAttachmentList(storageAttachmentApi.listAttachments("hrm_attendance_exception", id)); |
| | | return success(respVO); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/submit") |
| | | @Operation(summary = "提交考勤异常申请") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:submit')") |
| | | public CommonResult<Boolean> submitAttendanceException( |
| | | @RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | // 获取当前登录用户ID |
| | | Long userId = cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId(); |
| | | attendanceExceptionService.submitAttendanceException(id, processDefinitionKey, userId); |
| | | @PutMapping("/submit") |
| | | @Operation(summary = "提交审批(草稿/审核不通过→审批中),审批人由审批配置统一指定") |
| | | @Parameter(name = "id", description = "申请ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:submit')") |
| | | public CommonResult<Boolean> submitAttendanceException(@RequestParam("id") Long id) { |
| | | attendanceExceptionService.submitAttendanceException(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/audit") |
| | | @Operation(summary = "审核(审批中→审核通过/审核不通过),仅审批人本人可操作") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:audit')") |
| | | public CommonResult<Boolean> auditAttendanceException(@Valid @RequestBody HrmAttendanceExceptionAuditReqVO auditReqVO) { |
| | | attendanceExceptionService.auditAttendanceException(auditReqVO.getId(), auditReqVO.getPass(), auditReqVO.getReviewRemark()); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approver-ids") |
| | | @Operation(summary = "获得审批人编号集合,供前端判断是否展示审核按钮") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | public CommonResult<Set<Long>> getApproverUserIds() { |
| | | return success(attendanceExceptionService.getAttendanceExceptionApproverUserIds()); |
| | | } |
| | | |
| | | } |