|
@@ -66,7 +66,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
* @return Boolean true
|
|
|
*/
|
|
|
public Boolean addProducts(AddProductsVO addProductsVO) {
|
|
|
- if(addProductsVO.getName().equals(this.selectProductByName(addProductsVO.getName()).getName())){
|
|
|
+ LantoneProduct lantoneProductInfos = this.selectProductByName(addProductsVO.getName());
|
|
|
+ if(lantoneProductInfos != null && addProductsVO.getName().equals(lantoneProductInfos.getName())){
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"产品名称重复");
|
|
|
}
|