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