| | |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| | | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.plan.ErpPurchasePlanAuditReqVO; |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.plan.ErpPurchasePlanPageReqVO; |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.plan.ErpPurchasePlanRespVO; |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.plan.ErpPurchasePlanSaveReqVO; |
| | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | |
| | | } |
| | | |
| | | @PutMapping("/submit") |
| | | @Operation(summary = "提交采购计划审批") |
| | | @Operation(summary = "提交采购计划审核(草稿/审核不通过 → 审批中)") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-plan:submit')") |
| | | public CommonResult<Boolean> submitPurchasePlan(@RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | Long userId = getLoginUserId(); |
| | | purchasePlanService.submitPurchasePlan(id, processDefinitionKey, userId); |
| | | public CommonResult<Boolean> submitPurchasePlan(@RequestParam("id") Long id) { |
| | | purchasePlanService.submitPurchasePlan(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approve-process-list") |
| | | @Operation(summary = "获取采购计划审批流程列表") |
| | | @PutMapping("/audit") |
| | | @Operation(summary = "审核采购计划(审批中 → 审核通过/审核不通过),仅审批人本人可操作") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-plan:audit')") |
| | | public CommonResult<Boolean> auditPurchasePlan(@Valid @RequestBody ErpPurchasePlanAuditReqVO auditReqVO) { |
| | | purchasePlanService.auditPurchasePlan(auditReqVO.getId(), auditReqVO.getPass(), |
| | | auditReqVO.getReviewRemark()); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approver-ids") |
| | | @Operation(summary = "获得采购计划的审批人编号集合,供前端判断是否展示审核按钮") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-plan:query')") |
| | | public CommonResult<List<Map<String, Object>>> getApproveProcessList() { |
| | | return success(purchasePlanService.getPurchasePlanApproveProcessDefinitionList()); |
| | | public CommonResult<Set<Long>> getApproverUserIds() { |
| | | return success(purchasePlanService.getPurchasePlanApproverUserIds()); |
| | | } |
| | | |
| | | @PostMapping("/generate-from-stock-alert") |