记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
903134aa
Commit
903134aa
authored
Jul 08, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现xuper数字账户开通
parent
d2543871
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
299 deletions
+59
-299
AdamEnum.java
...in/java/com/liquidnet/service/adam/constant/AdamEnum.java
+1
-0
XuperUserCommonBiz.java
...t/service/galaxy/router/xuper/biz/XuperUserCommonBiz.java
+6
-150
ZxinUserCommonBiz.java
...net/service/galaxy/router/zxin/biz/ZxinUserCommonBiz.java
+48
-145
GalaxyRouterStrategyXuperUserImpl.java
...uter/xuper/service/GalaxyRouterStrategyXuperUserImpl.java
+3
-1
GalaxyRouterStrategyZxlUserImpl.java
.../router/zxin/service/GalaxyRouterStrategyZxlUserImpl.java
+1
-3
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/constant/AdamEnum.java
View file @
903134aa
...
...
@@ -7,6 +7,7 @@ public class AdamEnum {
public
enum
BizAcct
{
IMHX
(
"imhx"
,
"即时通讯-环信"
),
NFT_ZX
(
"nft_zx"
,
"NFT-至信链"
),
NFT_XUPER
(
"nft_xuper"
,
"NFT-百度超级链"
),
;
private
final
String
code
;
private
final
String
desc
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperUserCommonBiz.java
View file @
903134aa
...
...
@@ -7,28 +7,20 @@ import com.liquidnet.common.third.xuper.dto.XuperResponseDto;
import
com.liquidnet.common.third.xuper.exception.XupterException
;
import
com.liquidnet.common.third.xuper.util.XuperSdkUtil
;
import
com.liquidnet.common.third.zxlnft.constant.ZxlErrorEnum
;
import
com.liquidnet.common
.third.zxlnft.exception.ZxlNftException
;
import
com.liquidnet.commons.lang.util.
*
;
import
com.liquidnet.
service.adam.constant.AdamEnum
;
import
com.liquidnet.common
s.lang.util.BASE64Util
;
import
com.liquidnet.commons.lang.util.
JsonUtils
;
import
com.liquidnet.
commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.galaxy.constant.GalaxyConstant
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto
;
import
com.liquidnet.service.galaxy.exception.GalaxyNftUserException
;
import
com.liquidnet.service.galaxy.utils.GalaxyDataUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.NftAccStatusEnum
;
import
com.liquidnet.service.goblin.dto.GoblinUserNftAccInfoVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.time.LocalDateTime
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -83,17 +75,6 @@ public class XuperUserCommonBiz {
userInfoBo
=
dataUtils
.
getGalaxyUserInfo
(
reqDto
.
getRouterType
(),
userId
);
if
(
userInfoBo
!=
null
){
mnemonic
=
userInfoBo
.
getMnemonic
();
if
(
StringUtil
.
isNotEmpty
(
userInfoBo
.
getBlockChainAddress
())){
try
{
//同步用户数字账户开通信息
boolean
isOpenAccount
=
syncOpenAccount
(
reqDto
,
respDto
.
getBlockChainAddress
(),
bizFailDesc
,
sysFailDesc
,
true
,
true
);
log
.
info
(
"用户 {} 数字账户开通结果:{}"
,
reqDto
.
getUserId
(),
isOpenAccount
);
}
catch
(
Exception
e
){
log
.
error
(
"同步用户数字账户开通信息异常:"
+
e
.
getMessage
(),
e
);
}
return
ResponseDto
.
failure
(
"已经开通过数字账户"
);
}
}
else
{
Xuper000CreateAccountReqDto
xuper000CreateAccountReqDto
=
Xuper000CreateAccountReqDto
.
getNew
();
// 创建区块链账户
...
...
@@ -138,14 +119,14 @@ public class XuperUserCommonBiz {
userInfoBo
.
setBlockChainAddress
(
address
);
dataUtils
.
setGalaxyUserInfo
(
reqDto
.
getRouterType
(),
reqDto
.
getUserId
(),
userInfoBo
);
}
catch
(
Exception
e
){
log
.
error
(
"设置用户信息异常 msg:{}"
,
e
.
getMessage
(),
e
);
throw
new
ZxlNftException
(
ZxlErrorEnum
.
FAILURE
.
getCode
(),
"
设置用户信息异常"
);
log
.
error
(
"
xuper
设置用户信息异常 msg:{}"
,
e
.
getMessage
(),
e
);
throw
new
XupterException
(
ZxlErrorEnum
.
FAILURE
.
getCode
(),
"xuper
设置用户信息异常"
);
}
}
}
catch
(
GalaxyNftUserException
e
)
{
bizFailDesc
=
e
.
getMessage
();
log
.
info
(
e
.
getMessage
());
}
catch
(
ZxlNft
Exception
e
){
}
catch
(
Xupter
Exception
e
){
sysFailDesc
=
e
.
getMessage
();
log
.
error
(
e
.
getMessage
(),
e
);
}
catch
(
Exception
e
){
...
...
@@ -165,14 +146,6 @@ public class XuperUserCommonBiz {
}
}
try
{
//同步用户数字账户开通信息
boolean
isOpenAccount
=
syncOpenAccount
(
reqDto
,
respDto
.
getBlockChainAddress
(),
bizFailDesc
,
sysFailDesc
,
isRealNameAuthSuccess
,
isBindBlockAddressSuccess
);
log
.
info
(
"用户 {} 数字账户开通结果:{}"
,
reqDto
.
getUserId
(),
isOpenAccount
);
}
catch
(
Exception
e
){
log
.
error
(
"同步用户数字账户开通信息异常:"
+
e
.
getMessage
(),
e
);
}
long
endTime
=
System
.
currentTimeMillis
();
log
.
info
(
"开通数字账户userRegister总耗时:{} "
,
endTime
-
startTime
);
...
...
@@ -184,121 +157,4 @@ public class XuperUserCommonBiz {
}
return
ResponseDto
.
success
(
respDto
);
}
/**
* 同步用户数字账户开通信息
* @param reqDto
* @param bizFailDesc
* @param sysFailDesc
* @param isRealNameAuthSuccess
* @param isBindBlockAddressSuccess
* @return
*/
private
boolean
syncOpenAccount
(
GalaxyUserRegisterReqDto
reqDto
,
String
blockChainAddress
,
String
bizFailDesc
,
String
sysFailDesc
,
boolean
isRealNameAuthSuccess
,
boolean
isBindBlockAddressSuccess
){
long
startTime
=
System
.
currentTimeMillis
();
long
openAccSuccessKeyExpireTime
=
3600
*
24
*
30
*
3
;
long
openAccFailKeyExpireTime
=
60
*
5
;
//是否开通数字账户
boolean
isOpenAccount
=
false
;
//开通失败错误信息
String
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
ING
.
getCode
();
String
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
ING
.
getMsg
();
//实名成功+绑定区块链地址成功
if
(
isRealNameAuthSuccess
&&
isBindBlockAddressSuccess
){
isOpenAccount
=
true
;
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
SUCCESS
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
SUCCESS
.
getMsg
();
}
//开通数字账户失败
if
(!
isOpenAccount
){
//实名失败
if
(!
isRealNameAuthSuccess
){
if
(
StringUtil
.
isNotEmpty
(
bizFailDesc
)){
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE1
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE1
.
getMsg
();
}
else
if
(
StringUtil
.
isNotEmpty
(
sysFailDesc
)){
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getMsg
();
}
}
else
{
//地址绑定失败
if
(!
isBindBlockAddressSuccess
){
if
(
StringUtil
.
isNotEmpty
(
bizFailDesc
)){
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE3
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE3
.
getMsg
();
}
else
if
(
StringUtil
.
isNotEmpty
(
sysFailDesc
)){
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getMsg
();
}
}
}
}
//更新至信链开户状态
GoblinUserNftAccInfoVo
goblinUserNftAccInfoVo
=
GoblinUserNftAccInfoVo
.
getNew
();
goblinUserNftAccInfoVo
.
setCode
(
resultCode
);
goblinUserNftAccInfoVo
.
setMsg
(
resultMessage
);
goblinUserNftAccInfoVo
.
setTime
(
LocalDateTime
.
now
());
if
(
isOpenAccount
){
//更新开户状态
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO
.
concat
(
reqDto
.
getUserId
())
,
goblinUserNftAccInfoVo
);
//同步用户信息到adam 格式:{uid},{mobile},{证件类型}{证件号},{姓名}
syncUserAccountInfoToAdam
(
reqDto
);
//同步业务账号关联关系到adam
dataUtils
.
getQueueUtil
().
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_STORE
.
getKey
(),
SqlMapping
.
get
(
"adam_user_busi_acct.add"
,
reqDto
.
getUserId
(),
AdamEnum
.
BizAcct
.
NFT_ZX
.
name
(),
blockChainAddress
,
null
,
null
,
1
,
LocalDateTime
.
now
())
);
//开户成功记录缓存 {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA
.
concat
(
reqDto
.
getIdCardType
().
concat
(
reqDto
.
getIdCard
()))
,
reqDto
.
getUserName
().
concat
(
","
).
concat
(
reqDto
.
getMobile
()),
openAccSuccessKeyExpireTime
);
}
else
{
//更新开户状态
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO
.
concat
(
reqDto
.
getUserId
())
,
goblinUserNftAccInfoVo
);
}
//设置错误信息到redis
if
(
StringUtil
.
isNotEmpty
(
resultCode
)&&
resultCode
.
equalsIgnoreCase
(
NftAccStatusEnum
.
StatusAcc
.
FAILURE1
.
getCode
())){
//开户失败记录缓存 {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA_JUNK
.
concat
(
reqDto
.
getIdCardType
().
concat
(
reqDto
.
getIdCard
()))
,
reqDto
.
getUserName
().
concat
(
","
).
concat
(
reqDto
.
getMobile
()),
openAccFailKeyExpireTime
);
}
long
endTime
=
System
.
currentTimeMillis
();
log
.
info
(
"同步数字账户syncOpenAccount总耗时:{} "
,
endTime
-
startTime
);
return
isOpenAccount
;
}
/**
* 同步用户信息到adam 格式:{uid},{mobile},{证件类型}{证件号},{姓名}
* @param reqDto
* @return
*/
private
boolean
syncUserAccountInfoToAdam
(
GalaxyUserRegisterReqDto
reqDto
)
{
try
{
String
certmetaInfo
=
reqDto
.
getUserId
().
concat
(
","
)
.
concat
(
reqDto
.
getMobile
()).
concat
(
","
)
.
concat
(
reqDto
.
getIdCardType
().
concat
(
reqDto
.
getIdCard
())).
concat
(
","
)
.
concat
(
reqDto
.
getUserName
());
//加密用户信息
DESUtils
desUtils
=
DESUtils
.
DES
();
// MultiValueMap<String, String> params = new LinkedMultiValueMap();
// params.add("certmeta",desUtils.encrypt(certmetaInfo));
//
// HttpUtil.post(adamUrl + GalaxyConstant.ADAM_USER_SYNC_URL, params);
HttpUtil
.
postJson
(
adamUrl
+
GalaxyConstant
.
ADAM_USER_SYNC_URL
,
desUtils
.
encrypt
(
certmetaInfo
));
}
catch
(
Exception
e
)
{
log
.
error
(
"同步用户信息到adam异常:{}"
,
JsonUtils
.
toJson
(
reqDto
),
e
);
return
false
;
}
return
true
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinUserCommonBiz.java
View file @
903134aa
...
...
@@ -23,6 +23,7 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import
com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto
;
import
com.liquidnet.service.galaxy.exception.GalaxyNftUserException
;
import
com.liquidnet.service.galaxy.router.xuper.biz.XuperUserCommonBiz
;
import
com.liquidnet.service.galaxy.utils.GalaxyDataUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.NftAccStatusEnum
;
...
...
@@ -34,6 +35,7 @@ import org.springframework.stereotype.Component;
import
java.io.UnsupportedEncodingException
;
import
java.time.LocalDateTime
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
...
...
@@ -63,6 +65,9 @@ public class ZxinUserCommonBiz {
@Value
(
"${liquidnet.service.adam.url}"
)
private
String
adamUrl
;
@Autowired
private
XuperUserCommonBiz
xuperUserCommonBiz
;
public
ResponseDto
<
GalaxyUserRegisterRespDto
>
userRegister
(
GalaxyUserRegisterReqDto
reqDto
)
{
long
startTime
=
System
.
currentTimeMillis
();
String
userId
=
reqDto
.
getUserId
();
...
...
@@ -96,16 +101,16 @@ public class ZxinUserCommonBiz {
userInfoBo
=
dataUtils
.
getGalaxyUserInfo
(
reqDto
.
getRouterType
(),
userId
);
if
(
userInfoBo
!=
null
){
mnemonic
=
userInfoBo
.
getMnemonic
();
if
(
StringUtil
.
isNotEmpty
(
userInfoBo
.
getBlockChainAddress
())){
try
{
//同步用户数字账户开通信息
boolean
isOpenAccount
=
syncOpenAccount
(
reqDto
,
respDto
.
getBlockChainAddress
(),
bizFailDesc
,
sysFailDesc
,
true
,
true
);
log
.
info
(
"用户 {} 数字账户开通结果:{}"
,
reqDto
.
getUserId
(),
isOpenAccount
);
}
catch
(
Exception
e
){
log
.
error
(
"同步用户数字账户开通信息异常:"
+
e
.
getMessage
(),
e
);
}
return
ResponseDto
.
failure
(
"已经开通过数字账户"
);
}
//
if(StringUtil.isNotEmpty(userInfoBo.getBlockChainAddress())){
//
try{
//
//同步用户数字账户开通信息
//
boolean isOpenAccount = syncOpenAccount(reqDto,respDto.getBlockChainAddress(),bizFailDesc,sysFailDesc,true,true);
//
log.info("用户 {} 数字账户开通结果:{}",reqDto.getUserId(),isOpenAccount);
//
}catch(Exception e){
//
log.error("同步用户数字账户开通信息异常:"+e.getMessage(),e);
//
}
//
return ResponseDto.failure("已经开通过数字账户");
//
}
}
else
{
try
{
//生成助记词
...
...
@@ -277,6 +282,7 @@ public class ZxinUserCommonBiz {
return
ResponseDto
.
success
(
respDto
);
}
/**
* 同步用户数字账户开通信息
* @param reqDto
...
...
@@ -298,8 +304,14 @@ public class ZxinUserCommonBiz {
String
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
ING
.
getCode
();
String
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
ING
.
getMsg
();
//百度链开通数字账户
boolean
isOpenXuperUserSuccess
=
false
;
ResponseDto
<
GalaxyUserRegisterRespDto
>
xuperUserRegisterRespDto
=
this
.
isOpenXuperUserSuccess
(
reqDto
);;
if
(
xuperUserRegisterRespDto
.
isSuccess
()){
isOpenXuperUserSuccess
=
true
;
}
//实名成功+绑定区块链地址成功
if
(
isRealNameAuthSuccess
&&
isBindBlockAddressSuccess
){
if
(
isRealNameAuthSuccess
&&
isBindBlockAddressSuccess
&&
isOpenXuperUserSuccess
){
isOpenAccount
=
true
;
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
SUCCESS
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
SUCCESS
.
getMsg
();
...
...
@@ -326,6 +338,9 @@ public class ZxinUserCommonBiz {
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getMsg
();
}
}
else
if
(!
isOpenXuperUserSuccess
){
resultCode
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getCode
();
resultMessage
=
NftAccStatusEnum
.
StatusAcc
.
FAILURE2
.
getMsg
();
}
}
}
...
...
@@ -345,8 +360,15 @@ public class ZxinUserCommonBiz {
syncUserAccountInfoToAdam
(
reqDto
);
//同步业务账号关联关系到adam
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
sqlsDataA
.
add
(
new
Object
[]{
reqDto
.
getUserId
(),
AdamEnum
.
BizAcct
.
NFT_ZX
.
name
(),
blockChainAddress
,
null
,
null
,
1
,
LocalDateTime
.
now
()
});
sqlsDataA
.
add
(
new
Object
[]{
reqDto
.
getUserId
(),
AdamEnum
.
BizAcct
.
NFT_XUPER
.
name
(),
blockChainAddress
,
null
,
null
,
1
,
LocalDateTime
.
now
()
});
dataUtils
.
getQueueUtil
().
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_STORE
.
getKey
(),
SqlMapping
.
get
(
"adam_user_busi_acct.add"
,
reqDto
.
getUserId
(),
AdamEnum
.
BizAcct
.
NFT_ZX
.
name
(),
blockChainAddress
,
null
,
null
,
1
,
LocalDateTime
.
now
()
)
SqlMapping
.
get
(
"adam_user_busi_acct.add"
,
sqlsDataA
)
);
//开户成功记录缓存 {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
...
...
@@ -377,9 +399,9 @@ public class ZxinUserCommonBiz {
private
boolean
syncUserAccountInfoToAdam
(
GalaxyUserRegisterReqDto
reqDto
)
{
try
{
String
certmetaInfo
=
reqDto
.
getUserId
().
concat
(
","
)
.
concat
(
reqDto
.
getMobile
()).
concat
(
","
)
.
concat
(
reqDto
.
getIdCardType
().
concat
(
reqDto
.
getIdCard
())).
concat
(
","
)
.
concat
(
reqDto
.
getUserName
());
.
concat
(
reqDto
.
getMobile
()).
concat
(
","
)
.
concat
(
reqDto
.
getIdCardType
().
concat
(
reqDto
.
getIdCard
())).
concat
(
","
)
.
concat
(
reqDto
.
getUserName
());
//加密用户信息
DESUtils
desUtils
=
DESUtils
.
DES
();
// MultiValueMap<String, String> params = new LinkedMultiValueMap();
...
...
@@ -388,139 +410,20 @@ public class ZxinUserCommonBiz {
// HttpUtil.post(adamUrl + GalaxyConstant.ADAM_USER_SYNC_URL, params);
HttpUtil
.
postJson
(
adamUrl
+
GalaxyConstant
.
ADAM_USER_SYNC_URL
,
desUtils
.
encrypt
(
certmetaInfo
));
}
catch
(
Exception
e
)
{
log
.
error
(
"同步用户信息到adam异常:{}"
,
JsonUtils
.
toJson
(
reqDto
),
e
);
log
.
error
(
"同步用户信息到adam异常:{}"
,
JsonUtils
.
toJson
(
reqDto
),
e
);
return
false
;
}
return
true
;
}
// public ResponseDto<GalaxyUserRegisterRespDto> userRegister2(GalaxyUserRegisterReqDto reqDto) {
// String userId = reqDto.getUserId();
// String userName = reqDto.getUserName();
// String mobile = reqDto.getMobile();
// String idCardType = reqDto.getIdCardType();
// String idCard = reqDto.getIdCard();
// String mnemonic = null;
// Long index = 0L;
// String userIdentification = null;
// String address = null;
// String userPubKey = null;
// String userPriKey = null;
//
// GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),userId);
// if(userInfoBo!=null){
// mnemonic = userInfoBo.getMnemonic();
// }else{
// try{
// //生成助记词
// CreateMnemonicReq req = CreateMnemonicReq.getNew();
// CreateMnemonicResp createMnemonicResp = zxlWalletSdkUtil.createMnemonic(req);
// mnemonic = createMnemonicResp.getMnemonic();
// }catch(Exception e){
// throw new ZxlNftException(ZxlErrorEnum.FAILURE.getCode(),"生成助记词失败!");
// }
// }
//
//
// /**
// * todo 把助记词进行redis存储 key=userID mnemonic/index/userIdentification/address
// */
//
// if(StringUtil.isNotEmpty(mnemonic)){
// //生成公私钥
// DeriveKeyPairReq deriveKeyPairReq = DeriveKeyPairReq.getNew();
// deriveKeyPairReq.setMnemonic(mnemonic);
//// deriveKeyPairReq.setMnemonic(createMnemonicResp.getMnemonic());
// deriveKeyPairReq.setIndex(index);
// try{
// DeriveKeyPairResp deriveKeyPairResp = zxlWalletSdkUtil.deriveKeyPair(deriveKeyPairReq);
// if(!deriveKeyPairResp.getErr().equals("")) throw new Exception("生成公私钥失败!");
// userPubKey = BASE64Util.encoded(deriveKeyPairResp.getPubKey());
// userPriKey = BASE64Util.encoded(deriveKeyPairResp.getPriKey());
// }catch(Exception e){
// throw new ZxlNftException(ZxlErrorEnum.FAILURE.getCode(),e.getMessage());
// }
// }
//
// //1.2.1调用自然人注册实名(使用NFT平台签名)接口
// Nft003RegisterPersonPlatformReqDto nft003ReqDto = Nft003RegisterPersonPlatformReqDto.getNew();
// nft003ReqDto.setPersonName(userName);
//// reqDto.setEmail("");
// nft003ReqDto.setMobile(mobile);
// nft003ReqDto.setIdCard(idCard);
//
// nft003ReqDto.setCardType(Integer.valueOf(idCardType));
// ZxlnftResponseDto<Nft003RegisterPersonPlatformRespDto> nft003Resp = zxlnftSdkUtil.nft003RegisterPersonPlatform(nft003ReqDto);
//
// if(nft003Resp.isSuccess()){
// userIdentification = nft003Resp.getData().getUserIdentification();
// }else{
// return ResponseDto.failure(nft003Resp.getCode(),nft003Resp.getMessage());
// }
//
// GalaxyUserRegisterRespDto respDto = GalaxyUserRegisterRespDto.getNew();
//
// if(StringUtil.isNotEmpty(userPubKey)&&StringUtil.isNotEmpty(userPriKey)&&StringUtil.isNotEmpty(userIdentification)){
// //1.2.2调用授信平台NFT地址绑定接口
// Nft014IdentityBindSubmitByTrustedReqDto nft014ReqDto = Nft014IdentityBindSubmitByTrustedReqDto.getNew();
//
// try {
// nft014ReqDto.setUserPubKey(BASE64Util.decode(userPubKey));
// nft014ReqDto.setUserIdentification(nft003Resp.getData().getUserIdentification());
//
// String signature = zxlnftBiz.createSign(BASE64Util.decode(userPriKey),nft014ReqDto.getUserIdentification());
// nft014ReqDto.setUserSignData(signature);
// } catch (UnsupportedEncodingException e) {
// log.error("公私钥解密错误!");
// }
//
// ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> nft014Resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(nft014ReqDto);
//
// ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> nft016Resp = null;
// if(nft014Resp.isSuccess()){
// //1.2.3调用绑定状态批量查询
// Nft016IdentityBindQueryReqDto nft016ReqDto = Nft016IdentityBindQueryReqDto.getNew();
// nft016ReqDto.setAddressList(nft014Resp.getData().getAddress());
// nft016Resp = zxlnftSdkUtil.nft016IdentityBindQuery(nft016ReqDto);
// }else{
// log.info("nft014Resp 返回结果:{}",nft014Resp.toJson());
// return ResponseDto.failure(nft014Resp.getCode(),nft014Resp.getMessage());
// }
//
// if(StringUtil.isNotNull(nft016Resp)&&nft016Resp.isSuccess()){
// List<Nft016QueryRsData> queryRsDataList = nft016Resp.getData().getList();
// Nft016QueryRsData queryRsData = queryRsDataList.get(0);
// address = queryRsData.getAddress();
// log.info("nft016Resp 返回结果:{}",nft016Resp.toJson());
// //构造返回参数
// respDto.setUserId(userId);
// respDto.setBlockChainType(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode());
// respDto.setBlockChainAddress(address);
// }else{
// return ResponseDto.failure(nft016Resp.getMessage());
// }
//
//
// //构造缓存数据
// if(userInfoBo==null){
// userInfoBo = GalaxyUserInfoBo.getNew();
// userInfoBo.setUserId(userId);
// userInfoBo.setUserName(userName);
// userInfoBo.setMobile(mobile);
// userInfoBo.setIdCardType(idCardType);
// userInfoBo.setIdCard(idCard);
// userInfoBo.setMnemonic(mnemonic);
// userInfoBo.setIndex(index.toString());
// userInfoBo.setUserIdentification(userIdentification);
// userInfoBo.setUserPubKey(userPubKey);
// userInfoBo.setUserPriKey(userPriKey);
// userInfoBo.setRouterType(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode());
// userInfoBo.setBlockChainAddress(address);
// dataUtils.setGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId(),userInfoBo);
// }else{
//
// }
// }
// return ResponseDto.success(respDto);
// }
/**
* 是否开通xuper数字账户
* @param reqDto
* @return
*/
private
ResponseDto
<
GalaxyUserRegisterRespDto
>
isOpenXuperUserSuccess
(
GalaxyUserRegisterReqDto
reqDto
){
reqDto
.
setRouterType
(
GalaxyEnum
.
RouterTypeEnum
.
XUPER
.
getCode
());
return
xuperUserCommonBiz
.
userRegister
(
reqDto
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/xuper/service/GalaxyRouterStrategyXuperUserImpl.java
View file @
903134aa
...
...
@@ -31,7 +31,9 @@ public class GalaxyRouterStrategyXuperUserImpl implements IGalaxyRouterStrategyU
@Override
public
ResponseDto
<
GalaxyUserRegisterRespDto
>
userRegister
(
GalaxyUserRegisterReqDto
reqDto
)
{
return
xuperUserBiz
.
userRegister
(
reqDto
);
//暂时屏蔽xuper开户,直接通过至信链实名开户
// return xuperUserBiz.userRegister(reqDto);
return
null
;
}
@Override
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/service/GalaxyRouterStrategyZxlUserImpl.java
View file @
903134aa
package
com
.
liquidnet
.
service
.
galaxy
.
router
.
zxin
.
service
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryRespDto
;
...
...
@@ -38,7 +36,7 @@ public class GalaxyRouterStrategyZxlUserImpl implements IGalaxyRouterStrategyUse
@Override
public
ResponseDto
<
GalaxyUserRegisterRespDto
>
userRegister
(
GalaxyUserRegisterReqDto
reqDto
)
{
//测试发送队列
queueUtil
.
sendMsgByRedis
(
MQConst
.
GalaxyQueue
.
JSON_NFT_USER_REGISTER
.
getKey
(),
JsonUtils
.
toJson
(
reqDto
));
//
queueUtil.sendMsgByRedis(MQConst.GalaxyQueue.JSON_NFT_USER_REGISTER.getKey(), JsonUtils.toJson(reqDto));
// return ResponseDto.success();
return
zxinUserBiz
.
userRegister
(
reqDto
);
}
...
...
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