|
@@ -41,6 +41,7 @@ import ma.glasnost.orika.MapperFacade;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
+import java.util.regex.Pattern;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -192,6 +193,9 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
if (StringUtils.isEmpty(channelImportExcel.getMobile())) {
|
|
if (StringUtils.isEmpty(channelImportExcel.getMobile())) {
|
|
return AjaxResult.error("导入的手机号存在空值");
|
|
return AjaxResult.error("导入的手机号存在空值");
|
|
}
|
|
}
|
|
|
|
+ if (!Pattern.compile("^\\d{11}$").matcher(channelImportExcel.getMobile()).matches()) {
|
|
|
|
+ return AjaxResult.error("导入的手机号不是11位数字");
|
|
|
|
+ }
|
|
if (StringUtils.isEmpty(channelImportExcel.getName())) {
|
|
if (StringUtils.isEmpty(channelImportExcel.getName())) {
|
|
return AjaxResult.error("导入的门店名称存在空值");
|
|
return AjaxResult.error("导入的门店名称存在空值");
|
|
}
|
|
}
|
|
@@ -201,6 +205,9 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
if (channelImportExcel.getCommRate() == null) {
|
|
if (channelImportExcel.getCommRate() == null) {
|
|
return AjaxResult.error("导入的佣金比例为空");
|
|
return AjaxResult.error("导入的佣金比例为空");
|
|
}
|
|
}
|
|
|
|
+ if (!Pattern.compile("^[0-9]+(\\.[0-9]{2})?$").matcher(channelImportExcel.getCommRate().toString()).matches()) {
|
|
|
|
+ return AjaxResult.error("导入的佣金比例要求两位小数");
|
|
|
|
+ }
|
|
mobileList.add(channelImportExcel.getMobile());
|
|
mobileList.add(channelImportExcel.getMobile());
|
|
}
|
|
}
|
|
long count = mobileList.stream().distinct().count();
|
|
long count = mobileList.stream().distinct().count();
|
|
@@ -233,10 +240,10 @@ public class SaleSiteMgrController extends BaseApiController {
|
|
Channel site = channelService.getOne(
|
|
Channel site = channelService.getOne(
|
|
new LambdaQueryWrapper<Channel>().eq(Channel::getMobile, importExcel.getMobile()));
|
|
new LambdaQueryWrapper<Channel>().eq(Channel::getMobile, importExcel.getMobile()));
|
|
if (site != null) {
|
|
if (site != null) {
|
|
- importErrorVO.setErrorReason(importErrorVO.getErrorReason() == null ? "" : importErrorVO.getErrorReason() + "/" + "门店已被注册");
|
|
|
|
|
|
+ importErrorVO.setErrorReason(importErrorVO.getErrorReason() == null ? "门店已被注册" : importErrorVO.getErrorReason() + "/" + "门店已被注册");
|
|
}
|
|
}
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(importExcel.getMobile()))) {
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(importExcel.getMobile()))) {
|
|
- importErrorVO.setErrorReason(importErrorVO.getErrorReason() == null ? "" : importErrorVO.getErrorReason() + "/" + "手机号已被注册");
|
|
|
|
|
|
+ importErrorVO.setErrorReason(importErrorVO.getErrorReason() == null ? "手机号已被注册" : importErrorVO.getErrorReason() + "/" + "手机号已被注册");
|
|
}
|
|
}
|
|
if (importErrorVO.getErrorReason() != null) {
|
|
if (importErrorVO.getErrorReason() != null) {
|
|
channelImportErrorVOS.add(importErrorVO);
|
|
channelImportErrorVOS.add(importErrorVO);
|