yys
昨天 93f7a6891f688a08df43427b57a0cbd302a84c32
src/main/java/com/ruoyi/production/service/impl/ProductStructureServiceImpl.java
@@ -161,4 +161,18 @@
        return productStructureMapper.listBybomId(bomId,true);
    }
    @Override
    public Long countBybomId(Integer bomId) {
        ProductStructure productStructure = productStructureMapper.selectOne(new LambdaQueryWrapper<ProductStructure>()
                .eq(ProductStructure::getBomId, bomId)
                .isNull(ProductStructure::getParentId)
                .orderByDesc(ProductStructure::getId)
                .last("limit 1"));
        if(productStructure != null){
           return productStructureMapper.selectCount(new LambdaQueryWrapper<ProductStructure>()
                    .eq(ProductStructure::getParentId, productStructure.getId()));
        }
        return 0L;
    }
}