Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
qinchao
6 years ago
Commit
9603a056e4a0e303929fa24c005b82042397f44f
1 parent
d253b81d
芝麻认知的开关
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
13 deletions
dal/src/main/java/com/yohoufo/dal/order/model/StoredSeller.java
dal/src/main/resources/META-INF/mybatis/order/StoredSellerMapper.xml
order/src/main/java/com/yohoufo/order/service/impl/StoreSellerServiceImpl.java
users/src/main/java/com/yohoufo/user/controller/passport/RealNameAuthorizeController.java
users/src/main/java/com/yohoufo/user/service/IRealNameAuthorizeService.java
users/src/main/java/com/yohoufo/user/service/impl/RealNameAuthorizeServiceImpl.java
web/src/main/resources/config.properties
web/src/main/webapp/META-INF/autoconf/config.properties
dal/src/main/java/com/yohoufo/dal/order/model/StoredSeller.java
View file @
9603a05
...
...
@@ -37,4 +37,7 @@ public class StoredSeller {
private
long
updateTime
;
//是否跳过了芝麻认证,1: 跳过 ,default 0
private
Integer
breakZhiMaCert
;
}
...
...
dal/src/main/resources/META-INF/mybatis/order/StoredSellerMapper.xml
View file @
9603a05
...
...
@@ -13,10 +13,11 @@
<result
column=
"quit_time"
property=
"quitTime"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"INTEGER"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"INTEGER"
/>
<result
column=
"break_zhi_ma_cert"
property=
"breakZhiMaCert"
jdbcType=
"TINYINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time ,create_time, update_time
id, uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time ,create_time, update_time
,break_zhi_ma_cert
</sql>
<select
id=
"selectValidByUid"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
...
...
@@ -28,16 +29,16 @@
</select>
<insert
id=
"insert"
parameterType=
"com.yohoufo.dal.order.model.StoredSeller"
>
insert into stored_seller (uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time, create_time, update_time)
insert into stored_seller (uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time, create_time, update_time
,break_zhi_ma_cert
)
values (#{uid},#{validStatus},
#{certNo},#{certName},#{operatorUid},#{operatorName},
#{enterTime},#{quitTime},
#{createTime},#{updateTime})
#{createTime},#{updateTime}
,#{breakZhiMaCert}
)
</insert>
<update
id=
"updateStatusByUid"
>
update stored_seller
set valid_status = #{validStatus},update_time = #{updateTime}
set valid_status = #{validStatus},update_time = #{updateTime}
,quit_time = #{updateTime}
where uid = #{uid} and valid_status = #{expectStatus}
</update>
...
...
order/src/main/java/com/yohoufo/order/service/impl/StoreSellerServiceImpl.java
View file @
9603a05
...
...
@@ -13,6 +13,7 @@ import com.yohoufo.order.service.proxy.InBoxFacade;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
...
...
@@ -36,6 +37,10 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
@Autowired
StoredSellerCacheService
storedSellerCacheService
;
@Value
(
"${zhimacert.switch}"
)
private
boolean
zhiMaCertSwitch
;
/**
* 是否入驻商户
* @param uid
...
...
@@ -55,8 +60,13 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
public
Map
<
String
,
Boolean
>
entryStatus
(
Integer
uid
){
logger
.
info
(
"StoredSellerServiceImpl entryStatus uid is {} "
,
uid
);
Boolean
isZhiMaCert
=
false
;
ZhiMaCert
zhiMaCert
=
getZhiMaCertInfo
(
uid
);
if
(
null
!=
zhiMaCert
){
if
(
zhiMaCertSwitch
){
ZhiMaCert
zhiMaCert
=
getZhiMaCertInfo
(
uid
);
if
(
null
!=
zhiMaCert
){
isZhiMaCert
=
true
;
}
}
else
{
isZhiMaCert
=
true
;
}
...
...
@@ -99,6 +109,14 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
logger
.
info
(
"StoredSellerServiceImpl addUserAsStoredSeller enter uid is {} "
,
uid
);
//检查是否已经实名认证
ZhiMaCert
zhiMaCert
=
getZhiMaCertInfo
(
uid
);
int
breakZhiMaCert
=
0
;
//芝麻认证没开启,并且没有认证
if
(!
zhiMaCertSwitch
&&
zhiMaCert
==
null
){
zhiMaCert
=
new
ZhiMaCert
();
breakZhiMaCert
=
1
;
}
if
(
null
==
zhiMaCert
){
logger
.
error
(
"StoredSellerServiceImpl get zhi ma cert info is null , uid is {} "
,
uid
);
throw
new
ServiceException
(
400
,
"商户没有实名认证通过,不允许入驻"
);
...
...
@@ -114,6 +132,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
storedSeller
.
setCertName
(
zhiMaCert
.
getCertName
());
storedSeller
.
setCreateTime
(
ts
);
storedSeller
.
setUpdateTime
(
ts
);
storedSeller
.
setBreakZhiMaCert
(
breakZhiMaCert
);
logger
.
info
(
"StoredSellerServiceImpl addUserAsStoredSeller insert uid is {} , storedSeller {} "
,
uid
,
storedSeller
);
int
num
=
storedSellerMapper
.
insert
(
storedSeller
);
if
(
num
<
0
){
...
...
users/src/main/java/com/yohoufo/user/controller/passport/RealNameAuthorizeController.java
View file @
9603a05
...
...
@@ -95,11 +95,7 @@ public class RealNameAuthorizeController {
throw
new
GatewayException
(
400
,
"参数错误,uid不存在!"
);
}
ZhiMaCert
zhiMaCertInfo
=
realNameAuthorizeService
.
getValidZhiMaCert
(
uid
);
boolean
isZhiMaCert
=
false
;
if
(
zhiMaCertInfo
!=
null
){
isZhiMaCert
=
true
;
}
boolean
isZhiMaCert
=
realNameAuthorizeService
.
isValidZhiMaCert
(
uid
);
return
new
ApiResponse
(
isZhiMaCert
);
}
...
...
users/src/main/java/com/yohoufo/user/service/IRealNameAuthorizeService.java
View file @
9603a05
...
...
@@ -18,6 +18,7 @@ public interface IRealNameAuthorizeService {
void
saveAuthorizeInfo
(
RealNameAuthorizeReqVO
reqVO
);
boolean
isValidZhiMaCert
(
int
uid
);
ZhiMaCert
getValidZhiMaCert
(
int
uid
);
...
...
users/src/main/java/com/yohoufo/user/service/impl/RealNameAuthorizeServiceImpl.java
View file @
9603a05
...
...
@@ -28,6 +28,7 @@ import org.apache.commons.lang.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
...
...
@@ -51,6 +52,9 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
@Autowired
private
HttpClient
httpClient
;
@Value
(
"${zhimacert.switch}"
)
private
boolean
zhiMaCertSwitch
;
/* @Autowired
private GraphVerifyService graphVerifyService;*/
...
...
@@ -269,6 +273,19 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
logger
.
info
(
"autoBindAliPayAccount success!uid={}, alipayUid={}, nickName={} "
,
uid
,
alipayUid
,
nickName
);
}
public
boolean
isValidZhiMaCert
(
int
uid
){
//如果芝麻认知没有开启,默认芝麻认证通过
if
(!
zhiMaCertSwitch
){
return
true
;
}
//否则,从db查询认证信息
if
(
null
!=
this
.
getValidZhiMaCert
(
uid
)){
return
true
;
}
return
false
;
}
@Override
public
ZhiMaCert
getValidZhiMaCert
(
int
uid
)
{
logger
.
info
(
"RealNameAuthorizeServiceImpl getZhiMaCert uid is {} "
,
uid
);
...
...
@@ -293,7 +310,7 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
public
AuthorizeResultRespVO
zhiMaCertInit
(
RealNameAuthorizeReqVO
reqVO
)
{
logger
.
info
(
"real name zhiMaCertInit reqVO {}"
,
reqVO
);
//检查是否已经认证,如果已经认证,报错
if
(
null
!=
this
.
get
ValidZhiMaCert
(
reqVO
.
getUid
()))
{
if
(
is
ValidZhiMaCert
(
reqVO
.
getUid
()))
{
throw
new
ServiceException
(
400
,
"已实名认证!"
);
}
//检查身份证号认证信息是否已经存在,存在则不允许再次使用
...
...
@@ -303,7 +320,6 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
//调用芝麻接口,返回biz_no
//构建唯一的 transaction_id : ufoCert+id
LocalDateTime
now
=
getLocalDateTime
();
Long
nowSecond
=
LocalDateTime
.
now
().
toEpochSecond
(
ZoneOffset
.
of
(
"+8"
));
//存储认证信息
...
...
web/src/main/resources/config.properties
View file @
9603a05
...
...
@@ -2,6 +2,9 @@
deposit.prestore
=
999
# 保证金充值列表
deposit.recharge.list
=
1000,2000,5000,10000
# 芝麻认证开始开关,如果为false,芝麻认知直接返回通过
zhimacert.switch
=
false
# ******************** service call timeout in mil-seconds ********************
service.call.connectReqTimeout
=
6000
service.call.socketTimeout
=
6000
...
...
web/src/main/webapp/META-INF/autoconf/config.properties
View file @
9603a05
...
...
@@ -3,6 +3,9 @@ deposit.prestore=${depositPrestore}
# 保证金充值列表
deposit.recharge.list
=
${depositRechargeList}
# 芝麻认证开始开关,如果为false,芝麻认知直接返回通过
zhimacert.switch
=
${zhiMaCertSwitch}
# if true, client_security check may be disabled.
is_debug_enable
=
${is_debug_enable}
# ******************** service call timeout in mil-seconds ********************
...
...
Please
register
or
login
to post a comment