| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| | | |
| | | @Tag(name = "管理后台 - SRM 供应商准入") |
| | | @RestController |
| | |
| | | } |
| | | |
| | | @PutMapping("/submit") |
| | | @Operation(summary = "提交申请") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @Operation(summary = "提交准入申请审批(启动协同办公流程)") |
| | | @PreAuthorize("@ss.hasPermission('srm:supplier-apply:update')") |
| | | public CommonResult<Boolean> submitApply(@RequestParam("id") Long id) { |
| | | applyService.submitApply(id); |
| | | public CommonResult<Boolean> submitApply(@RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | applyService.submitApply(id, processDefinitionKey, getLoginUserId()); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/review-purchase") |
| | | @Operation(summary = "采购审核") |
| | | @PreAuthorize("@ss.hasPermission('srm:supplier-apply:update')") |
| | | public CommonResult<Boolean> reviewPurchase(@Valid @RequestBody SrmSupplierApplyReviewReqVO reqVO) { |
| | | applyService.reviewPurchase(reqVO.getId(), reqVO.getOpinion(), reqVO.getPassed()); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/review-quality") |
| | | @Operation(summary = "质量审核") |
| | | @PreAuthorize("@ss.hasPermission('srm:supplier-apply:update')") |
| | | public CommonResult<Boolean> reviewQuality(@Valid @RequestBody SrmSupplierApplyReviewReqVO reqVO) { |
| | | applyService.reviewQuality(reqVO.getId(), reqVO.getOpinion(), reqVO.getPassed()); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/review-finance") |
| | | @Operation(summary = "财务审核") |
| | | @PreAuthorize("@ss.hasPermission('srm:supplier-apply:update')") |
| | | public CommonResult<Boolean> reviewFinance(@Valid @RequestBody SrmSupplierApplyReviewReqVO reqVO) { |
| | | applyService.reviewFinance(reqVO.getId(), reqVO.getOpinion(), reqVO.getPassed()); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/approve") |
| | | @Operation(summary = "通过后自动创建供应商") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('srm:supplier-apply:update')") |
| | | public CommonResult<Boolean> approve(@RequestParam("id") Long id) { |
| | | applyService.approve(id); |
| | | return success(true); |
| | | @GetMapping("/approve-process-list") |
| | | @Operation(summary = "获取准入申请审批流程列表") |
| | | @PreAuthorize("@ss.hasPermission('srm:supplier-apply:query')") |
| | | public CommonResult<List<Map<String, Object>>> getApproveProcessList() { |
| | | return success(applyService.getSupplierApplyApproveProcessDefinitionList()); |
| | | } |
| | | |
| | | } |