| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| | | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| | | |
| | | @Tag(name = "管理后台 - HRM 绩效考核方案") |
| | | @RestController |
| | |
| | | |
| | | // ========== 审批 ========== |
| | | |
| | | @PostMapping("/submit") |
| | | @Operation(summary = "提交绩效考核方案审批") |
| | | @PutMapping("/submit") |
| | | @Operation(summary = "提交审批(草稿/审核不通过→审批中),审批人由审批配置统一指定") |
| | | @Parameter(name = "id", description = "方案编号", required = true) |
| | | @Parameter(name = "processDefinitionKey", description = "流程定义Key", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:performance-appraise:submit')") |
| | | public CommonResult<Boolean> submitAppraise(@RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | appraiseService.submitAppraise(id, processDefinitionKey, getLoginUserId()); |
| | | @PreAuthorize("@ss.hasPermission('hrm:performance-appraise:update')") |
| | | public CommonResult<Boolean> submitAppraise(@RequestParam("id") Long id) { |
| | | appraiseService.submitAppraise(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/audit") |
| | | @Operation(summary = "审批绩效考核方案(通过/驳回)") |
| | | @Operation(summary = "审核(审批中→审核通过/审核不通过),仅审批人本人可操作") |
| | | @PreAuthorize("@ss.hasPermission('hrm:performance-appraise:audit')") |
| | | public CommonResult<Boolean> auditAppraise(@Valid @RequestBody HrmPerformanceAppraiseAuditReqVO auditReqVO) { |
| | | appraiseService.auditAppraise(auditReqVO); |
| | | appraiseService.auditAppraise(auditReqVO.getId(), auditReqVO.getPass(), auditReqVO.getReviewRemark()); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approve-process-list") |
| | | @Operation(summary = "获得绩效考核方案审批流程定义列表") |
| | | @GetMapping("/approver-ids") |
| | | @Operation(summary = "获得审批人编号集合,供前端判断是否展示审核按钮") |
| | | @PreAuthorize("@ss.hasPermission('hrm:performance-appraise:query')") |
| | | public CommonResult<List<Map<String, Object>>> getAppraiseApproveProcessDefinitionList() { |
| | | return success(appraiseService.getAppraiseApproveProcessDefinitionList()); |
| | | public CommonResult<Set<Long>> getApproverUserIds() { |
| | | return success(appraiseService.getAppraiseApproverUserIds()); |
| | | } |
| | | |
| | | // ========== 评分/结果 ========== |