zhuo
2025-03-29 e145f248db1bfee531fd095b43abf3725a365e57
basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductSupplierDensityServiceImpl.java
@@ -32,15 +32,6 @@
        if (supplierDensity.getProductId() == null) {
            throw new BaseException("缺少产品对象id");
        }
        // 查询改厂家是否绑定过
//        Long count = baseMapper.selectCount(Wrappers.<ProductSupplierDensity>lambdaQuery()
//                .eq(ProductSupplierDensity::getProductId, supplierDensity.getProductId())
//                .eq(ProductSupplierDensity::getModel, supplierDensity)
//                .eq(ProductSupplierDensity::getSupplierName, supplierDensity.getSupplierName()));
//        if (count > 0){
//            throw new BaseException("该产品已绑定过该厂家");
//        }
        baseMapper.insert(supplierDensity);
    }
@@ -49,15 +40,6 @@
        if (supplierDensity.getProductId() == null) {
            throw new BaseException("缺少产品对象id");
        }
        // 查询改厂家是否绑定过
//        Long count = baseMapper.selectCount(Wrappers.<ProductSupplierDensity>lambdaQuery()
//                .ne(ProductSupplierDensity::getId, supplierDensity.getId())
//                .eq(ProductSupplierDensity::getProductId, supplierDensity.getProductId())
//                .eq(ProductSupplierDensity::getModel, supplierDensity)
//                .eq(ProductSupplierDensity::getSupplierName, supplierDensity.getSupplierName()));
//        if (count > 0){
//            throw new BaseException("该产品已绑定过该厂家");
//        }
        baseMapper.updateById(supplierDensity);
    }
}