李白
3 天以前 dfcd8b37f532ef54b259c1e716e7a2660951ae57
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductController.java
@@ -2,6 +2,7 @@
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -49,6 +50,10 @@
    @PreAuthorize("@pms.hasPermission('business_product_view')" )
    public R getProductPage(@ParameterObject Page page, @ParameterObject Product product) {
        LambdaQueryWrapper<Product> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(product.getParentId()!=null,Product::getParentId,product.getParentId());
        wrapper.like(StrUtil.isNotEmpty(product.getProductName()),Product::getProductName,product.getProductName());
        wrapper.like(StrUtil.isNotEmpty(product.getMainCode()),Product::getMainCode,product.getMainCode());
        wrapper.like(StrUtil.isNotEmpty(product.getErpCode()),Product::getErpCode,product.getErpCode());
        return R.ok(productService.page(page, wrapper));
    }