| | |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/audit") |
| | | @Operation(summary = "审核设计项目(待审核→待归档)") |
| | | @PutMapping("/submit-approval") |
| | | @Operation(summary = "提交设计项目审批(待审核→审批中)") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @Parameter(name = "processDefinitionKey", description = "流程定义 Key", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:pd-project:update')") |
| | | public CommonResult<Boolean> auditProject(@RequestParam("id") Long id) { |
| | | projectService.auditProject(id); |
| | | public CommonResult<Boolean> submitProjectApproval(@RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | projectService.submitProjectApproval(id, processDefinitionKey); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approve-process-list") |
| | | @Operation(summary = "获得设计项目审批流程列表") |
| | | @PreAuthorize("@ss.hasPermission('mes:pd-project:update')") |
| | | public CommonResult<List<Map<String, Object>>> getProjectApproveProcessDefinitionList() { |
| | | return success(projectService.getProjectApproveProcessDefinitionList()); |
| | | } |
| | | |
| | | @PutMapping("/archive") |
| | |
| | | // 1.1 批量获取关联数据(主设计师 + 审核人) |
| | | Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(convertSetByFlatMap(list, |
| | | project -> Stream.of(project.getChiefDesigner(), project.getReviewer()))); |
| | | // 1.2 批量获取各项目待审核文件数 |
| | | Map<Long, Integer> pendingAuditCountMap = projectService.getPendingAuditCountMap( |
| | | convertSet(list, MesPdProjectDO::getId)); |
| | | // 2. 拼接 VO |
| | | return BeanUtils.toBean(list, MesPdProjectRespVO.class, vo -> { |
| | | MapUtils.findAndThen(userMap, vo.getChiefDesigner(), |
| | | user -> vo.setChiefDesignerNickname(user.getNickname())); |
| | | MapUtils.findAndThen(userMap, vo.getReviewer(), |
| | | user -> vo.setReviewerNickname(user.getNickname())); |
| | | vo.setPendingAuditCount(pendingAuditCountMap.getOrDefault(vo.getId(), 0)); |
| | | }); |
| | | } |
| | | |