gongchunyi
2026-04-29 56b73ce57147653cfbcfe87a7c28e9792dbb2f72
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -243,8 +243,19 @@
    @Override
    public ProductionReportStateDto reportState(Long workOrderId, Long productProcessRouteItemId) {
        ProductionProductMain running = getRunning(workOrderId, productProcessRouteItemId);
        ProductionReportStateDto dto = new ProductionReportStateDto();
        ProductWorkOrder workOrder = productWorkOrderMapper.selectById(workOrderId);
        if (workOrder != null) {
            BigDecimal planQty = workOrder.getPlanQuantity() == null ? BigDecimal.ZERO : workOrder.getPlanQuantity();
            BigDecimal completeQty = workOrder.getCompleteQuantity() == null ? BigDecimal.ZERO : workOrder.getCompleteQuantity();
            //  生产报工数量已完成
            if (planQty.compareTo(BigDecimal.ZERO) > 0 && completeQty.compareTo(planQty) >= 0) {
                dto.setState(3);
                return dto;
            }
        }
        ProductionProductMain running = getRunning(workOrderId, productProcessRouteItemId);
        if (running == null) {
            dto.setState(1);
            return dto;