Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
56e2f06a
Commit
56e2f06a
authored
Aug 05, 2021
by
陈浩建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
身份证号最后一位小写转大写
parent
533fd782
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletions
+29
-1
common/src/main/java/com/winsun/utils/IDCardUtil.java
+16
-1
new-user/src/main/java/com/winsun/controller/PackageNewClothes.java
+13
-0
No files found.
common/src/main/java/com/winsun/utils/IDCardUtil.java
View file @
56e2f06a
...
@@ -24,7 +24,7 @@ public class IDCardUtil {
...
@@ -24,7 +24,7 @@ public class IDCardUtil {
* @return true 有效:false 无效
* @return true 有效:false 无效
*/
*/
public
static
boolean
IDCardValidate
(
String
iDStr
)
{
public
static
boolean
IDCardValidate
(
String
iDStr
)
{
Pattern
p
=
Pattern
.
compile
(
"(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X
|x
)$)"
);
Pattern
p
=
Pattern
.
compile
(
"(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X)$)"
);
String
[]
ValCodeArr
=
{
"1"
,
"0"
,
"X"
,
"9"
,
"8"
,
"7"
,
"6"
,
"5"
,
"4"
,
"3"
,
"2"
};
String
[]
ValCodeArr
=
{
"1"
,
"0"
,
"X"
,
"9"
,
"8"
,
"7"
,
"6"
,
"5"
,
"4"
,
"3"
,
"2"
};
String
[]
Wi
=
{
"7"
,
"9"
,
"10"
,
"5"
,
"8"
,
"4"
,
"2"
,
"1"
,
"6"
,
"3"
,
"7"
,
"9"
,
"10"
,
"5"
,
"8"
,
"4"
,
"2"
};
String
[]
Wi
=
{
"7"
,
"9"
,
"10"
,
"5"
,
"8"
,
"4"
,
"2"
,
"1"
,
"6"
,
"3"
,
"7"
,
"9"
,
"10"
,
"5"
,
"8"
,
"4"
,
"2"
};
String
Ai
=
""
;
String
Ai
=
""
;
...
@@ -168,4 +168,19 @@ public class IDCardUtil {
...
@@ -168,4 +168,19 @@ public class IDCardUtil {
return
hashtable
;
return
hashtable
;
}
}
/**
* 功能:身份证号码最后一位小写转为大写
*
* @param iDStr 身份证号
* @return
*/
public
static
String
IdCardConversion
(
String
iDStr
){
String
idFront
=
iDStr
.
substring
(
0
,
iDStr
.
length
()
-
1
);
String
idLast
=
iDStr
.
substring
(
iDStr
.
length
()-
1
,
iDStr
.
length
());
if
(
"x"
.
equals
(
idLast
)){
idLast
=
"X"
;
iDStr
=
idFront
+
idLast
;
}
return
iDStr
;
}
}
}
new-user/src/main/java/com/winsun/controller/PackageNewClothes.java
View file @
56e2f06a
...
@@ -182,6 +182,10 @@ public class PackageNewClothes {
...
@@ -182,6 +182,10 @@ public class PackageNewClothes {
return
pac
;
return
pac
;
}
}
/**
/**
* 身份证验证最后一位 x =》 X
*/
idCard
=
IDCardUtil
.
IdCardConversion
(
idCard
);
/**
* 身份证验证
* 身份证验证
*/
*/
if
(!
IDCardUtil
.
IDCardValidate
(
idCard
)){
if
(!
IDCardUtil
.
IDCardValidate
(
idCard
)){
...
@@ -339,6 +343,10 @@ public class PackageNewClothes {
...
@@ -339,6 +343,10 @@ public class PackageNewClothes {
return
pac
;
return
pac
;
}
}
/**
/**
* 身份证验证最后一位 x =》 X
*/
idCard
=
IDCardUtil
.
IdCardConversion
(
idCard
);
/**
* 身份证验证
* 身份证验证
*/
*/
if
(!
IDCardUtil
.
IDCardValidate
(
idCard
)){
if
(!
IDCardUtil
.
IDCardValidate
(
idCard
)){
...
@@ -470,6 +478,11 @@ public class PackageNewClothes {
...
@@ -470,6 +478,11 @@ public class PackageNewClothes {
,
@RequestParam
(
value
=
"sell"
,
required
=
false
)
String
sell
)
{
,
@RequestParam
(
value
=
"sell"
,
required
=
false
)
String
sell
)
{
/**
/**
* 身份证验证最后一位 x =》 X
*/
idCard
=
IDCardUtil
.
IdCardConversion
(
idCard
);
/**
* 办理中+94天内订单判断
* 办理中+94天内订单判断
*/
*/
Calendar
instance
=
Calendar
.
getInstance
();
Calendar
instance
=
Calendar
.
getInstance
();
...
...
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