Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
970e0414
Commit
970e0414
authored
Jul 11, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实名认证
parent
caf1d086
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
31 deletions
+40
-31
AppUserManageDTO.java
...m/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
+2
-2
CertificationController.java
...latform/universal/controller/CertificationController.java
+3
-1
CertificationService.java
...xxfc/platform/universal/service/CertificationService.java
+35
-28
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
View file @
970e0414
...
...
@@ -53,9 +53,9 @@ public class AppUserManageDTO {
private
Integer
source
;
/**
*
*
接收前台时间范围
*/
private
String
registrationDate
;
private
String
[]
registrationDate
;
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/CertificationController.java
View file @
970e0414
...
...
@@ -18,7 +18,9 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletRequest
;
/**
* 实名认证
*/
@RestController
@RequestMapping
(
"certif"
)
@Slf4j
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/CertificationService.java
View file @
970e0414
...
...
@@ -18,15 +18,14 @@ import org.apache.commons.lang.StringUtils;
import
org.apache.http.HttpResponse
;
import
org.apache.http.StatusLine
;
import
org.apache.http.util.EntityUtils
;
import
org.apache.poi.ss.usermodel.DateUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.*
;
@Service
...
...
@@ -266,8 +265,8 @@ public class CertificationService {
//正面进行解析
String
front
=
imageParse
(
idInformation
.
getFrontUrl
(),
frontParameter
);
String
back
=
imageParse
(
idInformation
.
getBackUrl
(),
backParameter
);
log
.
info
(
"----解析front========="
+
front
);
log
.
info
(
"----解析back========="
+
back
);
log
.
info
(
"----解析front========="
+
front
);
log
.
info
(
"----解析back========="
+
back
);
if
(
StringUtils
.
isBlank
(
front
)
||
StringUtils
.
isBlank
(
back
))
{
return
ObjectRestResponse
.
createDefaultFail
();
}
...
...
@@ -282,7 +281,7 @@ public class CertificationService {
||
MapUtil
.
isEmpty
(
backMap
)
||
!(
backMap
.
get
(
imageRet
).
equals
(
imageResultCode
))
){
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
...
...
@@ -292,7 +291,7 @@ public class CertificationService {
Map
backData
=
(
Map
)
backMap
.
get
(
dataNam
);
if
(
MapUtil
.
isEmpty
(
backData
)
||
MapUtil
.
isEmpty
(
frontData
))
{
if
(
MapUtil
.
isEmpty
(
backData
)
||
MapUtil
.
isEmpty
(
frontData
))
{
return
ObjectRestResponse
.
createDefaultFail
();
}
...
...
@@ -312,7 +311,7 @@ public class CertificationService {
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"证件号不一致"
);
}
//map携带身份证和姓名进行认证
//map携带身份证和姓名进行认证
Map
<
String
,
String
>
authMap
=
new
HashMap
<>();
authMap
.
put
(
idCardName
,
(
String
)
frontData
.
get
(
numberName
));
...
...
@@ -320,13 +319,13 @@ public class CertificationService {
//3.调用接口进行认证
String
result
=
certificate
(
authMap
);
log
.
info
(
"----认证结果result========="
+
result
);
log
.
info
(
"----认证结果result========="
+
result
);
//认证返回的参数是否为空
if
(!
StringUtils
.
isBlank
(
result
))
{
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
JSONObject
.
parse
(
result
);
log
.
info
(
"----certifRet========="
+
certifRet
);
log
.
info
(
"----certifRet========="
+
certifRet
);
if
(
MapUtil
.
isNotEmpty
(
map
)
||
certifResultCode
.
equals
(
map
.
get
(
certifRet
)))
{
//认证成功后存入保存到数据库
...
...
@@ -342,27 +341,35 @@ public class CertificationService {
//获得到期时间
String
endDate
=
(
String
)
backData
.
get
(
expirationDateName
);
log
.
info
(
"----获得到期时间endDate========="
+
endDate
);
log
.
info
(
"----获得到期时间endDate========="
+
endDate
);
if
(
StringUtils
.
isBlank
(
endDate
))
{
return
ObjectRestResponse
.
succ
();
}
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
formatter
.
setLenient
(
false
);
Date
expirationDate
=
null
;
try
{
expirationDate
=
formatter
.
parse
(
endDate
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
Date
expirationDate
=
new
Date
();
if
(!
Validation
.
isDate
(
endDate
))
{
Date
date
=
new
Date
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
c
.
add
(
Calendar
.
YEAR
,
100
);
expirationDate
=
c
.
getTime
();
}
else
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
formatter
.
setLenient
(
false
);
try
{
expirationDate
=
formatter
.
parse
(
endDate
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
idInformation
.
setExpirationDate
(
expirationDate
);
Boolean
aBoolean
=
addIdInformation
(
idInformation
);
log
.
info
(
"----请求admin========="
+
aBoolean
);
log
.
info
(
"----请求admin========="
+
aBoolean
);
if
(
aBoolean
)
{
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -389,7 +396,7 @@ public class CertificationService {
//
try
{
log
.
info
(
"----querys========="
+
querys
);
log
.
info
(
"----querys========="
+
querys
);
HttpResponse
response
=
CertifHttpUtils
.
doGet
(
cHost
,
cPath
,
cMethod
,
headers
,
querys
);
StatusLine
statusLine
=
response
.
getStatusLine
();
int
statusCode
=
statusLine
.
getStatusCode
();
...
...
@@ -439,7 +446,7 @@ public class CertificationService {
StatusLine
statusLine
=
response
.
getStatusLine
();
int
statusCode
=
statusLine
.
getStatusCode
();
log
.
info
(
"----statusCode========="
+
querys
);
log
.
info
(
"----statusCode========="
+
querys
);
/**
* 状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误
*/
...
...
@@ -462,7 +469,7 @@ public class CertificationService {
//认证通过保存到数据库当中
public
Boolean
addIdInformation
(
IdInformation
idInformation
)
{
log
.
info
(
"----idInformation========="
+
idInformation
);
log
.
info
(
"----idInformation========="
+
idInformation
);
//保存认证信息
try
{
...
...
@@ -474,7 +481,7 @@ public class CertificationService {
//认证成功后修改用户,用户认证状态
ObjectRestResponse
authentication
=
userFeign
.
authentication
(
idInformation
.
getUserLonginId
(),
idInformation
.
getName
(),
idInformation
.
getIdNumber
(),
1
);
ObjectRestResponse
authentication
=
userFeign
.
authentication
(
idInformation
.
getUserLonginId
(),
idInformation
.
getName
(),
idInformation
.
getIdNumber
(),
1
);
return
authentication
.
getRel
();
}
...
...
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