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
85053ab3
Commit
85053ab3
authored
Nov 25, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-modify-background-bug-hf' into dev
parents
a2f72f21
0518dd7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
pom.xml
xx-universal/xx-universal-server/pom.xml
+6
-0
CertificationService.java
...xxfc/platform/universal/service/CertificationService.java
+35
-2
No files found.
xx-universal/xx-universal-server/pom.xml
View file @
85053ab3
...
@@ -99,6 +99,12 @@
...
@@ -99,6 +99,12 @@
<version>
0.2
</version>
<version>
0.2
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
xx-app-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/CertificationService.java
View file @
85053ab3
...
@@ -9,6 +9,8 @@ import com.github.wxiaoqi.security.common.constant.RestCode;
...
@@ -9,6 +9,8 @@ import com.github.wxiaoqi.security.common.constant.RestCode;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.feign.ConfigFeign
;
import
com.xxfc.platform.universal.biz.UserMessage
;
import
com.xxfc.platform.universal.biz.UserMessage
;
import
com.xxfc.platform.universal.entity.IDCardInformation
;
import
com.xxfc.platform.universal.entity.IDCardInformation
;
import
com.xxfc.platform.universal.entity.IdInformation
;
import
com.xxfc.platform.universal.entity.IdInformation
;
...
@@ -17,6 +19,8 @@ import com.xxfc.platform.universal.service.PictureParsing.UserPictureParsing;
...
@@ -17,6 +19,8 @@ import com.xxfc.platform.universal.service.PictureParsing.UserPictureParsing;
import
com.xxfc.platform.universal.service.authenticationInterface.UserAuthentication
;
import
com.xxfc.platform.universal.service.authenticationInterface.UserAuthentication
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.utils.Validation
;
import
com.xxfc.platform.universal.utils.Validation
;
import
lombok.AllArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.collections4.map.HashedMap
;
...
@@ -46,16 +50,22 @@ import java.util.*;
...
@@ -46,16 +50,22 @@ import java.util.*;
*/
*/
@Service
@Service
@Slf4j
@Slf4j
@AllArgsConstructor
@NoArgsConstructor
public
class
CertificationService
{
public
class
CertificationService
{
@Value
(
"${certification.frequency:2}"
)
@Value
(
"${certification.frequency:2}"
)
private
Integer
FREQUENCY
;
private
Integer
FREQUENCY
;
@Autowired
private
ConfigFeign
configFeign
;
@Autowired
@Autowired
private
UserAuthentication
authentication
;
private
UserAuthentication
authentication
;
@Autowired
@Autowired
private
IdInformationMapper
idInformationMapper
;
private
IdInformationMapper
idInformationMapper
;
@Autowired
@Autowired
private
UserFeign
userFeign
;
private
UserFeign
userFeign
;
...
@@ -65,6 +75,9 @@ public class CertificationService {
...
@@ -65,6 +75,9 @@ public class CertificationService {
@Autowired
@Autowired
private
UserPictureParsing
userPictureParsing
;
private
UserPictureParsing
userPictureParsing
;
private
String
AUTHENTICATION_TYPE
=
"100"
;
/**
/**
* 一、身份证图片进行实名认证
* 一、身份证图片进行实名认证
*
*
...
@@ -112,7 +125,8 @@ public class CertificationService {
...
@@ -112,7 +125,8 @@ public class CertificationService {
Example
exa
=
new
Example
(
IdInformation
.
class
);
Example
exa
=
new
Example
(
IdInformation
.
class
);
exa
.
createCriteria
().
andEqualTo
(
"idNumber"
,
number
);
exa
.
createCriteria
().
andEqualTo
(
"idNumber"
,
number
);
List
<
IdInformation
>
idInformatics
=
idInformationMapper
.
selectByExample
(
exa
);
List
<
IdInformation
>
idInformatics
=
idInformationMapper
.
selectByExample
(
exa
);
if
(
CollectionUtils
.
isNotEmpty
(
idInformatics
)
&&
idInformatics
.
size
()
>
FREQUENCY
)
{
if
(
CollectionUtils
.
isNotEmpty
(
idInformatics
)
&&
idInformatics
.
size
()
>
getCofig
()
)
{
log
.
error
(
"该身份证已超过最大认证次数"
);
log
.
error
(
"该身份证已超过最大认证次数"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"该身份证已超过最大认证次数"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"该身份证已超过最大认证次数"
);
}
}
...
@@ -163,6 +177,25 @@ public class CertificationService {
...
@@ -163,6 +177,25 @@ public class CertificationService {
}
}
/**
* 获取认证次数
* @return
*/
public
Integer
getCofig
()
{
List
<
Cofig
>
cofigs
=
null
;
try
{
cofigs
=
configFeign
.
getAllByType
(
AUTHENTICATION_TYPE
).
getData
();
log
.
info
(
"cofigs={}"
,
cofigs
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
e
.
getMessage
());
}
if
(
CollectionUtils
.
isEmpty
(
cofigs
))
{
return
FREQUENCY
;
}
return
Integer
.
valueOf
(
cofigs
.
get
(
0
).
getParams
());
}
/**
/**
* 二、认证通过保存到数据库当中
* 二、认证通过保存到数据库当中
*
*
...
...
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