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
d642eadc
Commit
d642eadc
authored
Mar 05, 2021
by
罗承锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加年龄限制
parent
332c855c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
4 deletions
+46
-4
new-user/src/main/java/com/winsun/controller/PackageNewClothes.java
+46
-4
No files found.
new-user/src/main/java/com/winsun/controller/PackageNewClothes.java
View file @
d642eadc
...
@@ -184,6 +184,17 @@ public class PackageNewClothes {
...
@@ -184,6 +184,17 @@ public class PackageNewClothes {
if
(!
IDCardUtil
.
IDCardValidate
(
idCard
)){
if
(!
IDCardUtil
.
IDCardValidate
(
idCard
)){
return
ResponseData
.
error
(
"您的身份证输入有误,请重新输入!"
);
return
ResponseData
.
error
(
"您的身份证输入有误,请重新输入!"
);
}
}
/**
* 黑牛卡年龄判断
*/
if
(
kapin
.
indexOf
(
"黑牛"
)
>
-
1
)
{
ResponseData
<
String
>
stringResponseData
=
heiNiuIdCardVerification
(
idCard
,
customerName
);
if
(!
stringResponseData
.
isSuccess
())
{
return
stringResponseData
;
};
}
/**
/**
* 办理中+94天内订单判断
* 办理中+94天内订单判断
*/
*/
...
@@ -568,6 +579,37 @@ public class PackageNewClothes {
...
@@ -568,6 +579,37 @@ public class PackageNewClothes {
}
}
/**
/**
* 黑牛卡身份证验证
* @param idCard 黑牛卡身份证
* @param customerName 姓名
* @return
*/
public
static
ResponseData
<
String
>
heiNiuIdCardVerification
(
String
idCard
,
String
customerName
){
JSONObject
jsonObject1
=
null
;
try
{
jsonObject1
=
XbkUtil
.
idCardCheckJT0005
(
idCard
,
customerName
);
}
catch
(
Exception
e
)
{
log
.
error
(
"身份证验证接口调用异常"
,
e
.
getMessage
());
}
if
(
jsonObject1
==
null
)
{
log
.
info
(
"身份证验证接口调用异常"
);
return
ResponseData
.
error
(
"身份证验证失败。"
);
}
if
(!
"0"
.
equals
(
jsonObject1
.
getString
(
"code"
)))
{
return
ResponseData
.
error
(
jsonObject1
.
getString
(
"msg"
));
}
Integer
i
=
Integer
.
parseInt
(
idCard
.
substring
(
6
,
10
));
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
Date
timeDate
=
new
Date
();
Integer
age
=
Integer
.
parseInt
(
dateFormat
.
format
(
timeDate
.
getTime
()));
Integer
time25
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
25
)
+
idCard
.
substring
(
10
,
14
));
if
(
age
>
time25
)
{
return
ResponseData
.
error
(
"您已满25周岁,不符合办理条件,如有疑问请联系客服,谢谢。"
);
}
return
ResponseData
.
success
(
"OK"
);
}
/**
* 身份证验证
* 身份证验证
* @param idCard 身份证
* @param idCard 身份证
* @param customerName 姓名
* @param customerName 姓名
...
@@ -592,13 +634,13 @@ public class PackageNewClothes {
...
@@ -592,13 +634,13 @@ public class PackageNewClothes {
Date
timeDate
=
new
Date
();
Date
timeDate
=
new
Date
();
Integer
age
=
Integer
.
parseInt
(
dateFormat
.
format
(
timeDate
.
getTime
()));
Integer
age
=
Integer
.
parseInt
(
dateFormat
.
format
(
timeDate
.
getTime
()));
Integer
time16
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
16
)
+
idCard
.
substring
(
10
,
14
));
Integer
time16
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
16
)
+
idCard
.
substring
(
10
,
14
));
Integer
time2
5
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
25
)
+
idCard
.
substring
(
10
,
14
));
Integer
time2
7
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
27
)
+
idCard
.
substring
(
10
,
14
));
if
(
age
<
time16
)
{
if
(
age
<
time16
)
{
return
ResponseData
.
error
(
"根据工信部要求,未满16周岁的用户,应由法定代理人代为办理线上入网,如有疑问请联系客服,谢谢。"
);
return
ResponseData
.
error
(
"根据工信部要求,未满16周岁的用户,应由法定代理人代为办理线上入网,如有疑问请联系客服,谢谢。"
);
}
}
// if (age > time25
) {
if
(
age
>
time27
)
{
// return ResponseData.error("您已满25
周岁,不符合办理条件,如有疑问请联系客服,谢谢。");
return
ResponseData
.
error
(
"您已满27
周岁,不符合办理条件,如有疑问请联系客服,谢谢。"
);
//
}
}
return
ResponseData
.
success
(
"OK"
);
return
ResponseData
.
success
(
"OK"
);
}
}
...
...
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