| | |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.MesWmProductIssuePageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.MesWmProductIssueSupplementReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.MesWmProductIssueRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.MesWmProductIssueSaveReqVO; |
| | | import cn.iocoder.yudao.module.crm.api.customer.CrmCustomerApi; |
| | |
| | | return success(issueService.createProductIssue(createReqVO)); |
| | | } |
| | | |
| | | @PostMapping("/generate-by-work-order") |
| | | @Operation(summary = "根据生产工单生成领料任务", |
| | | description = "按工单 BOM 物料清单 × 工单计划数量算出应领数量,扣除已领数量后生成草稿领料出库单") |
| | | @Parameter(name = "workOrderId", description = "生产工单编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-product-issue:create')") |
| | | public CommonResult<Long> generateByWorkOrder(@RequestParam("workOrderId") Long workOrderId) { |
| | | return success(issueService.generateByWorkOrder(workOrderId)); |
| | | } |
| | | |
| | | @PostMapping("/supplement") |
| | | @Operation(summary = "创建补领辅料单", description = "按工单补领辅料,生成草稿领料单(类型=补领辅料),后续走 提交→拣货→完成 流程") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-product-issue:create')") |
| | | public CommonResult<Long> createSupplementIssue(@Valid @RequestBody MesWmProductIssueSupplementReqVO reqVO) { |
| | | return success(issueService.createSupplementIssue(reqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "修改领料出库单") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-product-issue:update')") |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得领料出库单") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-product-issue:query')") |
| | | public CommonResult<MesWmProductIssueRespVO> getProductIssue(@RequestParam("id") Long id) { |
| | | MesWmProductIssueDO issue = issueService.getProductIssue(id); |
| | | if (issue == null) { |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得领料出库单分页") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-product-issue:query')") |
| | | public CommonResult<PageResult<MesWmProductIssueRespVO>> getProductIssuePage( |
| | | @Valid MesWmProductIssuePageReqVO pageReqVO) { |
| | | PageResult<MesWmProductIssueDO> pageResult = issueService.getProductIssuePage(pageReqVO); |
| | |
| | | @GetMapping("/check-quantity") |
| | | @Operation(summary = "校验领料出库单数量", description = "校验每行明细数量之和是否等于行领料数量") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-product-issue:query')") |
| | | public CommonResult<Boolean> checkProductIssueQuantity(@RequestParam("id") Long id) { |
| | | return success(issueService.checkProductIssueQuantity(id)); |
| | | } |