| | |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMultiMap; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| | | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| | | |
| | | @Tag(name = "管理后台 - ERP 采购订单") |
| | | @RestController |
| | |
| | | @RequestParam("status") Integer status) { |
| | | purchaseOrderService.updatePurchaseOrderStatus(id, status); |
| | | return success(true); |
| | | } |
| | | |
| | | @PostMapping("/submit") |
| | | @Operation(summary = "提交采购订单审批") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-order:update-status')") |
| | | public CommonResult<Boolean> submitPurchaseOrder(@RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | Long userId = getLoginUserId(); |
| | | purchaseOrderService.submitPurchaseOrder(id, processDefinitionKey, userId); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approve-process-list") |
| | | @Operation(summary = "获取采购订单审批流程列表") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-order:query')") |
| | | public CommonResult<List<Map<String, Object>>> getApproveProcessList() { |
| | | return success(purchaseOrderService.getPurchaseOrderApproveProcessDefinitionList()); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | |
| | | ExcelUtils.write(response, "采购订单.xls", "数据", ErpPurchaseOrderRespVO.class, list); |
| | | } |
| | | |
| | | @PostMapping("/confirm-receipt") |
| | | @Operation(summary = "确认收货") |
| | | @Parameter(name = "id", description = "采购订单编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-order:confirm-receipt')") |
| | | public CommonResult<Long> confirmReceipt(@RequestParam("id") Long id) { |
| | | return success(purchaseOrderService.confirmReceipt(id)); |
| | | } |
| | | |
| | | private PageResult<ErpPurchaseOrderRespVO> buildPurchaseOrderVOPageResult(PageResult<ErpPurchaseOrderDO> pageResult) { |
| | | if (CollUtil.isEmpty(pageResult.getList())) { |
| | | return PageResult.empty(pageResult.getTotal()); |