|
@@ -501,8 +501,10 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
// 排除名称重复
|
|
|
this.nameDuplication(ProductInfo::getName, productInfoDto.getName(), productInfoDto.getId(), "产品名称重复");
|
|
|
// 排除不为空的自定义编码重复
|
|
|
- long count = this.count(q -> q.ne(ProductInfo::getId,productInfoDto.getId())
|
|
|
- .eq(ProductInfo::getCustomCode, productInfoDto.getCustomCode()).ne(ProductInfo::getCustomCode,""));
|
|
|
+ long count = this.count(q -> q
|
|
|
+ .ne(ProductInfo::getId, productInfoDto.getId())
|
|
|
+ .eq(ProductInfo::getCustomCode, productInfoDto.getCustomCode())
|
|
|
+ .ne(ProductInfo::getCustomCode, ""));
|
|
|
if (count != 0) {
|
|
|
throw new ServiceException("产品自定义编码重复");
|
|
|
}
|