Browse Source

朗通产品线添加bug

wangyu 6 years ago
parent
commit
599e163d11

+ 2 - 1
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -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,
                     "产品名称重复");
         }