记得上下班打卡 | 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
5345abd9
Commit
5345abd9
authored
Feb 17, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 库存回滚
parent
bb54a6bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
DMCheckGoblinOrderTimeImpl.java
...tform/service/impl/goblin/DMCheckGoblinOrderTimeImpl.java
+11
-4
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/goblin/DMCheckGoblinOrderTimeImpl.java
View file @
5345abd9
...
@@ -69,6 +69,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
...
@@ -69,6 +69,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
orderId
);
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
orderId
);
continue
;
continue
;
}
}
log
.
debug
(
"ORDERDATA = "
+
orderVo
);
LocalDateTime
expireTime
=
LocalDateTime
.
parse
(
orderVo
.
getCreatedAt
(),
DTF_YMD_HMS
).
plusMinutes
(
orderVo
.
getPayCountdownMinute
()
+
1
);
LocalDateTime
expireTime
=
LocalDateTime
.
parse
(
orderVo
.
getCreatedAt
(),
DTF_YMD_HMS
).
plusMinutes
(
orderVo
.
getPayCountdownMinute
()
+
1
);
if
(
now
.
isAfter
(
expireTime
)
&&
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
())
{
//过期
if
(
now
.
isAfter
(
expireTime
)
&&
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
())
{
//过期
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
...
@@ -76,14 +77,20 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
...
@@ -76,14 +77,20 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
LinkedList
<
Object
[]>
sqlDataSku
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlDataSku
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.order"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.order"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.sku"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.sku"
));
for
(
String
s
kuId
:
orderVo
.
getOrderSkuVoIds
())
{
for
(
String
orderS
kuId
:
orderVo
.
getOrderSkuVoIds
())
{
GoblinOrderSkuVo
skuVo
=
goblinRedisUtils
.
getGoblinOrderSkuVo
(
s
kuId
);
GoblinOrderSkuVo
skuVo
=
goblinRedisUtils
.
getGoblinOrderSkuVo
(
orderS
kuId
);
//订单详情
//订单详情
skuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
skuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
updateGoblinOrderSkuVo
(
skuVo
.
getOrderSkuId
(),
skuVo
);
updateGoblinOrderSkuVo
(
skuVo
.
getOrderSkuId
(),
skuVo
);
goblinRedisUtils
.
setGoblinOrderSku
(
skuVo
.
getOrderSkuId
(),
skuVo
);
goblinRedisUtils
.
setGoblinOrderSku
(
skuVo
.
getOrderSkuId
(),
skuVo
);
//库存&限购&&待支付订单
//库存&限购&&待支付订单
goblinRedisUtils
.
incrSkuStock
(
"pre"
,
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
skuVo
.
getSkuId
());
if
(
pre
==
null
)
{
goblinRedisUtils
.
incrSkuStock
(
pre
,
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
}
else
{
goblinRedisUtils
.
incrSkuStock
(
pre
,
skuVo
.
getSkuId
().
split
(
pre
)[
0
],
skuVo
.
getNum
());
}
goblinRedisUtils
.
decrSkuCountByUid
(
orderVo
.
getUserId
(),
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
goblinRedisUtils
.
decrSkuCountByUid
(
orderVo
.
getUserId
(),
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
//mysql
//mysql
sqlDataSku
.
add
(
new
Object
[]{
sqlDataSku
.
add
(
new
Object
[]{
...
@@ -102,7 +109,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
...
@@ -102,7 +109,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
//执行sql
//执行sql
queueUtils
.
sendMsgByGoblinRedis
(
MQConst
.
KylinQueue
.
SQL_ORDER_CLOSE
.
getKey
(),
queueUtils
.
sendMsgByGoblinRedis
(
MQConst
.
KylinQueue
.
SQL_ORDER_CLOSE
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
,
sqlDataSku
));
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
,
sqlDataSku
));
}
else
if
(
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
()||
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_2
.
getValue
())
{
}
else
if
(
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
()
||
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_2
.
getValue
())
{
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
orderVo
.
getOrderId
());
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
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