| | |
| | | List<DrawMaterialDto> materialDtoList = JSON.parseArray(productOrder.getDrawMaterials(), DrawMaterialDto.class); |
| | | for (DrawMaterialDto drawMaterialDto : materialDtoList) { |
| | | stockUtils.addStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), null, productOrderDto.getId(), |
| | | drawMaterialDto.getBatchNo(), drawMaterialDto.getCustomer() |
| | | drawMaterialDto.getBatchNo(), drawMaterialDto.getCustomer(),drawMaterialDto.getProductionDate() |
| | | ); |
| | | } |
| | | } |
| | |
| | | if (drawMaterialDto.getProductModelId() == null) { |
| | | throw new RuntimeException("产品型号ID不能为空"); |
| | | } |
| | | if (drawMaterialDto.getQualitity() == null || drawMaterialDto.getQualitity().compareTo(BigDecimal.ZERO) == 0) { |
| | | throw new RuntimeException("产品" + drawMaterialDto.getProductName() + "型号" + drawMaterialDto.getModel() |
| | | + "批号" + drawMaterialDto.getBatchNo() + "库存不足!"); |
| | | } |
| | | stockUtils.substractStock(drawMaterialDto.getProductModelId(), drawMaterialDto.getRequisitionQty(), |
| | | StockOutQualifiedRecordTypeEnum.DRAW_MATERIALS_STOCK_OUT.getCode(), productOrderDto.getId(), |
| | | drawMaterialDto.getBatchNo(),drawMaterialDto.getCustomer()); |