| | |
| | | throw new ServiceException("报工失败,生产订单更新失败"); |
| | | } |
| | | |
| | | // 完成报工主表-投入表-产出表数据 |
| | | // 完成报工主表-产出表-产出明细表数据 |
| | | ProductionProductMain productionProductMain = new ProductionProductMain(); |
| | | productionProductMain.setProductNo(productionProductMainService.generateProductNo()); |
| | | productionProductMain.setProductOrderId(dto.getProductOrderId()); |
| | |
| | | productionProductInput.setQuantity(dto.getQuantity()); |
| | | result = productionProductInputService.save(productionProductInput); |
| | | if (!result) { |
| | | throw new ServiceException("报工失败,生产投入存储失败"); |
| | | throw new ServiceException("报工失败,生产产出存储失败"); |
| | | } |
| | | |
| | | ProductionProductOutput productionProductOutput = new ProductionProductOutput(); |
| | |
| | | dto.setMaterialCode(productMaterialSkuDto.getMaterialCode()); |
| | | dto.setModel(productMaterialSkuDto.getModel()); |
| | | |
| | | // 查询投入表(获取产品ID和投入数量) |
| | | // 查询总的产出数量(这里把投入表弄成了产出总表) |
| | | ProductionProductInput input = productionProductInputService.getOne( |
| | | new LambdaQueryWrapper<ProductionProductInput>() |
| | | .eq(ProductionProductInput::getProductMainId, productMainId) |