mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-01-31 19:53:11 +08:00
feat:更新对运费模板的name长度判断
This commit is contained in:
parent
dbe494fad8
commit
99a399b245
1 changed files with 6 additions and 4 deletions
|
@ -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<S
|
|||
public void validatorEntity(ShopDeliveryTemplate shopDeliveryTemplate) {
|
||||
super.validatorEntity(shopDeliveryTemplate);
|
||||
|
||||
if (StrUtil.isNotEmpty(shopDeliveryTemplate.getName()) || shopDeliveryTemplate.getName().length() <= 100) {
|
||||
throw new CustomException("运费模板名称过长: " + shopDeliveryTemplate.getName());
|
||||
if (StrUtil.isNotEmpty(shopDeliveryTemplate.getName()) && shopDeliveryTemplate.getName().length() > 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue