Browse Source

客户证件号码验证

master
dimengzhe 3 years ago
parent
commit
78342d5905
  1. 4
      anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempDto.java
  2. 18
      anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java

4
anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/CrmCustomerTempDto.java

@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.List;
/**
@ -34,7 +33,7 @@ public class CrmCustomerTempDto implements Dto {
@ApiModelProperty(value = "当前登录用户的sid")
private String userSid;
@ApiModelProperty(value = "客户类型(个人/企业)", required = true)
@ApiModelProperty(value = "客户类型(1个人/2企业)", required = true)
@NotBlank(message = "客户类型为必选项")
private String customerType;
@ -56,7 +55,6 @@ public class CrmCustomerTempDto implements Dto {
@ApiModelProperty("联系电话")
@NotBlank(message = "联系电话为必填项")
@Pattern(regexp = "^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$", message = "手机号码格式不正确")
private String mobile;
@ApiModelProperty("微信号码")

18
anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java

@ -656,6 +656,22 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa
if (StringUtils.isBlank(mobile)) {
return rb.setMsg("请输入联系电话");
}
if ("1".equals(dto.getCustomerType())) {
if (!weixin.matches("^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$")) {
return rb.setMsg("手机号格式不正确");
}
if (StringUtils.isNotBlank(dto.getIDNumber())) {
if (!weixin.matches("^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$")) {
return rb.setMsg("证件号码格式不正确");
}
}
} else {
if (StringUtils.isNotBlank(dto.getIDNumber())) {
if (dto.getIDNumber().length() != 9 && dto.getIDNumber().length() != 18) {
return rb.setMsg("证件号码格式不正确");
}
}
}
if (StringUtils.isNotBlank(weixin)) {
if (!weixin.matches("^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$") && !weixin.matches("^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$")) {
return rb.setMsg("微信号格式不正确");
@ -807,7 +823,7 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa
if (customerTemp == null) {
return rb.setMsg("该客户信息不存在");
}
BeanUtil.copyProperties(dto,customerTemp);
BeanUtil.copyProperties(dto, customerTemp);
baseMapper.updateById(customerTemp);
// int count = updateBySid(dto, sid);
//更新运营信息

Loading…
Cancel
Save