手机号码中间四位外显为****

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fzy198926/article/details/79242497

1.图片

2.代码

/**

* 批次用户列表
* 手机号码中间四位外显为****
* */
@Override
public List<CalloutPlanList> querybatchUserList(Map<String, Object> params) {
ArrayList<CalloutPlanList> returnList = new ArrayList<CalloutPlanList>();
List<CalloutPlanList> list = calloutPlanListMapper.selectByParam(params);
if(list != null && list.size() > 0){
for (CalloutPlanList CalloutPlanList : list) {
String userPhone = CalloutPlanList.getUserphone();
userPhone = userPhone.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
CalloutPlanList.setUserphone(userPhone);
returnList.add(CalloutPlanList);
}
}
return returnList;
}

猜你喜欢

转载自blog.csdn.net/fzy198926/article/details/79242497