diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/delivery/service/impl/ShopDeliveryTemplateServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/delivery/service/impl/ShopDeliveryTemplateServiceImpl.java index 3c77988b..fc4d80fc 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/delivery/service/impl/ShopDeliveryTemplateServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/delivery/service/impl/ShopDeliveryTemplateServiceImpl.java @@ -4,7 +4,6 @@ package com.skyeye.delivery.service.impl; -import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -72,15 +71,18 @@ public class ShopDeliveryTemplateServiceImpl extends SkyeyeBusinessServiceImpl 100) { + throw new CustomException("运费模板名称过长"); + } + if (!(shopDeliveryTemplate.getOrderBy() instanceof Integer)){ + throw new CustomException("排序值类型错误,请输入整数数字"); } //判断StoreId是否存在 if (StrUtil.isNotEmpty(shopDeliveryTemplate.getStoreId())) { ShopStore shopStore = shopStoreService.selectById(shopDeliveryTemplate.getStoreId()); //判断shopStore是否为空,如果为空,则抛出异常 if (StrUtil.isNotEmpty(shopStore.getId())) { - throw new CustomException("门店不存在: " + shopDeliveryTemplate.getName()); + throw new CustomException("门店不存在: " + shopStore); } } }