记得上下班打卡 | 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
ed9c2d28
Commit
ed9c2d28
authored
Mar 24, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现购买相关逻辑
parent
0481d33d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
GalaxyErrorEnum.java
...om/liquidnet/service/galaxy/constant/GalaxyErrorEnum.java
+2
-1
ZxinPublishBiz.java
...uidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
+11
-2
ZxinTradeBiz.java
...iquidnet/service/galaxy/router/zxin/biz/ZxinTradeBiz.java
+3
-0
DataUtils.java
...in/java/com/liquidnet/service/galaxy/utils/DataUtils.java
+15
-4
No files found.
liquidnet-bus-api/liquidnet-service-galaxy-api/src/main/java/com/liquidnet/service/galaxy/constant/GalaxyErrorEnum.java
View file @
ed9c2d28
...
...
@@ -20,7 +20,8 @@ public enum GalaxyErrorEnum {
SERIES_CLAIM_PROCESSING
(
"NFT0010008"
,
"系列声明正在处理中,不允许重复声明!"
),
SERIES_CLAIM_SUCCESSED
(
"NFT0010009"
,
"系列已声明成功,不允许重复声明!"
),
SERIES_CLAIM_NOT_EXIST
(
"NFT0010010"
,
"系列声明初始化信息不存在,请检查是否已上传对应素材!"
),
PUBLISH_ORDER_NOT_EXIST
(
"NFT0010011"
,
"NFT购买订单不存在!"
);
PUBLISH_ORDER_NOT_EXIST
(
"NFT0010011"
,
"NFT购买订单不存在!"
),
NFT_BUY_TASK_NOT_EXIST
(
"NFT0010012"
,
"NFT购买执行任务不存在"
);
private
String
code
;
private
String
message
;
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinPublishBiz.java
View file @
ed9c2d28
...
...
@@ -61,7 +61,7 @@ public class ZxinPublishBiz {
public
ResponseDto
<
GalaxyNftPublishRespDto
>
nftPublish
(
GalaxyNftPublishReqDto
reqDto
)
{
//获取订单信息
GalaxyNftOrderBo
nftOrderBo
=
dataUtils
.
getNftOrderBo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
());
if
(
StringUtil
.
isNotNull
(
nftOrderBo
)
&&
StringUtil
.
isNotEmpty
(
nftOrderBo
.
getNftId
())
){
if
(
StringUtil
.
isNotNull
(
nftOrderBo
)){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
PUBLISH_FAIL_ALREADY_EXIST
.
getCode
(),
GalaxyErrorEnum
.
PUBLISH_FAIL_ALREADY_EXIST
.
getMessage
());
}
...
...
@@ -168,11 +168,20 @@ public class ZxinPublishBiz {
if
(
nft035RespDtoTemp
.
isSuccess
()){
GalaxyNftPublishResultQueryRespDto
nftPublishResultQueryRespDto
=
GalaxyNftPublishResultQueryRespDto
.
getNew
();
BeanUtil
.
copy
(
nft035RespDtoTemp
.
getData
(),
nftPublishResultQueryRespDto
);
//设置时间
String
nowTimeStr
=
DateUtil
.
format
(
new
Date
(
nft035RespDtoTemp
.
getData
().
getChainTimestamp
().
longValue
()*
1000
),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
nftPublishResultQueryRespDto
.
setChainTimestamp
(
nowTimeStr
);
//转换任务状态
Integer
taskStatus
=
Integer
.
valueOf
(
GalaxyEnumBiz
.
getTaskStatusEnum
(
reqDto
.
getRouterType
(),
nft035RespDtoTemp
.
getData
().
getTaskStatus
().
toString
()).
getCode
());
nftPublishResultQueryRespDto
.
setTaskStatus
(
taskStatus
);
nftPublishResultQueryRespDto
.
setChainTimestamp
(
nowTimeStr
);
//更新缓存数据状态
nftOrderBo
.
setNftId
(
nft035RespDtoTemp
.
getData
().
getNftIdBegin
());
dataUtils
.
updateNftOrderInfo
(
reqDto
.
getRouterType
(),
reqDto
.
getNftOrderPayId
(),
nftOrderBo
);
return
ResponseDto
.
success
(
nftPublishResultQueryRespDto
);
}
else
{
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getCode
(),
GalaxyErrorEnum
.
PUBLISH_FAIL
.
getMessage
());
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/router/zxin/biz/ZxinTradeBiz.java
View file @
ed9c2d28
...
...
@@ -223,6 +223,9 @@ public class ZxinTradeBiz {
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
PUBLISH_ORDER_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
PUBLISH_ORDER_NOT_EXIST
.
getMessage
());
}
if
(
StringUtil
.
isEmpty
(
nftOrderBo
.
getNftBuyTaskId
())){
return
ResponseDto
.
failure
(
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getCode
(),
GalaxyErrorEnum
.
NFT_BUY_TASK_NOT_EXIST
.
getMessage
());
}
//3.2.4查询NFT购买结果
Nft044BuyResultReqDto
nft044ReqDto
=
Nft044BuyResultReqDto
.
getNew
();
nft044ReqDto
.
setTaskId
(
nftOrderBo
.
getNftBuyTaskId
());
...
...
liquidnet-bus-service/liquidnet-service-galaxy/liquidnet-service-galaxy-impl/src/main/java/com/liquidnet/service/galaxy/utils/DataUtils.java
View file @
ed9c2d28
...
...
@@ -94,21 +94,32 @@ public class DataUtils {
mongoTemplate
.
save
(
nftOrderVo
,
GalaxyNftOrderVo
.
class
.
getSimpleName
());
}
public
GalaxyNftOrderBo
getNftOrderBo
(
String
routeType
,
String
o
rderPayId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KET_GALAXY_TRADE
.
concat
(
routeType
).
concat
(
":"
)
+
o
rderPayId
);
public
GalaxyNftOrderBo
getNftOrderBo
(
String
routeType
,
String
nftO
rderPayId
)
{
Object
obj
=
redisUtil
.
get
(
GalaxyConstant
.
REDIS_KET_GALAXY_TRADE
.
concat
(
routeType
).
concat
(
":"
)
+
nftO
rderPayId
);
if
(
obj
!=
null
){
return
(
GalaxyNftOrderBo
)
obj
;
}
else
{
GalaxyNftOrderVo
nftOrderVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"nftOrderPayId"
).
is
(
o
rderPayId
)),
GalaxyNftOrderVo
.
class
,
GalaxyNftOrderVo
.
class
.
getSimpleName
());
GalaxyNftOrderVo
nftOrderVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"nftOrderPayId"
).
is
(
nftO
rderPayId
)),
GalaxyNftOrderVo
.
class
,
GalaxyNftOrderVo
.
class
.
getSimpleName
());
if
(
nftOrderVo
==
null
)
{
return
null
;
}
GalaxyNftOrderBo
nftOrderBo
=
GalaxyNftOrderBo
.
getNew
();
BeanUtil
.
copy
(
nftOrderVo
,
nftOrderBo
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KET_GALAXY_TRADE
.
concat
(
routeType
).
concat
(
":"
)
+
o
rderPayId
,
nftOrderBo
);
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KET_GALAXY_TRADE
.
concat
(
routeType
).
concat
(
":"
)
+
nftO
rderPayId
,
nftOrderBo
);
return
nftOrderBo
;
}
}
public
void
updateNftOrderInfo
(
String
routeType
,
String
nftOrderPayId
,
GalaxyNftOrderBo
nftOrderBo
)
{
redisUtil
.
set
(
GalaxyConstant
.
REDIS_KET_GALAXY_TRADE
.
concat
(
routeType
).
concat
(
":"
)
+
nftOrderPayId
,
nftOrderBo
,
keyExpireTime
);
Query
query
=
Query
.
query
(
Criteria
.
where
(
"nftOrderPayId"
).
is
(
nftOrderBo
.
getNftOrderPayId
()));
Update
update
=
Update
.
fromDocument
(
Document
.
parse
(
JsonUtils
.
toJson
(
nftOrderBo
)));
update
.
set
(
"nftId"
,
nftOrderBo
.
getNftId
());
String
nowTimeStr
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
LocalDateTime
.
now
());
update
.
set
(
"updatedAt"
,
nowTimeStr
);
UpdateResult
result
=
mongoTemplate
.
updateFirst
(
query
,
update
,
GalaxyNftOrderBo
.
class
,
GalaxyNftOrderBo
.
class
.
getSimpleName
());
log
.
info
(
"updateNftOrderInfo result:{}"
,
result
.
toString
());
}
}
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