liding
2026-04-07 de7af74a86374d4bcb58df42316f52c3a8add3ce
src/main/java/com/ruoyi/production/service/impl/ProductOrderServiceImpl.java
@@ -281,7 +281,7 @@
            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()
                );
            }
        }
@@ -292,6 +292,10 @@
                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());