Commit 0c18ec3b authored by 刘帅阳's avatar 刘帅阳

修改bug

parent f8074456
...@@ -247,6 +247,9 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor ...@@ -247,6 +247,9 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor
Pattern pattern = Pattern.compile("[0-9]*"); Pattern pattern = Pattern.compile("[0-9]*");
//添加前先遍历一下那些数据有问题 //添加前先遍历一下那些数据有问题
for (CmsPriceClickDTO cmsPriceClickDTO : cmsPriceClicksDTOList) { for (CmsPriceClickDTO cmsPriceClickDTO : cmsPriceClicksDTOList) {
//用户名去空格
cmsPriceClickDTO.setUserName(cmsPriceClickDTO.getUserName().replaceAll("\\s+", "").trim());
cmsPriceClickDTO.setUserName(cmsPriceClickDTO.getUserName().replaceAll("\\p{Zs}", "").trim());
//手机号去空格 //手机号去空格
cmsPriceClickDTO.setPhone(cmsPriceClickDTO.getPhone().replaceAll("\\s+", "").trim()); cmsPriceClickDTO.setPhone(cmsPriceClickDTO.getPhone().replaceAll("\\s+", "").trim());
cmsPriceClickDTO.setPhone(cmsPriceClickDTO.getPhone().replaceAll("\\p{Zs}", "").trim()); cmsPriceClickDTO.setPhone(cmsPriceClickDTO.getPhone().replaceAll("\\p{Zs}", "").trim());
...@@ -269,7 +272,7 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor ...@@ -269,7 +272,7 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor
throw new CyServiceException(AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.PHONE_LENGTH_ERROR.getMessage()); throw new CyServiceException(AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.PHONE_LENGTH_ERROR.getMessage());
} }
//3.银行卡号不能为空 19位 //3.银行卡号不能为空 19位
if (cmsPriceClickDTO.getBankCard() == null) { if (cmsPriceClickDTO.getBankCard() == null || cmsPriceClickDTO.getBankCard().length() > 30) {
// throw new CyServiceException(AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getMessage() + ":" + cmsPriceClickDTO.getBankCard()); // throw new CyServiceException(AdminUserInfoExceptionEnums.ID_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getMessage() + ":" + cmsPriceClickDTO.getBankCard());
throw new CyServiceException(AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getCode(), cmsPriceClickDTO.getIdCard() + AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getMessage()); throw new CyServiceException(AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getCode(), cmsPriceClickDTO.getIdCard() + AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getMessage());
} }
...@@ -290,6 +293,10 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor ...@@ -290,6 +293,10 @@ public class CmsPriceClickServiceImpl extends ServiceImpl<CmsPriceClickRepositor
// System.out.println("++" + cmsPriceClickDTO.getBankCard() + "+++"); // System.out.println("++" + cmsPriceClickDTO.getBankCard() + "+++");
throw new CyServiceException(AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getMessage()); throw new CyServiceException(AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.BANK_LENGTH_ERROR.getMessage());
} }
//用户名称不能为空且 不能大于30
if (cmsPriceClickDTO.getUserName() == null || cmsPriceClickDTO.getUserName().length() > 30) {
throw new CyServiceException(AdminUserInfoExceptionEnums.USER_NAME_LENGTH_ERROR.getCode(), AdminUserInfoExceptionEnums.USER_NAME_LENGTH_ERROR.getMessage());
}
} }
......
...@@ -44,7 +44,8 @@ public enum AdminUserInfoExceptionEnums implements CyResExcEnum { ...@@ -44,7 +44,8 @@ public enum AdminUserInfoExceptionEnums implements CyResExcEnum {
ID_LENGTH_ERROR(4007, "当前身份证号错误或不能为空"), ID_LENGTH_ERROR(4007, "当前身份证号错误或不能为空"),
BANK_LENGTH_ERROR(4007, "当前银行卡号错误或不能为空"), BANK_LENGTH_ERROR(4007, "当前银行卡号错误或不能为空"),
CLICK_THROUGH_RATE_ERROR(4007, "当前推广次数错误或不能为空"), CLICK_THROUGH_RATE_ERROR(4007, "当前推广次数错误或不能为空"),
PRICE_ERROR(4007, "当前价格错误或不能为空"); PRICE_ERROR(4007, "当前价格错误或不能为空"),
USER_NAME_LENGTH_ERROR(4007, "当前用户名称错误");
private Integer code; private Integer code;
private String message; private String message;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment