| | |
| | | |
| | | 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; |
| | |
| | | @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)); |
| | | } |
| | | |