Commit f5807ce8 by 伍思炜

宽带下单时多媒体账号与密码的填写规则修改

parent c89a14ea
......@@ -35,6 +35,7 @@ import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;
/**
* 融合办理接口
......@@ -170,6 +171,27 @@ public class RongHeController {
}else {
sell = "";
}
if (StringUtils.isNotBlank(orderCustomerAccount)) {
String orderCustomerAccounts = orderCustomerAccount.split("@")[0];
if (!orderPhone.equals(orderCustomerAccounts)) {
Pattern iphoneVerification = Pattern.compile("^[1][3|4|5|6|7|8|9][0-9]{9}$");
if (!iphoneVerification.matcher(orderCustomerAccounts).matches()) {
return ResponseData.error("多媒体账号请填写为手机号");
}
}
} else {
return ResponseData.error("多媒体账号不能为空");
}
if (StringUtils.isNotBlank(orderCustomerPwd)) {
if (!CheckPwd.checkPassword(orderCustomerPwd)) {
return ResponseData.error("多媒体账号的密码必须为8~12位的数字加字母组合");
}
} else {
return ResponseData.error("多媒体账号的密码不能为空");
}
String imgUrl = request.getParameter("imgUrl");
String filePath = "";
String orderSeq = RandomUtil.RandomNumber(20);
......@@ -214,9 +236,10 @@ public class RongHeController {
orderView.setOrderUniversityName(product.getProductUniversity()); // 学校
orderView.setOrderRegion(product.getProductRegion()); // 区域
/**
* 广美用来判断校区
*/
/*
广美用来判断校区
*/
if (StringUtils.isNotBlank(productId) && "84".equals(productId)){
if (StringUtils.isNotBlank(campus) && "1".equals(campus)){
orderView.setOrderRegion("海珠区");
......
package com.winsun.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CheckPwd {
/**
* 验证多媒体密码
* @param new_password
* @return
*/
public static boolean checkPassword(String new_password) {
if (new_password.length() < 8 || new_password.length() > 12) {
//密码格式错误
return false;
} else {
int passNumber = 0;
Pattern pattern1 = Pattern.compile("(?=.*[-._/!@#$%^*]).{8,12}");
Matcher m1 = pattern1.matcher(new_password);
if (m1.matches()) {
return false;
}
Pattern pattern2 = Pattern.compile("(?=.*\\d).{8,12}");
Matcher m2 = pattern2.matcher(new_password);
if (m2.matches()) {
passNumber++;
}
Pattern pattern3 = Pattern.compile("(?=.*[a-z]).{8,12}");
Matcher m3 = pattern3.matcher(new_password);
if (m3.matches()) {
passNumber++;
}
Pattern pattern4 = Pattern.compile("(?=.*[A-Z]).{8,12}");
Matcher m4 = pattern4.matcher(new_password);
if (m4.matches()) {
passNumber++;
}
if (passNumber < 2) {
//密码格式错误
return false;
}
if (!new_password.matches("^[0-9a-zA-Z]{8,12}$")) {
return false;
}
if (new_password.contains("&")) {
return false;
}
}
return true;
}
}
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