记得上下班打卡 | 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
f8b13145
Commit
f8b13145
authored
Apr 15, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付回调超时支付也记录支付信息
parent
3fc0a7cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
43 deletions
+43
-43
GoblinNftOrderServiceImpl.java
...service/order/service/impl/GoblinNftOrderServiceImpl.java
+43
-43
No files found.
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinNftOrderServiceImpl.java
View file @
f8b13145
...
...
@@ -598,53 +598,56 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
if
(
Objects
.
equals
(
1
,
syncOrderParam
.
getStatus
()))
{
String
uid
=
orderVo
.
getUserId
();
Integer
orderStatusOld
=
orderVo
.
getStatus
();
LocalDateTime
now
=
LocalDateTime
.
now
();
if
(
Objects
.
equals
(
orderVo
.
getStatus
(),
GoblinStatusConst
.
NftStatus
.
ORDER_STATUS_3
.
getValue
()))
{
// 超时支付
log
.
info
(
"Nft订单超时支付 param:[orderCode:{}]"
,
orderCode
);
// 处理为退款中
orderVo
.
setStatus
(
GoblinStatusConst
.
NftStatus
.
ORDER_STATUS_4
.
getValue
());
orderVo
.
setUpdatedAt
(
now
);
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlDataOrder
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_nft_order.update.refund"
));
sqlDataOrder
.
add
(
new
Object
[]{
orderVo
.
getStatus
(),
now
,
orderId
,
now
,
now
});
nftOrderUtils
.
setNftOrder
(
orderVo
);
// mongo
goblinMongoUtils
.
updateGoblinNftOrderVo
(
orderVo
);
// mysql
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
));
// 退款
nftOrderUtils
.
refundOrderSku
(
orderId
,
syncOrderParam
.
getPaymentId
(),
syncOrderParam
.
getPaymentType
(),
orderVo
.
getPayType
());
}
else
{
// 正常流程
// 更新订单信息
if
(
StringUtil
.
isEmpty
(
syncOrderParam
.
getPaymentType
()))
{
orderVo
.
setPaymentType
(
""
);
}
else
{
orderVo
.
setPaymentType
(
syncOrderParam
.
getPaymentType
());
}
if
(
StringUtil
.
isEmpty
(
syncOrderParam
.
getPaymentId
()))
{
orderVo
.
setPaymentId
(
""
);
}
else
{
orderVo
.
setPaymentId
(
syncOrderParam
.
getPaymentId
());
}
if
(
StringUtil
.
isEmpty
(
syncOrderParam
.
getCode
()))
{
orderVo
.
setPayCode
(
""
);
}
else
{
orderVo
.
setPayCode
(
syncOrderParam
.
getCode
());
}
if
(
StringUtil
.
isEmpty
(
syncOrderParam
.
getPaymentAt
()))
{
orderVo
.
setPayTime
(
now
);
}
else
{
LocalDateTime
payTime
=
LocalDateTime
.
parse
(
syncOrderParam
.
getPaymentAt
(),
DTF_YMD_HMS
);
orderVo
.
setPayTime
(
payTime
);
}
orderVo
.
setUpdatedAt
(
now
);
if
(
Objects
.
equals
(
orderStatusOld
,
GoblinStatusConst
.
NftStatus
.
ORDER_STATUS_3
.
getValue
()))
{
// 超时支付 退款中状态
orderVo
.
setStatus
(
GoblinStatusConst
.
NftStatus
.
ORDER_STATUS_4
.
getValue
());
}
else
{
// 正常流程 已付款状态
orderVo
.
setStatus
(
GoblinStatusConst
.
NftStatus
.
ORDER_STATUS_2
.
getValue
());
orderVo
.
setUpdatedAt
(
now
);
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlDataOrder
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_nft_order.update.pay"
));
sqlDataOrder
.
add
(
new
Object
[]{
orderVo
.
getPaymentType
(),
orderVo
.
getPaymentId
(),
orderVo
.
getPayCode
(),
orderVo
.
getPayTime
(),
orderVo
.
getStatus
(),
orderVo
.
getUpdatedAt
(),
orderId
,
now
,
now
});
// redis
nftOrderUtils
.
setNftOrder
(
orderVo
);
// mongo
goblinMongoUtils
.
updateGoblinNftOrderVo
(
orderVo
);
// mysql
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
));
}
// redis
nftOrderUtils
.
setNftOrder
(
orderVo
);
// mongo
goblinMongoUtils
.
updateGoblinNftOrderVo
(
orderVo
);
// mysql
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlDataOrder
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_nft_order.update.pay"
));
sqlDataOrder
.
add
(
new
Object
[]{
orderVo
.
getPaymentType
(),
orderVo
.
getPaymentId
(),
orderVo
.
getPayCode
(),
orderVo
.
getPayTime
(),
orderVo
.
getStatus
(),
orderVo
.
getUpdatedAt
(),
orderId
,
now
,
now
});
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
));
// 处理订单退款和其他流程
if
(
Objects
.
equals
(
orderStatusOld
,
GoblinStatusConst
.
NftStatus
.
ORDER_STATUS_3
.
getValue
()))
{
// 超时支付 退款
log
.
info
(
"Nft订单超时支付 param:[orderCode:{}]"
,
orderCode
);
nftOrderUtils
.
refundOrderSku
(
orderId
,
syncOrderParam
.
getPaymentId
(),
syncOrderParam
.
getPaymentType
(),
orderVo
.
getPayType
());
}
else
{
// 正常流程
// 通知生成藏品
// GoblinQueueBizArtworkGenDto artworkGenDto = GoblinQueueBizArtworkGenDto.getNew();
// artworkGenDto.setOrderId(orderId);
...
...
@@ -653,13 +656,10 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
// artworkGenDto.setSource(1);
// queueUtils.sendMsgByRedis(MQConst.GoblinQueue.BIZ_ARTWORK_GEN.getKey(), artworkGenDto.toJson());
this
.
generateUserArtwork
(
orderVo
);
// 增加销量
goblinRedisUtils
.
incrSkuSaleCount
(
orderVo
.
getSpuId
(),
orderVo
.
getSkuId
(),
orderVo
.
getNum
());
// 加积分
goblinOrderUtils
.
doTask
(
uid
,
orderVo
.
getPriceActual
());
}
// 写入用户订单列表 因取消的订单不展示 所以放在这里
nftOrderUtils
.
addNftOrderList
(
uid
,
orderVo
.
getOrderId
());
...
...
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