src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java
@@ -206,9 +206,13 @@
        BigDecimal totalQty = productOrder.getQuantity() == null ? BigDecimal.ZERO : productOrder.getQuantity();
        //  剩余可报工数量
        BigDecimal remainQty = totalQty.subtract(completeQty);
        //  本次报工合格数量不能超过剩余数量(校验必须在累加前执行)
        //  本次报工合格数量不能超过剩余数量
        if (qualifiedQty.compareTo(remainQty) > 0) {
            throw new ServiceException("报工失败,本次报工数量不能大于剩余可报工数量,剩余报工数量:[" + remainQty + "]");
        }
        //  本次报工不合格数量不能超过本次报工数量
        if (dto.getUnqualifiedQuantity() != null && dto.getUnqualifiedQuantity().compareTo(dto.getQuantity()) > 0) {
            throw new ServiceException("报工失败,本次报工不合格数量不能大于报工数量,报工数量:[" + dto.getQuantity() + "]");
        }
        //  历史已完成 + 本次合格数量
        BigDecimal newCompleteQty = completeQty.add(qualifiedQty);
@@ -298,6 +302,7 @@
                                paramEntity.setParamFormat(orderParam.getParamFormat());
                                paramEntity.setValueMode(orderParam.getValueMode());
                                paramEntity.setUnit(orderParam.getUnit());
                                paramEntity.setStandardValue(orderParam.getStandardValue());
                            }
                        }
                        productionProductRouteItemParamService.save(paramEntity);