记得上下班打卡 | 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
7bc71d0a
Commit
7bc71d0a
authored
Dec 31, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
库存相关 redis
parent
1808c504
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
GoblinMarketRelationVo.java
...quidnet/service/goblin/dto/vo/GoblinMarketRelationVo.java
+1
-1
GoblinStoreMarketPurchaseRelationVo.java
...ce/goblin/dto/vo/GoblinStoreMarketPurchaseRelationVo.java
+1
-1
CollectionUtil.java
.../java/com/liquidnet/commons/lang/util/CollectionUtil.java
+6
-0
GoblinStorePurchasingServiceImpl.java
...service/impl/manage/GoblinStorePurchasingServiceImpl.java
+10
-4
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMarketRelationVo.java
View file @
7bc71d0a
...
...
@@ -13,7 +13,7 @@ public class GoblinMarketRelationVo implements Serializable, Cloneable {
private
static
final
long
serialVersionUID
=
2353354057235207502L
;
@ApiModelProperty
(
position
=
11
,
value
=
"spuId"
)
private
String
spuId
;
@ApiModelProperty
(
position
=
12
,
value
=
"skuId
几盒
"
)
@ApiModelProperty
(
position
=
12
,
value
=
"skuId
集合
"
)
private
List
<
String
>
skuList
;
private
static
final
GoblinMarketRelationVo
obj
=
new
GoblinMarketRelationVo
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinStoreMarketPurchaseRelationVo.java
View file @
7bc71d0a
...
...
@@ -13,7 +13,7 @@ public class GoblinStoreMarketPurchaseRelationVo implements Serializable, Clonea
private
static
final
long
serialVersionUID
=
2353354057235207502L
;
@ApiModelProperty
(
position
=
11
,
value
=
"spuId"
)
private
String
spuId
;
@ApiModelProperty
(
position
=
12
,
value
=
"skuId
几盒
"
)
@ApiModelProperty
(
position
=
12
,
value
=
"skuId
集合
"
)
private
List
<
String
>
skuList
;
private
static
final
GoblinStoreMarketPurchaseRelationVo
obj
=
new
GoblinStoreMarketPurchaseRelationVo
();
...
...
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/CollectionUtil.java
View file @
7bc71d0a
...
...
@@ -2,6 +2,7 @@ package com.liquidnet.commons.lang.util;
import
org.springframework.util.LinkedMultiValueMap
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.function.Predicate
;
...
...
@@ -15,6 +16,7 @@ public class CollectionUtil {
private
static
final
ArrayList
<
String
>
STRING_ARRAY_LIST
=
new
ArrayList
<>();
private
static
final
ArrayList
<
Integer
>
INTEGER_ARRAY_LIST
=
new
ArrayList
<>();
private
static
final
ArrayList
<
Object
>
OBJECT_ARRAY_LIST
=
new
ArrayList
<>();
private
static
final
ArrayList
<
BigDecimal
>
BIG_DECIMALS_ARRAY_LIST
=
new
ArrayList
<>();
public
static
HashMap
<
String
,
String
>
mapStringString
()
{
...
...
@@ -49,6 +51,10 @@ public class CollectionUtil {
return
(
ArrayList
<
Integer
>)
INTEGER_ARRAY_LIST
.
clone
();
}
public
static
ArrayList
<
BigDecimal
>
arrayListBigDecimal
()
{
return
(
ArrayList
<
BigDecimal
>)
BIG_DECIMALS_ARRAY_LIST
.
clone
();
}
public
static
ArrayList
<
Object
>
arrayListObject
()
{
return
(
ArrayList
<
Object
>)
OBJECT_ARRAY_LIST
.
clone
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStorePurchasingServiceImpl.java
View file @
7bc71d0a
...
...
@@ -23,6 +23,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
...
...
@@ -224,6 +225,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
List
<
String
>
skuList
=
CollectionUtil
.
arrayListString
();
//skuId数组
List
<
String
>
marketSkuList
=
CollectionUtil
.
arrayListString
();
//活动skuId数组
List
<
String
>
errorNameList
=
CollectionUtil
.
arrayListString
();
//修改失败的款式名称数组
List
<
BigDecimal
>
priceList
=
CollectionUtil
.
arrayListBigDecimal
();
//价格集合
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin.store.market.insertRelation"
));
LinkedList
<
Object
[]>
sqlsData
=
CollectionUtil
.
linkedListObjectArr
();
...
...
@@ -269,11 +271,15 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
bean
.
getStockMarketing
(),
bean
.
getBuyFactor
(),
bean
.
getBuyRoster
(),
bean
.
getBuyLimit
(),
bean
.
getDelFlag
(),
bean
.
getCreatedAt
()});
marketSkuList
.
add
(
skuVo
.
getSkuId
());
skuList
.
add
(
item
.
getSkuId
());
priceList
.
add
(
item
.
getPriceMarketing
());
}
//mongo
GoblinGoodsInfoVo
spuVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
params
.
getSpuId
());
spuVo
.
setSpuId
(
marketSpuId
);
spuVo
.
setSkuIdList
(
marketSkuList
);
//排序
spuVo
.
setPriceGe
(
priceList
.
get
(
0
));
spuVo
.
setPriceLe
(
priceList
.
get
(
priceList
.
size
()
-
1
));
spuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
().
concat
(
params
.
getStoreMarketId
()));
goblinMongoUtils
.
setGoodsInfoVo
(
spuVo
);
//redis
...
...
@@ -343,7 +349,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
@Override
public
ResponseDto
<
Boolean
>
purchasingSpuDel
(
String
marketId
,
String
storeId
,
String
spuId
)
{
//判断 如果有订单待支付 则不能关闭
//
todo
判断 如果有订单待支付 则不能关闭
LocalDateTime
now
=
LocalDateTime
.
now
();
String
marketSpuId
=
spuId
.
concat
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
()).
concat
(
IDGenerator
.
marketGoodId
(
marketId
));
GoblinStoreMarketPurchasing
bean
=
GoblinStoreMarketPurchasing
.
getNew
();
...
...
@@ -360,9 +366,9 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
for
(
String
marketSkuId
:
marketVo
.
getSkuIdList
())
{
String
skuId
=
marketSkuId
.
split
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
())[
0
];
//库存回滚
int
restStock
=
goblinRedisUtils
.
getSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
(),
marketSkuId
);
int
restStockDe
=
goblinRedisUtils
.
decrSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
(),
marketSkuId
,
restStock
);
goblinRedisUtils
.
incrSkuStock
(
null
,
skuId
,
restStock
+
restStockDe
);
int
restStock
=
goblinRedisUtils
.
getSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
(),
marketSkuId
);
int
restStockDe
=
goblinRedisUtils
.
decrSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
(),
marketSkuId
,
restStock
);
goblinRedisUtils
.
incrSkuStock
(
null
,
skuId
,
restStock
+
restStockDe
);
}
//mysql
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_STORE_MARKET
.
getKey
(),
...
...
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