记得上下班打卡 | 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
9971166d
Commit
9971166d
authored
Apr 11, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
藏品详情增加IOS价格;藏品列表和详情各状态判断和库存判断的整理
parent
093444ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
27 deletions
+61
-27
GoblinNftGoodsSkuInfoVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
+3
-3
GoblinNftGoodsSkuListVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSkuListVo.java
+1
-1
GoblinNftGoodsAppServiceImpl.java
...ice/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
+15
-22
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+42
-1
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
View file @
9971166d
...
...
@@ -37,6 +37,8 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
21
,
value
=
"单品现价[20,2]"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
22
,
value
=
"IOS商品价格[20,2]"
)
private
BigDecimal
priceV
;
@ApiModelProperty
(
position
=
23
,
value
=
"单品详情"
,
example
=
"单品详情..."
)
private
String
details
;
...
...
@@ -60,8 +62,6 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
55
,
value
=
"spu相关信息"
)
private
GoblinNftGoodsSpuInfoVo
goblinNftGoodsSpuInfoVo
;
@ApiModelProperty
(
position
=
56
,
value
=
"是否售罄[0-否|1-是]"
)
private
String
soldoutStatus
;
@ApiModelProperty
(
position
=
57
,
value
=
"是否还有库存 0没有库存 1有库存 即售罄"
)
private
int
isStock
;
@ApiModelProperty
(
position
=
58
,
value
=
"当前用户还可以购买数量 有限购的时候用"
)
...
...
@@ -87,12 +87,12 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
this
.
setWatchType
(
source
.
getWatchType
());
this
.
setSkuStock
(
source
.
getSkuStock
());
this
.
setPrice
(
source
.
getPrice
());
this
.
setPriceV
(
source
.
getPriceV
());
this
.
setDetails
(
source
.
getDetails
());
this
.
setBuyLimit
(
source
.
getBuyLimit
());
this
.
setSaleStartTime
(
source
.
getSaleStartTime
());
this
.
setSkuCanbuy
(
source
.
getSkuCanbuy
());
this
.
setExtagVoList
(
source
.
getExtagVoList
());
this
.
setSoldoutStatus
(
source
.
getSoldoutStatus
());
return
this
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsSkuListVo.java
View file @
9971166d
...
...
@@ -38,7 +38,7 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
55
,
value
=
"spu相关信息"
)
private
GoblinNftGoodsSpuInfoVo
goblinNftGoodsSpuInfoVo
;
@ApiModelProperty
(
position
=
56
,
value
=
"是否售罄[0-否|1-是]"
)
@ApiModelProperty
(
position
=
56
,
value
=
"是否售罄[0-否|1-是]
服务端判断库存使用
"
)
private
String
soldoutStatus
;
@ApiModelProperty
(
position
=
57
,
value
=
"是否还有库存 0没有库存即售罄 1有库存"
)
private
int
isStock
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
View file @
9971166d
...
...
@@ -48,7 +48,11 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
int
size
=
10
;
//条件
Query
query
=
Query
.
query
(
Criteria
.
where
(
"skuType"
).
is
(
1
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"status"
).
is
(
"3"
).
and
(
"shelvesStatus"
).
is
(
"3"
).
and
(
"skuAppear"
).
is
(
"0"
)
Criteria
.
where
(
"skuType"
).
is
(
1
)
.
and
(
"delFlg"
).
is
(
"0"
)
.
and
(
"status"
).
is
(
"3"
)
.
and
(
"shelvesStatus"
).
is
(
"3"
)
.
and
(
"skuAppear"
).
is
(
"0"
)
);
long
count
=
mongoTemplate
.
count
(
query
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
List
<
GoblinNftGoodsSkuListVo
>
skuList
=
goblinRedisUtils
.
getGoblinNftGoodsInfoListVo
();
...
...
@@ -76,18 +80,15 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
for
(
GoblinNftGoodsSkuListVo
skuInfoVo
:
skuList
)
{
int
stock
=
0
;
if
(
skuInfoVo
.
getUnbox
().
equals
(
"0"
))
{
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuInfoVo
.
getSkuId
());
if
(
skuInfoVo
.
getSoldoutStatus
().
equals
(
"0"
))
{
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuInfoVo
.
getSkuId
());
}
}
else
{
String
spuId
=
skuInfoVo
.
getSpuId
();
List
<
String
>
skuArray
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
).
getSkuIdList
();
for
(
String
skuIdItem
:
skuArray
)
{
GoblinGoodsSkuInfoVo
itemVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuIdItem
);
if
(
null
==
itemVo
)
{
continue
;
}
if
(
LocalDateTime
.
now
().
isAfter
(
itemVo
.
getSaleStartTime
())
&&
itemVo
.
getShelvesStatus
().
equals
(
"3"
)
&&
itemVo
.
getSoldoutStatus
().
equals
(
"0"
))
{
//开卖后在计算库存
stock
+=
goblinRedisUtils
.
getSkuStock
(
null
,
skuIdItem
);
}
stock
+=
goblinRedisUtils
.
getSkuAllStatusStock
(
itemVo
);
}
}
if
(
stock
<=
0
||
(
null
!=
skuInfoVo
.
getSoldoutStatus
()
&&
skuInfoVo
.
getSoldoutStatus
().
equals
(
"1"
)))
{
...
...
@@ -106,12 +107,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
@Override
public
GoblinNftGoodsSkuInfoVo
goodsDetail
(
String
skuId
)
{
GoblinGoodsSkuInfoVo
goodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(
null
!=
goodsSkuInfoVo
&&
goodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
)
&&
goodsSkuInfoVo
.
getStatus
().
equals
(
"3"
)
&&
goodsSkuInfoVo
.
getShelvesStatus
().
equals
(
"3"
)
&&
goodsSkuInfoVo
.
getSkuAppear
().
equals
(
"0"
)
&&
goodsSkuInfoVo
.
getSkuType
()
==
1
)
{
if
(
goblinRedisUtils
.
getSkuAllStatusShow
(
goodsSkuInfoVo
))
{
GoblinNftGoodsSkuInfoVo
nftGoodsSkuInfoVo
=
GoblinNftGoodsSkuInfoVo
.
getNew
().
copy
(
goodsSkuInfoVo
);
// 限购数量
Integer
buyCount
=
0
;
...
...
@@ -125,22 +121,19 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
// 库存 盲盒计算所有sku库存总数
int
stock
=
0
;
if
(
goodsSkuInfoVo
.
getUnbox
().
equals
(
"0"
))
{
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuId
);
if
(
goodsSkuInfoVo
.
getSoldoutStatus
().
equals
(
"0"
))
{
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuId
);
}
}
else
{
String
spuId
=
goodsSkuInfoVo
.
getSpuId
();
List
<
String
>
skuArray
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
).
getSkuIdList
();
for
(
String
skuIdItem
:
skuArray
)
{
GoblinGoodsSkuInfoVo
itemVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuIdItem
);
if
(
null
==
itemVo
)
{
continue
;
}
if
(
LocalDateTime
.
now
().
isAfter
(
itemVo
.
getSaleStartTime
())
&&
itemVo
.
getShelvesStatus
().
equals
(
"3"
)
&&
itemVo
.
getSoldoutStatus
().
equals
(
"0"
))
{
//开卖后在计算库存
stock
+=
goblinRedisUtils
.
getSkuStock
(
null
,
skuIdItem
);
}
stock
+=
goblinRedisUtils
.
getSkuAllStatusStock
(
itemVo
);
}
}
log
.
info
(
"skuId:{}, 库存数量:{}"
,
skuId
,
stock
);
if
(
stock
<=
0
||
(
null
!=
nftGoodsSkuInfoVo
.
getSoldoutStatus
()
&&
nftGoodsSkuInfoVo
.
getSoldoutStatus
().
equals
(
"1"
))
)
{
if
(
stock
<=
0
)
{
nftGoodsSkuInfoVo
.
setIsStock
(
0
);
}
else
{
nftGoodsSkuInfoVo
.
setIsStock
(
1
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
9971166d
...
...
@@ -1467,12 +1467,53 @@ public class GoblinRedisUtils {
return
redisUtil
.
set
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK
.
concat
(
vo
.
getArtworkId
()),
vo
,
259200
);
}
//
//
记录用户开通数字账户
public
void
setNftNumAccount
(
String
userId
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_NUM_ACCOUNT
.
concat
(
userId
);
redisUtil
.
set
(
redisKey
,
1
);
}
/**
* private int skuType 商品类型[0-常规|1-数字藏品]
* private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过];
* private String shelvesStatus 单品上架状态[0-待上架|1-下架|2-违规|3-上架];
* private String skuAppear 是否隐藏[0-默认展示|1-隐藏];
* private String delFlg 删除标记[0-未删除|1-删除];
*
* private LocalDateTime saleStartTime 开售时间;
* private LocalDateTime saleStopTime 停售时间 预留 暂时不做处理;
* private String soldoutStatus 是否售罄[0-否|1-是];
*
* private String skuCanbuy 是否购买[0-否|1-是] 这个用来预览 前端自己判断;
*/
// 获取盲盒下藏品的库存 各种状态下不能算库存的排除掉
public
int
getSkuAllStatusStock
(
GoblinGoodsSkuInfoVo
info
)
{
if
(
info
!=
null
&&
LocalDateTime
.
now
().
isAfter
(
info
.
getSaleStartTime
())
&&
info
.
getSoldoutStatus
().
equals
(
"0"
)
)
{
// 可以返回库存
return
getSkuStock
(
null
,
info
.
getSkuId
());
}
else
{
// 不计入库存
return
0
;
}
}
// 各种状态下判断藏品是否可以展示
public
boolean
getSkuAllStatusShow
(
GoblinGoodsSkuInfoVo
info
)
{
if
(
info
!=
null
&&
info
.
getSkuType
()
==
1
&&
info
.
getStatus
().
equals
(
"3"
)
&&
info
.
getShelvesStatus
().
equals
(
"3"
)
&&
info
.
getSkuAppear
().
equals
(
"0"
)
&&
info
.
getDelFlg
().
equals
(
"0"
)
)
{
return
true
;
}
else
{
return
false
;
}
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
}
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