liyong
2026-04-22 9001fcbffb5c67562d511d65475cd22f080c3592
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,7 +72,17 @@
    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);
    }
    /**
@@ -151,4 +163,8 @@
            throw new ServiceException("导入失败");
        }
    }
    public Boolean checkProductModelExist(Long productId, String model) {
        return true;
    }
}