记得上下班打卡 | 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
f0f5e1f9
Commit
f0f5e1f9
authored
Jul 15, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改百度链购买入库逻辑
parent
d223438c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
30 deletions
+33
-30
XuperTradeCommonBiz.java
.../service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
+30
-27
ZxinUserCommonBiz.java
...net/service/galaxy/router/zxin/biz/ZxinUserCommonBiz.java
+3
-3
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
View file @
f0f5e1f9
...
@@ -5,7 +5,6 @@ import com.liquidnet.common.third.xuper.config.XuperConfig;
...
@@ -5,7 +5,6 @@ import com.liquidnet.common.third.xuper.config.XuperConfig;
import
com.liquidnet.common.third.xuper.dto.*
;
import
com.liquidnet.common.third.xuper.dto.*
;
import
com.liquidnet.common.third.xuper.exception.XupterException
;
import
com.liquidnet.common.third.xuper.exception.XupterException
;
import
com.liquidnet.common.third.xuper.util.XuperSdkUtil
;
import
com.liquidnet.common.third.xuper.util.XuperSdkUtil
;
import
com.liquidnet.common.third.zxlnft.dto.Nft035PublishResultReqDto
;
import
com.liquidnet.common.third.zxlnft.dto.Nft044BuyResultReqDto
;
import
com.liquidnet.common.third.zxlnft.dto.Nft044BuyResultReqDto
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
...
@@ -124,6 +123,8 @@ public class XuperTradeCommonBiz {
...
@@ -124,6 +123,8 @@ public class XuperTradeCommonBiz {
//定义失败信息
//定义失败信息
String
failDesc
=
null
;
String
failDesc
=
null
;
//是否发行成功
boolean
isPublishSuccess
=
false
;
try
{
try
{
/**
/**
...
@@ -150,16 +151,21 @@ public class XuperTradeCommonBiz {
...
@@ -150,16 +151,21 @@ public class XuperTradeCommonBiz {
}
}
seriesBeginIndex
=
nftOrderBindBo
.
getNftIdIndex
();
seriesBeginIndex
=
nftOrderBindBo
.
getNftIdIndex
();
//设置nftId
nftId
=
seriesId
.
concat
(
"_"
).
concat
(
seriesBeginIndex
.
toString
());
//设置购买标志
nftOrderBo
.
setNftId
(
nftId
);
/**
/**
* 如果已经发行成功
* 如果已经发行成功
*/
*/
if
(
seriesNftInfoBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
())){
if
(
seriesNftInfoBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
())){
nftId
=
seriesId
.
concat
(
"_"
).
concat
(
seriesBeginIndex
.
toString
());;
publishTaskId
=
seriesNftInfoBo
.
getSeriesId
();
//跳过发行查询
nftPublishChainTimestamp
=
DateUtil
.
getNowSeconds
();
nftPublishChainTimestamp
=
DateUtil
.
getNowSeconds
();
nftPublishStatus
=
Integer
.
parseInt
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
());
nftPublishStatus
=
Integer
.
parseInt
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
());
nftPublishTradeHash
=
publishTaskId
;
nftPublishTradeHash
=
seriesNftInfoBo
.
getNftPublishTradeHash
()
;
//
设置购买标志
//
发行成功
nftOrderBo
.
setNftId
(
nftId
)
;
isPublishSuccess
=
true
;
}
else
if
(
seriesNftInfoBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
AssetPublishStatusEnum
.
PROCESSING
.
getCode
())){
}
else
if
(
seriesNftInfoBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
AssetPublishStatusEnum
.
PROCESSING
.
getCode
())){
if
(
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftPublishTaskId
())){
if
(
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftPublishTaskId
())){
publishTaskId
=
nftOrderBo
.
getNftPublishTaskId
();
publishTaskId
=
nftOrderBo
.
getNftPublishTaskId
();
...
@@ -190,18 +196,15 @@ public class XuperTradeCommonBiz {
...
@@ -190,18 +196,15 @@ public class XuperTradeCommonBiz {
}
}
}
}
if
(
StringUtil
.
isNotEmpty
(
publishTaskId
)){
//发行结果查询
if
(!
isPublishSuccess
){
try
{
try
{
//3.1.4查询 NFT发行结果
Nft035PublishResultReqDto
nft035ReqDto
=
Nft035PublishResultReqDto
.
getNew
();
nft035ReqDto
.
setTaskId
(
publishTaskId
);
int
count
=
0
;
int
count
=
0
;
long
timeStart
=
System
.
currentTimeMillis
();
long
timeStart
=
System
.
currentTimeMillis
();
while
(
StringUtil
.
isEmpty
(
nftId
)
)
{
while
(
!
isPublishSuccess
)
{
Thread
.
sleep
(
500
l
);
Thread
.
sleep
(
500
l
);
count
++;
count
++;
log
.
info
(
"=======执行nft发行第{}次查询,taskId:{}"
,
count
,
nft035ReqDto
.
getTaskId
()
);
log
.
info
(
"=======执行nft发行第{}次查询,taskId:{}"
,
count
,
publishTaskId
);
//执行nft发行结果查询
//执行nft发行结果查询
GalaxyNftPublishResultQueryReqDto
nftPublishResultQueryReqDto
=
GalaxyNftPublishResultQueryReqDto
.
getNew
();
GalaxyNftPublishResultQueryReqDto
nftPublishResultQueryReqDto
=
GalaxyNftPublishResultQueryReqDto
.
getNew
();
nftPublishResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftPublishResultQueryReqDto
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
...
@@ -210,7 +213,6 @@ public class XuperTradeCommonBiz {
...
@@ -210,7 +213,6 @@ public class XuperTradeCommonBiz {
if
(
publishResultQueryRespDto
.
isSuccess
()){
if
(
publishResultQueryRespDto
.
isSuccess
()){
GalaxyNftPublishResultQueryRespDto
nftPublishResultQueryRespDto
=
publishResultQueryRespDto
.
getData
();
GalaxyNftPublishResultQueryRespDto
nftPublishResultQueryRespDto
=
publishResultQueryRespDto
.
getData
();
if
(
nftPublishResultQueryRespDto
.
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
()))
{
if
(
nftPublishResultQueryRespDto
.
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
()))
{
nftId
=
seriesId
.
concat
(
"_"
).
concat
(
seriesBeginIndex
.
toString
());;
nftPublishChainTimestamp
=
DateUtil
.
getNowSeconds
();
nftPublishChainTimestamp
=
DateUtil
.
getNowSeconds
();
nftPublishStatus
=
Integer
.
parseInt
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
());
nftPublishStatus
=
Integer
.
parseInt
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
());
nftPublishTradeHash
=
nftPublishResultQueryRespDto
.
getTxHash
();
nftPublishTradeHash
=
nftPublishResultQueryRespDto
.
getTxHash
();
...
@@ -220,17 +222,19 @@ public class XuperTradeCommonBiz {
...
@@ -220,17 +222,19 @@ public class XuperTradeCommonBiz {
seriesNftInfoBo
.
setNftPublishTradeHash
(
nftPublishTradeHash
);
seriesNftInfoBo
.
setNftPublishTradeHash
(
nftPublishTradeHash
);
seriesNftInfoBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
seriesNftInfoBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
dataUtils
.
updateSeriesNftPublishStatus
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
(),
seriesNftInfoBo
);
dataUtils
.
updateSeriesNftPublishStatus
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
(),
seriesNftInfoBo
);
isPublishSuccess
=
true
;
}
else
if
(
nftPublishResultQueryRespDto
.
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
AssetPublishStatusEnum
.
FAIL
.
getCode
()))
{
}
else
if
(
nftPublishResultQueryRespDto
.
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
AssetPublishStatusEnum
.
FAIL
.
getCode
()))
{
log
.
info
(
"任务执行失败!taskId:{}"
,
nft035ReqDto
.
getTaskId
()
);
log
.
info
(
"任务执行失败!taskId:{}"
,
publishTaskId
);
nftPublishStatus
=
nftPublishResultQueryRespDto
.
getTaskStatus
();
nftPublishStatus
=
nftPublishResultQueryRespDto
.
getTaskStatus
();
//发行失败
//发行失败
seriesNftInfoBo
.
setNftPublishStatus
(
GalaxyEnum
.
AssetPublishStatusEnum
.
FAIL
.
getCode
());
seriesNftInfoBo
.
setNftPublishStatus
(
GalaxyEnum
.
AssetPublishStatusEnum
.
FAIL
.
getCode
());
seriesNftInfoBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
seriesNftInfoBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
dataUtils
.
updateSeriesNftPublishStatus
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
(),
seriesNftInfoBo
);
dataUtils
.
updateSeriesNftPublishStatus
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
(),
seriesNftInfoBo
);
//直接进行异常处理
//直接进行异常处理
throw
new
GalaxyNftPublishException
(
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getCode
(),
"
nft035PublishResul
t_resp:"
+
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getMessage
());
throw
new
GalaxyNftPublishException
(
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getCode
(),
"
xuper004PublishAsse
t_resp:"
+
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getMessage
());
}
else
if
(
nftPublishResultQueryRespDto
.
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
AssetPublishStatusEnum
.
PROCESSING
.
getCode
())){
}
else
if
(
nftPublishResultQueryRespDto
.
getTaskStatus
().
toString
().
equals
(
GalaxyEnum
.
AssetPublishStatusEnum
.
PROCESSING
.
getCode
())){
log
.
info
(
"任务执行中!taskId:{}"
,
nft035ReqDto
.
getTaskId
()
);
log
.
info
(
"任务执行中!taskId:{}"
,
publishTaskId
);
nftPublishStatus
=
nftPublishResultQueryRespDto
.
getTaskStatus
();
nftPublishStatus
=
nftPublishResultQueryRespDto
.
getTaskStatus
();
//发行中
//发行中
...
@@ -241,13 +245,10 @@ public class XuperTradeCommonBiz {
...
@@ -241,13 +245,10 @@ public class XuperTradeCommonBiz {
}
}
if
(
count
==
20
)
{
if
(
count
==
20
)
{
log
.
info
(
"=======查询共20次,跳出循环!taskId:{}"
,
nft035ReqDto
.
getTaskId
()
);
log
.
info
(
"=======查询共20次,跳出循环!taskId:{}"
,
publishTaskId
);
break
;
break
;
}
}
}
}
//赋值返回参数
nftOrderBo
.
setNftId
(
nftId
);
log
.
info
(
"发行NFT后返回给前端nftID:{}"
,
nftId
);
log
.
info
(
"发行NFT后返回给前端nftID:{}"
,
nftId
);
log
.
info
(
"总共执行了{}次查询 总耗时:{} MS"
,
count
,
(
System
.
currentTimeMillis
()
-
timeStart
));
log
.
info
(
"总共执行了{}次查询 总耗时:{} MS"
,
count
,
(
System
.
currentTimeMillis
()
-
timeStart
));
}
catch
(
GalaxyNftPublishException
e
){
}
catch
(
GalaxyNftPublishException
e
){
...
@@ -255,12 +256,12 @@ public class XuperTradeCommonBiz {
...
@@ -255,12 +256,12 @@ public class XuperTradeCommonBiz {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
//发行失败
//发行失败
throw
new
GalaxyNftPublishException
(
GalaxyErrorEnum
.
NFT_PUBLISH_ERROR
.
getCode
(),
"
nft035PublishResul
t_exception:"
+
e
.
getMessage
());
throw
new
GalaxyNftPublishException
(
GalaxyErrorEnum
.
NFT_PUBLISH_ERROR
.
getCode
(),
"
xuper004PublishAsse
t_exception:"
+
e
.
getMessage
());
}
}
}
else
{
}
else
{
if
(!
seriesNftInfoBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
())){
if
(!
seriesNftInfoBo
.
getNftPublishStatus
().
equalsIgnoreCase
(
GalaxyEnum
.
AssetPublishStatusEnum
.
SUCCESS
.
getCode
())){
//发行失败
//发行失败
throw
new
GalaxyNftPublishException
(
GalaxyErrorEnum
.
NFT_PUBLISH_ERROR
.
getCode
(),
"
nft034Publish
_resp:taskId : "
+
publishTaskId
);
throw
new
GalaxyNftPublishException
(
GalaxyErrorEnum
.
NFT_PUBLISH_ERROR
.
getCode
(),
"
xuper004PublishAsset
_resp:taskId : "
+
publishTaskId
);
}
}
}
}
}
catch
(
GalaxyNftPublishException
e
)
{
}
catch
(
GalaxyNftPublishException
e
)
{
...
@@ -293,7 +294,7 @@ public class XuperTradeCommonBiz {
...
@@ -293,7 +294,7 @@ public class XuperTradeCommonBiz {
}
}
//更新订单缓存数据状态
//更新订单缓存数据状态
if
(
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftId
())
){
if
(
isPublishSuccess
){
if
(
StringUtil
.
isNotNull
(
nftPublishChainTimestamp
)){
if
(
StringUtil
.
isNotNull
(
nftPublishChainTimestamp
)){
//设置时间
//设置时间
String
nftPublishChainTimestampStr
=
DateUtil
.
format
(
new
Date
(
nftPublishChainTimestamp
*
1000
),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
String
nftPublishChainTimestampStr
=
DateUtil
.
format
(
new
Date
(
nftPublishChainTimestamp
*
1000
),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
...
@@ -307,10 +308,8 @@ public class XuperTradeCommonBiz {
...
@@ -307,10 +308,8 @@ public class XuperTradeCommonBiz {
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
nftOrderBo
.
setUpdatedAt
(
LocalDateTime
.
now
());
//先更新nft发行数据
//先更新nft发行数据
dataUtils
.
updateNftOrderPublishInfo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
dataUtils
.
updateNftOrderPublishInfo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
}
//第二步:执行购买逻辑
//第二步:执行购买逻辑
if
(
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftId
())){
GalaxyNftPublishAndBuyRespDto
nftPublishAndBuyRespDto
=
this
.
executeBuyBusiness
(
reqDto
,
userInfoBo
,
seriesNftInfoBo
,
nftOrderBo
);
GalaxyNftPublishAndBuyRespDto
nftPublishAndBuyRespDto
=
this
.
executeBuyBusiness
(
reqDto
,
userInfoBo
,
seriesNftInfoBo
,
nftOrderBo
);
if
(
StringUtil
.
isNotNull
(
nftPublishAndBuyRespDto
)&&
StringUtil
.
isNotEmpty
(
nftPublishAndBuyRespDto
.
getNftId
())){
if
(
StringUtil
.
isNotNull
(
nftPublishAndBuyRespDto
)&&
StringUtil
.
isNotEmpty
(
nftPublishAndBuyRespDto
.
getNftId
())){
return
ResponseDto
.
success
(
nftPublishAndBuyRespDto
);
return
ResponseDto
.
success
(
nftPublishAndBuyRespDto
);
...
@@ -499,7 +498,11 @@ public class XuperTradeCommonBiz {
...
@@ -499,7 +498,11 @@ public class XuperTradeCommonBiz {
Xuper010QuerySdsReqDto
xuper010QuerySdsReqDto
=
Xuper010QuerySdsReqDto
.
getNew
();
Xuper010QuerySdsReqDto
xuper010QuerySdsReqDto
=
Xuper010QuerySdsReqDto
.
getNew
();
// 定义返回结果对象
// 定义返回结果对象
Xuper010QuerySdsRespDto
xuper010QuerySdsRespDto
=
null
;
Xuper010QuerySdsRespDto
xuper010QuerySdsRespDto
=
null
;
long
shardId
=
1
l
;
long
shardId
=
-
1
l
;
GalaxyNftOrderBindBo
nftOrderBindBo
=
dataUtils
.
getGalaxyNftOrderBindBo
(
reqDto
.
getRouterType
(),
nftOrderBo
.
getNftOrderPayId
());
if
(
StringUtil
.
isNotNull
(
nftOrderBindBo
)){
shardId
=
nftOrderBindBo
.
getNftIdIndex
().
longValue
();
}
try
{
try
{
xuper010QuerySdsReqDto
.
setAssetId
(
Long
.
parseLong
(
nftOrderBo
.
getSeriesId
()));
xuper010QuerySdsReqDto
.
setAssetId
(
Long
.
parseLong
(
nftOrderBo
.
getSeriesId
()));
xuper010QuerySdsReqDto
.
setShardId
(
shardId
);
xuper010QuerySdsReqDto
.
setShardId
(
shardId
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinUserCommonBiz.java
View file @
f0f5e1f9
...
@@ -360,9 +360,6 @@ public class ZxinUserCommonBiz {
...
@@ -360,9 +360,6 @@ public class ZxinUserCommonBiz {
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO
.
concat
(
reqDto
.
getUserId
())
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO
.
concat
(
reqDto
.
getUserId
())
,
goblinUserNftAccInfoVo
);
,
goblinUserNftAccInfoVo
);
//同步用户信息到adam 格式:{uid},{mobile},{证件类型}{证件号},{姓名}
syncUserAccountInfoToAdam
(
reqDto
);
//同步业务账号关联关系到adam
//同步业务账号关联关系到adam
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
sqlsDataA
.
add
(
new
Object
[]{
sqlsDataA
.
add
(
new
Object
[]{
...
@@ -378,6 +375,9 @@ public class ZxinUserCommonBiz {
...
@@ -378,6 +375,9 @@ public class ZxinUserCommonBiz {
//开户成功记录缓存 {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
//开户成功记录缓存 {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA
.
concat
(
reqDto
.
getIdCardType
().
concat
(
reqDto
.
getIdCard
()))
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_CERTMETA
.
concat
(
reqDto
.
getIdCardType
().
concat
(
reqDto
.
getIdCard
()))
,
reqDto
.
getUserName
().
concat
(
","
).
concat
(
reqDto
.
getMobile
()),
openAccSuccessKeyExpireTime
);
,
reqDto
.
getUserName
().
concat
(
","
).
concat
(
reqDto
.
getMobile
()),
openAccSuccessKeyExpireTime
);
//同步用户信息到adam 格式:{uid},{mobile},{证件类型}{证件号},{姓名}
syncUserAccountInfoToAdam
(
reqDto
);
}
else
{
}
else
{
//更新开户状态
//更新开户状态
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO
.
concat
(
reqDto
.
getUserId
())
dataUtils
.
getRedisUtil
().
set
(
GoblinRedisConst
.
REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO
.
concat
(
reqDto
.
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