记得上下班打卡 | 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
aaea548e
Commit
aaea548e
authored
May 23, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
order 删除所有库存回滚逻辑
goblin 删除主动触发库存回滚逻辑
parent
83b5501e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
82 deletions
+0
-82
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+0
-11
GoblinRedisUtils.java
...a/com/liquidnet/service/order/utils/GoblinRedisUtils.java
+0
-71
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 @
aaea548e
...
@@ -811,7 +811,6 @@ public class GoblinRedisUtils {
...
@@ -811,7 +811,6 @@ public class GoblinRedisUtils {
GoblinGoodsSkuInfoVo
vo
=
getGoodsSkuInfoVo
(
skuId
);
GoblinGoodsSkuInfoVo
vo
=
getGoodsSkuInfoVo
(
skuId
);
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
if
(
null
==
vo
.
getSaleStartTime
()
||
now
.
isAfter
(
vo
.
getSaleStartTime
()))
{
//普通商品已开售
if
(
null
==
vo
.
getSaleStartTime
()
||
now
.
isAfter
(
vo
.
getSaleStartTime
()))
{
//普通商品已开售
lastStockToLastStock
(
0
,
getGoblinListCollect
(
skuId
),
null
,
skuId
);
map
.
put
(
"vo"
,
vo
);
map
.
put
(
"vo"
,
vo
);
map
.
put
(
"tagType"
,
null
);
map
.
put
(
"tagType"
,
null
);
map
.
put
(
"listId"
,
null
);
map
.
put
(
"listId"
,
null
);
...
@@ -869,16 +868,6 @@ public class GoblinRedisUtils {
...
@@ -869,16 +868,6 @@ public class GoblinRedisUtils {
if
(
collectVo
==
null
)
{
if
(
collectVo
==
null
)
{
collectVo
=
collectTemp
;
collectVo
=
collectTemp
;
}
}
if
(
collectVo
==
null
)
{
GoblinListCollectVo
collectNext
=
getCollectByNowNext
(
now
,
skuId
);
if
(
collectNext
==
null
)
{
lastStockToLastStock
(
0
,
collectVos
,
null
,
skuId
);
}
else
{
lastStockToLastStock
(
1
,
collectVos
,
collectNext
,
skuId
);
}
}
else
{
lastStockToLastStock
(
1
,
collectVos
,
collectVo
,
skuId
);
}
return
collectVo
;
return
collectVo
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinRedisUtils.java
View file @
aaea548e
...
@@ -180,7 +180,6 @@ public class GoblinRedisUtils {
...
@@ -180,7 +180,6 @@ public class GoblinRedisUtils {
GoblinGoodsSkuInfoVo
vo
=
getGoodsSkuInfoVo
(
skuId
);
GoblinGoodsSkuInfoVo
vo
=
getGoodsSkuInfoVo
(
skuId
);
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
if
(
now
.
isAfter
(
vo
.
getSaleStartTime
()))
{
//普通商品已开售
if
(
now
.
isAfter
(
vo
.
getSaleStartTime
()))
{
//普通商品已开售
lastStockToLastStock
(
0
,
getGoblinListCollect
(
skuId
),
null
,
skuId
);
map
.
put
(
"vo"
,
vo
);
map
.
put
(
"vo"
,
vo
);
map
.
put
(
"tagType"
,
null
);
map
.
put
(
"tagType"
,
null
);
map
.
put
(
"listId"
,
null
);
map
.
put
(
"listId"
,
null
);
...
@@ -239,7 +238,6 @@ public class GoblinRedisUtils {
...
@@ -239,7 +238,6 @@ public class GoblinRedisUtils {
if
(
collectVo
==
null
)
{
if
(
collectVo
==
null
)
{
collectVo
=
collectTemp
;
collectVo
=
collectTemp
;
}
}
lastStockToLastStock
(
1
,
collectVos
,
collectVo
,
skuId
);
return
collectVo
;
return
collectVo
;
}
}
...
@@ -279,75 +277,6 @@ public class GoblinRedisUtils {
...
@@ -279,75 +277,6 @@ public class GoblinRedisUtils {
return
collectVo
;
return
collectVo
;
}
}
/**
* 处理上个时间段的库存
*
* @param type 类型[0-开售|1-未开售]
* @param collectVos
* @param vo
* @param skuId
*/
public
void
lastStockToLastStock
(
Integer
type
,
List
<
GoblinListCollectVo
>
collectVos
,
GoblinListCollectVo
vo
,
String
skuId
)
{
if
(
vo
==
null
&&
type
==
0
)
{
//已开售逻辑
for
(
GoblinListCollectVo
collectVoItem
:
collectVos
)
{
int
lastStock
=
getSkuStock
(
collectVoItem
.
getListId
(),
skuId
);
int
restStock
=
decrSkuStock
(
collectVoItem
.
getListId
(),
skuId
,
lastStock
);
if
(
restStock
<
0
)
{
incrSkuStock
(
collectVoItem
.
getListId
(),
skuId
,
lastStock
);
}
else
{
incrSkuStock
(
null
,
skuId
,
lastStock
);
}
}
}
else
if
(
vo
!=
null
&&
type
==
1
)
{
LocalDateTime
st
=
vo
.
getTimeStart
();
// GoblinListCollectVo collectVo = null;
// GoblinListCollectVo collectTemp = null;
//获取上个分配购的vo
List
<
GoblinListCollectVo
>
collectVosList
=
ObjectUtil
.
getGoblinListCollectVo
();
for
(
GoblinListCollectVo
collectVoItem
:
collectVos
)
{
if
(
st
.
isAfter
(
collectVoItem
.
getTimeStart
())
&&
collectVoItem
.
getTimeEnd
()
==
null
)
{
// collectTemp = collectVoItem;
collectVosList
.
add
(
collectVoItem
);
}
else
if
(
collectVoItem
.
getTimeEnd
()
!=
null
&&
st
.
isAfter
(
collectVoItem
.
getTimeEnd
()))
{
// collectVo = collectVoItem;
collectVosList
.
add
(
collectVoItem
);
}
else
if
(
st
.
isAfter
(
collectVoItem
.
getTimeStart
())
&&
st
.
isBefore
(
collectVoItem
.
getTimeEnd
()))
{
// collectVo = collectVoItem;
collectVosList
.
add
(
collectVoItem
);
break
;
}
}
// if (collectVo == null) {
// collectVo = collectTemp;
// }
// if (collectVo != null) {
// //减少上个时间段sku库存
// int lastStock = getSkuStock(collectVo.getListId(), skuId);
// int restStock = decrSkuStock(collectVo.getListId(), skuId, lastStock);
// if (restStock < 0) {
// //库存超过销售量 操作失败回滚库存
// incrSkuStock(collectVo.getListId(), skuId, lastStock);
// } else {
// //上个时间段的库存增加到当前时间段
// incrSkuStock(vo.getListId(), skuId, lastStock);
// }
// }
for
(
GoblinListCollectVo
itemVo
:
collectVosList
){
//减少上个时间段sku库存
int
lastStock
=
getSkuStock
(
itemVo
.
getListId
(),
skuId
);
int
restStock
=
decrSkuStock
(
itemVo
.
getListId
(),
skuId
,
lastStock
);
if
(
restStock
<
0
)
{
//库存超过销售量 操作失败回滚库存
incrSkuStock
(
itemVo
.
getListId
(),
skuId
,
lastStock
);
}
else
{
//上个时间段的库存增加到当前时间段
incrSkuStock
(
vo
.
getListId
(),
skuId
,
lastStock
);
}
}
}
}
/**
/**
* 分段购获取
* 分段购获取
*
*
...
...
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