记得上下班打卡 | 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
2663736c
Commit
2663736c
authored
Mar 09, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
压测提交
parent
c4cf8435
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
33 deletions
+37
-33
AbstractOrderCloseReceiver.java
...e/consumer/kylin/receiver/AbstractOrderCloseReceiver.java
+37
-33
No files found.
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/receiver/AbstractOrderCloseReceiver.java
View file @
2663736c
...
@@ -94,44 +94,48 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
...
@@ -94,44 +94,48 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
public
boolean
checkOrderTime
(
String
valueData
,
String
type
)
{
public
boolean
checkOrderTime
(
String
valueData
,
String
type
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
if
(
type
.
equals
(
"GOBLIN"
))
{
try
{
String
[]
orderIds
=
getMasterCode
(
valueData
);
if
(
type
.
equals
(
"GOBLIN"
))
{
for
(
String
orderId
:
orderIds
)
{
String
[]
orderIds
=
getMasterCode
(
valueData
);
GoblinStoreOrderVo
orderVo
=
getGoblinOrder
(
orderId
);
for
(
String
orderId
:
orderIds
)
{
if
(
orderVo
.
getStatus
().
equals
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
()))
{
//订单回滚
GoblinStoreOrderVo
orderVo
=
getGoblinOrder
(
orderId
);
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
if
(
orderVo
.
getStatus
().
equals
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
()))
{
//订单回滚
LinkedList
<
Object
[]>
sqlDataOrder
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlDataSku
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlDataOrder
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.order"
));
LinkedList
<
Object
[]>
sqlDataSku
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.sku"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.order"
));
for
(
String
orderSkuId
:
orderVo
.
getOrderSkuVoIds
())
{
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.sku"
));
GoblinOrderSkuVo
skuVo
=
getGoblinOrderSkuVo
(
orderSkuId
);
for
(
String
orderSkuId
:
orderVo
.
getOrderSkuVoIds
())
{
//订单详情
GoblinOrderSkuVo
skuVo
=
getGoblinOrderSkuVo
(
orderSkuId
);
skuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
//订单详情
updateGoblinOrderSkuVo
(
skuVo
.
getOrderSkuId
(),
skuVo
);
skuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
setGoblinOrderSku
(
skuVo
.
getOrderSkuId
(),
skuVo
);
updateGoblinOrderSkuVo
(
skuVo
.
getOrderSkuId
(),
skuVo
);
//库存&限购&&待支付订单
setGoblinOrderSku
(
skuVo
.
getOrderSkuId
(),
skuVo
);
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
skuVo
.
getSkuId
());
//库存&限购&&待支付订单
incrSkuStock
(
pre
,
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
skuVo
.
getSkuId
());
decrSkuCountByUid
(
orderVo
.
getUserId
(),
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
incrSkuStock
(
pre
,
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
decrSkuCountByUid
(
orderVo
.
getUserId
(),
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
//mysql
sqlDataSku
.
add
(
new
Object
[]{
skuVo
.
getStatus
(),
now
,
orderVo
.
getOrderId
(),
now
,
now
});
}
//订单
orderVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
updateGoblinStoreOrderVo
(
orderVo
.
getOrderId
(),
orderVo
);
setGoblinOrder
(
orderVo
.
getOrderId
(),
orderVo
);
//mysql
//mysql
sqlData
Sku
.
add
(
new
Object
[]{
sqlData
Order
.
add
(
new
Object
[]{
skuVo
.
getStatus
(),
now
,
orderVo
.
getOrderId
(),
now
,
now
orderVo
.
getStatus
(),
now
,
now
,
"超时关闭"
,
orderVo
.
getOrderId
(),
now
,
now
});
});
//执行sql
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_ORDER_CLOSE
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
,
sqlDataSku
));
}
}
//订单
orderVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
updateGoblinStoreOrderVo
(
orderVo
.
getOrderId
(),
orderVo
);
setGoblinOrder
(
orderVo
.
getOrderId
(),
orderVo
);
//mysql
sqlDataOrder
.
add
(
new
Object
[]{
orderVo
.
getStatus
(),
now
,
now
,
"超时关闭"
,
orderVo
.
getOrderId
(),
now
,
now
});
//执行sql
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_ORDER_CLOSE
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
,
sqlDataSku
));
}
}
}
}
}
catch
(
Exception
e
){
log
.
error
(
"库存回滚异常valueData={}"
,
valueData
,
e
);
}
}
return
true
;
return
true
;
}
}
...
...
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