demand: tms-客户管理-报关清关级别维护-改为校验客户名称头尾不能有空格
committer: heyu
This commit is contained in:
parent
df2c3e86df
commit
36bd1744b9
@ -9,7 +9,6 @@
|
|||||||
package com.xdadan.erp.emis.service.impl;
|
package com.xdadan.erp.emis.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -22,9 +21,6 @@ public class EmisCustomsLevelServiceImpl implements IEmisCustomsLevelService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private EmisCustomsLevelMapper emisCustomsLevelMapper;
|
private EmisCustomsLevelMapper emisCustomsLevelMapper;
|
||||||
|
|
||||||
private static final Pattern INVALID_NAME_PATTERN = Pattern
|
|
||||||
.compile("[\\s`~!@#$%^&*()+=|{}':;',\\[\\]\\.<>/?!¥…()—【】‘;:”“’。,、?]");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将前端传来的name转换为对应的code
|
* 将前端传来的name转换为对应的code
|
||||||
*
|
*
|
||||||
@ -110,8 +106,8 @@ public class EmisCustomsLevelServiceImpl implements IEmisCustomsLevelService {
|
|||||||
if (StringUtils.isBlank(po.getCustomerName())) {
|
if (StringUtils.isBlank(po.getCustomerName())) {
|
||||||
throw new IllegalArgumentException("客户名称不能为空");
|
throw new IllegalArgumentException("客户名称不能为空");
|
||||||
}
|
}
|
||||||
if (INVALID_NAME_PATTERN.matcher(po.getCustomerName()).find()) {
|
if (!po.getCustomerName().equals(po.getCustomerName().trim())) {
|
||||||
throw new IllegalArgumentException("客户名称不能包含空格或特殊符号");
|
throw new IllegalArgumentException("客户名称头尾不能有空格");
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(po.getCategory()) || !("1".equals(po.getCategory()) || "2".equals(po.getCategory())
|
if (StringUtils.isBlank(po.getCategory()) || !("1".equals(po.getCategory()) || "2".equals(po.getCategory())
|
||||||
|| "3".equals(po.getCategory()) || "4".equals(po.getCategory()))) {
|
|| "3".equals(po.getCategory()) || "4".equals(po.getCategory()))) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user