记得上下班打卡 | 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
3fc9e0b4
Commit
3fc9e0b4
authored
Apr 02, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加主动售罄soldoutStatus、是否购买skuCanbuy、是否隐藏skuAppear判断;delGoblinNftGoodsInfoListVo;商品列表售罄排序
parent
e5c79779
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
12 deletions
+36
-12
GoblinNftGoodsSkuInfoVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
+5
-2
GoblinNftGoodsSkuListVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSkuListVo.java
+4
-1
GoblinNftGoodsAppServiceImpl.java
...ice/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
+14
-6
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+4
-0
GoblinNftOrderServiceImpl.java
...service/order/service/impl/GoblinNftOrderServiceImpl.java
+9
-3
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
View file @
3fc9e0b4
...
...
@@ -57,9 +57,11 @@ public class GoblinNftGoodsSkuInfoVo 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
;
@ApiModelProperty
(
position
=
5
7
,
value
=
"当前用户还可以购买数量 有限购的时候用"
)
@ApiModelProperty
(
position
=
5
8
,
value
=
"当前用户还可以购买数量 有限购的时候用"
)
private
int
canBuyNum
;
private
static
final
GoblinNftGoodsSkuInfoVo
obj
=
new
GoblinNftGoodsSkuInfoVo
();
...
...
@@ -87,6 +89,7 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
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 @
3fc9e0b4
...
...
@@ -36,7 +36,9 @@ 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
;
private
static
final
GoblinNftGoodsSkuListVo
obj
=
new
GoblinNftGoodsSkuListVo
();
...
...
@@ -57,6 +59,7 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
this
.
setSubtitle
(
source
.
getSubtitle
());
this
.
setSkuPic
(
source
.
getSkuPic
());
this
.
setSaleStartTime
(
source
.
getSaleStartTime
());
this
.
setSoldoutStatus
(
source
.
getSoldoutStatus
());
return
this
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
View file @
3fc9e0b4
...
...
@@ -22,7 +22,9 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Slf4j
...
...
@@ -45,14 +47,13 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
int
size
=
20
;
//条件
Query
query
=
Query
.
query
(
Criteria
.
where
(
"skuType"
).
is
(
1
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"status"
).
is
(
"3"
).
and
(
"shelvesStatus"
).
is
(
"3"
)
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
();
if
(
null
==
skuList
||
page
>
1
)
{
skuList
=
new
ArrayList
<>();
// 分页 排序:按照开售时间
// TODO: jxl 2022/3/30 售罄放后面
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
size
,
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"saleStartTime"
));
query
.
with
(
pageable
);
...
...
@@ -73,21 +74,28 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
}
for
(
GoblinNftGoodsSkuListVo
skuInfoVo
:
skuList
)
{
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuInfoVo
.
getSkuId
());
if
(
stock
<=
0
)
{
if
(
stock
<=
0
||
skuInfoVo
.
getSoldoutStatus
().
equals
(
"1"
)
)
{
skuInfoVo
.
setIsStock
(
0
);
}
else
{
skuInfoVo
.
setIsStock
(
1
);
}
}
List
<
GoblinNftGoodsSkuListVo
>
listSort
=
skuList
.
stream
().
sorted
(
Comparator
.
comparing
(
GoblinNftGoodsSkuListVo:
:
getIsStock
).
reversed
()).
collect
(
Collectors
.
toList
());
PagedResult
<
GoblinNftGoodsSkuListVo
>
listVoPagedResult
=
ObjectUtil
.
getGoblinNftGoodsSkuListVoPagedResult
();
listVoPagedResult
.
setList
(
skuLis
t
).
setTotal
(
count
,
size
).
setPageSize
(
size
).
setCurrentPage
(
page
);
listVoPagedResult
.
setList
(
listSor
t
).
setTotal
(
count
,
size
).
setPageSize
(
size
).
setCurrentPage
(
page
);
return
ResponseDto
.
success
(
listVoPagedResult
);
}
@Override
public
GoblinNftGoodsSkuInfoVo
goodsDetail
(
String
skuId
)
{
GoblinGoodsSkuInfoVo
goodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(
null
!=
goodsSkuInfoVo
&&
goodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
)
&&
goodsSkuInfoVo
.
getShelvesStatus
().
equals
(
"3"
))
{
if
(
null
!=
goodsSkuInfoVo
&&
goodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
)
&&
goodsSkuInfoVo
.
getStatus
().
equals
(
"3"
)
&&
goodsSkuInfoVo
.
getShelvesStatus
().
equals
(
"3"
)
&&
goodsSkuInfoVo
.
getSkuAppear
().
equals
(
"0"
)
&&
goodsSkuInfoVo
.
getSkuType
()
==
1
)
{
GoblinNftGoodsSkuInfoVo
nftGoodsSkuInfoVo
=
GoblinNftGoodsSkuInfoVo
.
getNew
().
copy
(
goodsSkuInfoVo
);
// 限购数量
Integer
buyCount
=
0
;
...
...
@@ -101,7 +109,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
// 库存
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuId
);
log
.
info
(
"skuId:{}, 库存数量:{}"
,
skuId
,
stock
);
if
(
stock
<=
0
)
{
if
(
stock
<=
0
||
nftGoodsSkuInfoVo
.
getSoldoutStatus
().
equals
(
"1"
)
)
{
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 @
3fc9e0b4
...
...
@@ -1364,6 +1364,10 @@ public class GoblinRedisUtils {
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_GOODS_LIST
;
redisUtil
.
set
(
redisKey
,
spuList
);
}
public
void
delGoblinNftGoodsInfoListVo
()
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_GOODS_LIST
;
redisUtil
.
del
(
redisKey
);
}
/* ---------------------------------------- 我的藏品 ---------------------------------------- */
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinNftOrderServiceImpl.java
View file @
3fc9e0b4
...
...
@@ -67,7 +67,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
String
skuId
=
payParam
.
getSkuId
();
int
number
=
1
;
GoblinGoodsSkuInfoVo
skuVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(
null
==
skuVo
)
{
if
(
null
==
skuVo
||
skuVo
.
getSkuAppear
().
equals
(
"1"
)
)
{
return
ResponseDto
.
failure
(
"该商品不存在~"
);
}
String
spuId
=
skuVo
.
getSpuId
();
...
...
@@ -79,9 +79,16 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
return
ResponseDto
.
failure
(
"该商品不属于藏品~"
);
}
// 3审核通过 3已上架 0未删除 才可购买
if
(!
skuVo
.
getStatus
().
equals
(
"3"
)
||
!
skuVo
.
getShelvesStatus
().
equals
(
"3"
)
||
skuVo
.
getDelFlg
().
equals
(
"1"
))
{
if
(
!
skuVo
.
getStatus
().
equals
(
"3"
)
||
!
skuVo
.
getShelvesStatus
().
equals
(
"3"
)
||
skuVo
.
getDelFlg
().
equals
(
"1"
)
||
skuVo
.
getSkuCanbuy
().
equals
(
"0"
)
)
{
return
ResponseDto
.
failure
(
"该商品当前状态不可购买~"
);
}
// 主动设置的售罄
if
(
skuVo
.
getSoldoutStatus
().
equals
(
1
))
{
return
ResponseDto
.
failure
(
"该商品已售罄~"
);
}
// 判断开售、停售时间
LocalDateTime
saleStartTime
=
skuVo
.
getSaleStartTime
();
LocalDateTime
saleStopTime
=
skuVo
.
getSaleStopTime
();
...
...
@@ -609,7 +616,6 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
// 加积分
goblinOrderUtils
.
doTask
(
uid
,
orderVo
.
getPriceActual
());
// TODO: jxl 2022/3/31 仍炳上链的对列 盲盒要不要仍
}
// 写入用户订单列表 因取消的订单不展示 所以放在这里
nftOrderUtils
.
addNftOrderList
(
uid
,
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