记得上下班打卡 | 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
dd872d53
Commit
dd872d53
authored
Apr 20, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新购买逻辑修复购买失败记录
parent
51882d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
35 deletions
+45
-35
ZxinTradeCommonBiz.java
...et/service/galaxy/router/zxin/biz/ZxinTradeCommonBiz.java
+45
-35
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinTradeCommonBiz.java
View file @
dd872d53
...
@@ -345,45 +345,55 @@ public class ZxinTradeCommonBiz {
...
@@ -345,45 +345,55 @@ public class ZxinTradeCommonBiz {
String
nftBuyTradeHash
=
null
;
String
nftBuyTradeHash
=
null
;
String
nftBuyPayTaskId
=
null
;
String
nftBuyPayTaskId
=
null
;
// 3.2.2调用购买NFT接口
//如果购买任务不为空,则直接进行购买任务查询
Nft043BuyReqDto
nft043BuyReqDto
=
Nft043BuyReqDto
.
getNew
();
if
(
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
nft043BuyReqDto
.
setNftId
(
nftId
);
nftBuyTaskId
=
nftOrderBo
.
getNftBuyTaskId
();
nft043BuyReqDto
.
setApplyScore
(
seriesNftInfoBo
.
getSellCount
().
intValue
());
try
{
nft043BuyReqDto
.
setReceiverPubKey
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPubKey
()));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
}
nft043BuyReqDto
.
setPointReceiverAddr
(
userInfoBo
.
getBlockChainAddress
());
nft043BuyReqDto
.
setOfferCount
(
seriesNftInfoBo
.
getSellCount
().
longValue
());
nft043BuyReqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
/**
if
(
StringUtil
.
isEmpty
(
nftBuyTaskId
)){
* 接收人的私钥签名,签名对象是(platformPubKey_receiverPubKey_pointReceiverAddr_applyScore_接口名_nftId_offerCount_operateId)
// 3.2.2调用购买NFT接口
* 接口名:buy_nft
Nft043BuyReqDto
nft043BuyReqDto
=
Nft043BuyReqDto
.
getNew
();
*/
nft043BuyReqDto
.
setNftId
(
nftId
);
String
signMetaData
=
zxlnftConfig
.
getNftPlatformPubKey
()
nft043BuyReqDto
.
setApplyScore
(
seriesNftInfoBo
.
getSellCount
().
intValue
());
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getReceiverPubKey
())
try
{
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getPointReceiverAddr
())
nft043BuyReqDto
.
setReceiverPubKey
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPubKey
()));
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getApplyScore
().
toString
())
}
catch
(
UnsupportedEncodingException
e
)
{
.
concat
(
"_"
).
concat
(
"buy_nft"
)
e
.
printStackTrace
();
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getNftId
())
}
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOfferCount
().
toString
())
nft043BuyReqDto
.
setPointReceiverAddr
(
userInfoBo
.
getBlockChainAddress
());
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOperateId
());
nft043BuyReqDto
.
setOfferCount
(
seriesNftInfoBo
.
getSellCount
().
longValue
());
String
signature
=
null
;
nft043BuyReqDto
.
setOperateId
(
IDGenerator
.
get32UUID
());
try
{
signature
=
zxlnftBiz
.
createSign
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPriKey
()),
signMetaData
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
nft043BuyReqDto
.
setSignature
(
signature
);
ZxlnftResponseDto
<
Nft043BuyRespDto
>
nft043RespDto
=
zxlnftSdkUtil
.
nft043Buy
(
nft043BuyReqDto
);
/**
if
(
nft043RespDto
.
isSuccess
()){
* 接收人的私钥签名,签名对象是(platformPubKey_receiverPubKey_pointReceiverAddr_applyScore_接口名_nftId_offerCount_operateId)
try
{
* 接口名:buy_nft
*/
String
signMetaData
=
zxlnftConfig
.
getNftPlatformPubKey
()
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getReceiverPubKey
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getPointReceiverAddr
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getApplyScore
().
toString
())
.
concat
(
"_"
).
concat
(
"buy_nft"
)
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getNftId
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOfferCount
().
toString
())
.
concat
(
"_"
).
concat
(
nft043BuyReqDto
.
getOperateId
());
String
signature
=
null
;
try
{
signature
=
zxlnftBiz
.
createSign
(
BASE64Util
.
decode
(
userInfoBo
.
getUserPriKey
()),
signMetaData
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
nft043BuyReqDto
.
setSignature
(
signature
);
ZxlnftResponseDto
<
Nft043BuyRespDto
>
nft043RespDto
=
zxlnftSdkUtil
.
nft043Buy
(
nft043BuyReqDto
);
if
(
nft043RespDto
.
isSuccess
()){
nftBuyTaskId
=
nft043RespDto
.
getData
().
getTaskId
();
nftBuyTaskId
=
nft043RespDto
.
getData
().
getTaskId
();
nftOrderBo
.
setNftBuyTaskId
(
nftBuyTaskId
);
nftOrderBo
.
setNftBuyTaskId
(
nftBuyTaskId
);
}
}
//如果购买任务id不为空
if
(
StringUtil
.
isNotEmpty
(
nftBuyTaskId
)){
try
{
//3.2.4查询NFT购买结果
//3.2.4查询NFT购买结果
Nft044BuyResultReqDto
nft044ReqDto
=
Nft044BuyResultReqDto
.
getNew
();
Nft044BuyResultReqDto
nft044ReqDto
=
Nft044BuyResultReqDto
.
getNew
();
nft044ReqDto
.
setTaskId
(
nftBuyTaskId
);
nft044ReqDto
.
setTaskId
(
nftBuyTaskId
);
...
@@ -445,11 +455,11 @@ public class ZxinTradeCommonBiz {
...
@@ -445,11 +455,11 @@ public class ZxinTradeCommonBiz {
nftOrderBo
.
setNftBuyTradeHash
(
nftBuyTradeHash
);
nftOrderBo
.
setNftBuyTradeHash
(
nftBuyTradeHash
);
nftOrderBo
.
setNftBuyPayTaskId
(
nftBuyPayTaskId
);
nftOrderBo
.
setNftBuyPayTaskId
(
nftBuyPayTaskId
);
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
//先更新nft
发行
数据
//先更新nft
购买
数据
dataUtils
.
updateNftOrderBuyInfo
(
routerType
,
nftOrderBo
.
getNftOrderPayId
(),
nftOrderBo
);
dataUtils
.
updateNftOrderBuyInfo
(
routerType
,
nftOrderBo
.
getNftOrderPayId
(),
nftOrderBo
);
}
else
{
}
else
{
//购买失败
//购买失败
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_ERROR
.
getCode
(),
"nft043Buy_resp:
"
+
nft043RespDto
.
getMessage
()
);
throw
new
GalaxyNftBuyException
(
GalaxyErrorEnum
.
NFT_BUY_ERROR
.
getCode
(),
"nft043Buy_resp:
nftBuyTaskId:"
+
nftBuyTaskId
);
}
}
GalaxyNftBuyRespDto
nftBuyRespDto
=
GalaxyNftBuyRespDto
.
getNew
();
GalaxyNftBuyRespDto
nftBuyRespDto
=
GalaxyNftBuyRespDto
.
getNew
();
nftBuyRespDto
.
setUserId
(
userInfoBo
.
getUserId
());
nftBuyRespDto
.
setUserId
(
userInfoBo
.
getUserId
());
...
...
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