buhuazhen
2026-04-22 f088078e626e16b28d69cdbcbf514b30f1dcefe7
src/main/java/com/ruoyi/basic/service/impl/ProductModelServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.basic.dto.ProductDto;
@@ -25,6 +26,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull;
import java.util.*;
import java.util.stream.Collectors;
@@ -70,9 +72,19 @@
    public List<ProductModel> selectModelList(ProductDto productDto) {
        LambdaQueryWrapper<ProductModel> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ProductModel::getProductId, productDto.getId());
        queryWrapper.eq(productDto.getCreateUser() != null, ProductModel::getCreateUser, productDto.getCreateUser());
        queryWrapper.eq(productDto.getDeptId() != null, ProductModel::getDeptId, productDto.getDeptId());
        if (ObjectUtils.isNotEmpty(productDto.getDeptIds())) {
            queryWrapper.in( ProductModel::getDeptId, Arrays.asList(productDto.getDeptIds()));
        }
        return productModelMapper.selectList(queryWrapper);
    }
    @Override
    public List<ProductModel> selectModelListByProductIds(@NotNull List<Long> ids) {
        return productModelMapper.selectModelListByProductIds(ids);
    }
    /**
     * 根据id查询产品规格分页查询
     *