huminmin
2026-04-08 f7b8a02843673c19e21b275d1c54e2a778bfedd4
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -93,6 +93,7 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean addProductMain(ProductionProductMainDto dto) {
        SysUser user = userMapper.selectUserById(dto.getUserId());
        ProductionProductMain productionProductMain = new ProductionProductMain();
@@ -177,6 +178,12 @@
                Long modelId = drawMaterial.getProductModelId();
                BigDecimal reportQty = drawMaterial.getReportQty();
                if (reportQty != null && reportQty.compareTo(new BigDecimal(0)) == 0) {
                    throw new RuntimeException("产品" + drawMaterial.getProductName() + "- 型号" + drawMaterial.getModel() +
                            "- 批次号=" + drawMaterial.getBatchNo() + "的料已用完,请重新领料");
                }
                String key = drawMaterial.getProductModelId() + "_" +
                        (drawMaterial.getBatchNo() == null ? "" : drawMaterial.getBatchNo()) + "_" +
                        (drawMaterial.getCustomer() == null ? "" : drawMaterial.getCustomer());
@@ -216,6 +223,8 @@
                order.setDrawMaterials(JSON.toJSONString(existingMaterialList));
                productOrderMapper.updateById(order);
            }
        }else {
            throw new RuntimeException("请领取投入材料");
        }
        /*新增报工产出表*/
        ProductionProductOutput productionProductOutput = new ProductionProductOutput();