Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
task2.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
首航-临时账号
task2.0
Commits
9dc0393b
Commit
9dc0393b
authored
Mar 25, 2019
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用阿里代码规范插件扫描后修改
parent
0a101d99
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
+13
-4
HRMUpdatePreMobileService.java
src/com/foc/hrm/service/HRMUpdatePreMobileService.java
+0
-0
DBHelper.java
src/com/foc/util/DBHelper.java
+0
-0
DateUtil.java
src/com/foc/util/DateUtil.java
+0
-0
Util.java
src/com/foc/util/Util.java
+13
-4
No files found.
src/com/foc/hrm/service/HRMUpdatePreMobileService.java
View file @
9dc0393b
This diff is collapsed.
Click to expand it.
src/com/foc/util/DBHelper.java
View file @
9dc0393b
This diff is collapsed.
Click to expand it.
src/com/foc/util/DateUtil.java
View file @
9dc0393b
This diff is collapsed.
Click to expand it.
src/com/foc/util/Util.java
View file @
9dc0393b
...
...
@@ -352,10 +352,12 @@ public class Util {
if
(
workPhone
==
null
||
workPhone
.
length
()
==
0
)
return
workPhone
;
try
{
workPhone
=
workPhone
.
replaceAll
(
"[^\\d|+]+"
,
""
);
if
(
workPhone
.
matches
(
"0+"
)){
// 非座机号设置为空
System
.
out
.
println
(
workPhone
+
":格式化不匹配,#"
);
workPhone
=
workPhone
.
replaceAll
(
"[^\\d^,^#|+]+"
,
""
);
// 非座机号设置为空
if
(
workPhone
.
matches
(
"0+"
))
{
workPhone
=
""
;
}
else
if
(
workPhone
.
startsWith
(
"0"
)
==
false
){
// 非0开头的号码需要处理
}
else
if
(
workPhone
.
startsWith
(
"0"
)
==
false
)
{
if
(
workPhone
.
startsWith
(
"1"
)
&&
workPhone
.
length
()
==
11
){
// 非座机号,是手机号,将号码处理为空
workPhone
=
""
;
...
...
@@ -380,8 +382,10 @@ public class Util {
}
else
if
(
workPhone
.
startsWith
(
"+"
)){
// 4、+ xxxx xxxx -> 000 xxxx xxxx 北京号码,去掉+号,加拨000
workPhone
=
workPhone
.
replace
(
"+"
,
"000"
);
}
else
{
// 5、xxx xxxx xxxx -> 0 xxx xxxx xxxx 国内非北京号码,加拨0
}
else
if
(
workPhone
.
indexOf
(
","
)
==
1
&
workPhone
.
indexOf
(
"#"
)
==
1
)
{
workPhone
=
workPhone
;
}
else
{
// 5、xxx xxxx xxxx -> 0 xxx xxxx xxxx 国内非北京号码,加拨0
workPhone
=
"0"
+
workPhone
;
}
return
workPhone
;
...
...
@@ -633,4 +637,9 @@ public class Util {
// }
// System.out.println(Util.updateGroupAvatar("4433", "793289947956154368"));
// }
public
static
void
main
(
String
[]
args
)
{
Util
util
=
new
Util
();
System
.
out
.
println
(
Util
.
formatedWorkPhone
(
"656521"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment