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
36d5fdae
Commit
36d5fdae
authored
Nov 21, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实名认证
parent
19bc328c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
CertificationService.java
...xxfc/platform/universal/service/CertificationService.java
+16
-16
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/CertificationService.java
View file @
36d5fdae
...
...
@@ -45,6 +45,8 @@ import java.util.*;
@Service
@Slf4j
public
class
CertificationService
{
@Value
(
"${}"
)
private
Integer
FREQUENCY
;
@Autowired
private
UserAuthentication
authentication
;
...
...
@@ -62,7 +64,8 @@ public class CertificationService {
private
UserPictureParsing
userPictureParsing
;
/**
* 一、身份证图片进行实名认证
* 一、身份证图片进行实名认证
*
* @param idInformation
* @return
*/
...
...
@@ -98,10 +101,18 @@ public class CertificationService {
String
name
=
credentialsData
.
getName
();
String
number
=
credentialsData
.
getCode
();
if
(
idInformation
.
getName
().
equals
(
name
))
{
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"姓名不一致"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"姓名不一致"
);
}
if
(
idInformation
.
getIdNumber
().
equals
(
number
))
{
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"证件号不一致"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"证件号不一致"
);
}
//判断是否超过认证次数
Example
exa
=
new
Example
(
IdInformation
.
class
);
exa
.
createCriteria
().
andEqualTo
(
"idNumber"
,
number
);
List
<
IdInformation
>
idInformatics
=
idInformationMapper
.
selectByExample
(
exa
);
if
(
CollectionUtils
.
isNotEmpty
(
idInformatics
)
&&
idInformatics
.
size
()
>
FREQUENCY
)
{
log
.
error
(
"该身份证已超过最大认证次数"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"该身份证已超过最大认证次数"
);
}
//3.验证
boolean
result
=
authentication
.
certificate
(
new
UserMessage
()
{{
...
...
@@ -159,23 +170,12 @@ public class CertificationService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ObjectRestResponse
<
Integer
>
addIdInformation
(
IdInformation
idInformation
)
{
log
.
info
(
"----idInformation========="
+
idInformation
);
//保存认证信息
try
{
Example
exa
=
new
Example
(
IdInformation
.
class
);
Example
.
Criteria
criteria
=
exa
.
createCriteria
();
criteria
.
andEqualTo
(
"idNumber"
,
idInformation
.
getIdNumber
());
List
<
IdInformation
>
idInformatics
=
idInformationMapper
.
selectByExample
(
exa
);
if
(
CollectionUtils
.
isEmpty
(
idInformatics
))
{
idInformation
.
setCrtTime
(
new
Date
());
idInformationMapper
.
insertSelective
(
idInformation
);
}
else
{
log
.
error
(
"该身份证已存在,不要重复认证"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"该身份证已存在,不要重复认证"
);
}
idInformationMapper
.
insertSelective
(
idInformation
);
log
.
info
(
"----addIdInformation---userid==="
+
idInformation
.
getUserLoginId
()
+
"----name===="
+
idInformation
.
getName
()
+
"---IdNumber==="
+
idInformation
.
getIdNumber
());
//认证成功后修改用户,用户认证状态
ObjectRestResponse
authentication
=
userFeign
.
authentication
(
idInformation
.
getUserLoginId
(),
idInformation
.
getName
(),
idInformation
.
getIdNumber
(),
1
);
userFeign
.
authentication
(
idInformation
.
getUserLoginId
(),
idInformation
.
getName
(),
idInformation
.
getIdNumber
(),
1
);
return
ObjectRestResponse
.
succ
(
idInformation
.
getId
());
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
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