소스 검색

fixed 预约参数校验

fushengqian 8 달 전
부모
커밋
bdc217fb2c

+ 3 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/BookCateServiceImpl.java

@@ -117,6 +117,9 @@ public class BookCateServiceImpl extends ServiceImpl<MtBookCateMapper, MtBookCat
         if (StringUtil.isEmpty(mtBookCate.getName())) {
             throw new BusinessCheckException("新增预约分类失败:分类名称不能为空!");
         }
+        if (StringUtil.isEmpty(mtBookCate.getLogo())) {
+            throw new BusinessCheckException("新增预约分类失败:封面图片不能为空!");
+        }
         bookCate.setStoreId(storeId);
         bookCate.setName(mtBookCate.getName());
         bookCate.setLogo(mtBookCate.getLogo());

+ 6 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/BookServiceImpl.java

@@ -135,6 +135,12 @@ public class BookServiceImpl extends ServiceImpl<MtBookMapper, MtBook> implement
         if (mtBook.getMerchantId() == null || mtBook.getMerchantId() <= 0) {
             throw new BusinessCheckException("新增预约失败:所属商户不能为空!");
         }
+        if (StringUtil.isEmpty(mtBook.getName())) {
+            throw new BusinessCheckException("新增预约失败:项目名称不能为空!");
+        }
+        if (StringUtil.isEmpty(mtBook.getLogo())) {
+            throw new BusinessCheckException("新增预约失败:封面图片不能为空!");
+        }
         mtBook.setStoreId(storeId);
         mtBook.setStatus(StatusEnum.ENABLED.getKey());
         mtBook.setUpdateTime(new Date());