记得上下班打卡 | 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
41cf4fdd
Commit
41cf4fdd
authored
May 18, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 分批购 获取当前时间段 和 下一个时间段的bug
parent
50dd4151
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+4
-1
GoblinRedisUtils.java
...a/com/liquidnet/service/order/utils/GoblinRedisUtils.java
+1
-1
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
41cf4fdd
...
...
@@ -809,6 +809,7 @@ public class GoblinRedisUtils {
* @return
*/
public
HashMap
<
String
,
Object
>
getGoodsSkuInfoVo
(
LocalDateTime
now
,
String
skuId
)
{
now
=
LocalDateTime
.
of
(
2022
,
5
,
18
,
16
,
17
,
0
);
GoblinGoodsSkuInfoVo
vo
=
getGoodsSkuInfoVo
(
skuId
);
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
if
(
now
.
isAfter
(
vo
.
getSaleStartTime
()))
{
//普通商品已开售
...
...
@@ -931,6 +932,7 @@ public class GoblinRedisUtils {
if
(
vo
==
null
&&
type
==
0
)
{
//已开售逻辑
for
(
GoblinListCollectVo
collectVoItem
:
collectVos
)
{
int
lastStock
=
getSkuStock
(
collectVoItem
.
getListId
(),
skuId
);
log
.
debug
(
"stock = "
+
lastStock
);
int
restStock
=
decrSkuStock
(
collectVoItem
.
getListId
(),
skuId
,
lastStock
);
if
(
restStock
<
0
)
{
incrSkuStock
(
collectVoItem
.
getListId
(),
skuId
,
lastStock
);
...
...
@@ -939,7 +941,7 @@ public class GoblinRedisUtils {
}
}
}
else
if
(
vo
!=
null
&&
type
==
1
)
{
LocalDateTime
st
=
vo
.
getTimeStart
()
.
minusSeconds
(
1
)
;
LocalDateTime
st
=
vo
.
getTimeStart
();
// GoblinListCollectVo collectVo = null;
// GoblinListCollectVo collectTemp = null;
//获取上个分配购的vo
...
...
@@ -975,6 +977,7 @@ public class GoblinRedisUtils {
for
(
GoblinListCollectVo
itemVo
:
collectVosList
)
{
//减少上个时间段sku库存
int
lastStock
=
getSkuStock
(
itemVo
.
getListId
(),
skuId
);
log
.
debug
(
"stock = "
+
lastStock
);
int
restStock
=
decrSkuStock
(
itemVo
.
getListId
(),
skuId
,
lastStock
);
if
(
restStock
<
0
)
{
//库存超过销售量 操作失败回滚库存
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinRedisUtils.java
View file @
41cf4fdd
...
...
@@ -298,7 +298,7 @@ public class GoblinRedisUtils {
}
}
}
else
if
(
vo
!=
null
&&
type
==
1
)
{
LocalDateTime
st
=
vo
.
getTimeStart
()
.
minusSeconds
(
1
)
;
LocalDateTime
st
=
vo
.
getTimeStart
();
// GoblinListCollectVo collectVo = null;
// GoblinListCollectVo collectTemp = null;
//获取上个分配购的vo
...
...
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