记得上下班打卡 | 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
bed5b5c8
Commit
bed5b5c8
authored
Apr 11, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
盲盒计算库存
parent
768b7158
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
GoblinNftGoodsSkuListVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSkuListVo.java
+3
-0
GoblinNftGoodsAppServiceImpl.java
...ice/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
+21
-3
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsSkuListVo.java
View file @
bed5b5c8
...
@@ -27,6 +27,8 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
...
@@ -27,6 +27,8 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
private
String
subtitle
;
private
String
subtitle
;
@ApiModelProperty
(
position
=
15
,
value
=
"单品默认图片的URL[256]"
)
@ApiModelProperty
(
position
=
15
,
value
=
"单品默认图片的URL[256]"
)
private
String
skuPic
;
private
String
skuPic
;
@ApiModelProperty
(
position
=
16
,
value
=
"是否盲盒[0-否|1-是]"
)
private
String
unbox
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@ApiModelProperty
(
position
=
27
,
value
=
"开售时间"
)
@ApiModelProperty
(
position
=
27
,
value
=
"开售时间"
)
...
@@ -60,6 +62,7 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
...
@@ -60,6 +62,7 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
this
.
setSkuPic
(
source
.
getSkuPic
());
this
.
setSkuPic
(
source
.
getSkuPic
());
this
.
setSaleStartTime
(
source
.
getSaleStartTime
());
this
.
setSaleStartTime
(
source
.
getSaleStartTime
());
this
.
setSoldoutStatus
(
source
.
getSoldoutStatus
());
this
.
setSoldoutStatus
(
source
.
getSoldoutStatus
());
this
.
setUnbox
(
source
.
getUnbox
());
return
this
;
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 @
bed5b5c8
...
@@ -74,7 +74,22 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
...
@@ -74,7 +74,22 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
}
}
}
}
for
(
GoblinNftGoodsSkuListVo
skuInfoVo
:
skuList
)
{
for
(
GoblinNftGoodsSkuListVo
skuInfoVo
:
skuList
)
{
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuInfoVo
.
getSkuId
());
int
stock
=
0
;
if
(
skuInfoVo
.
getUnbox
().
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
);
}
}
}
if
(
stock
<=
0
||
(
null
!=
skuInfoVo
.
getSoldoutStatus
()
&&
skuInfoVo
.
getSoldoutStatus
().
equals
(
"1"
)))
{
if
(
stock
<=
0
||
(
null
!=
skuInfoVo
.
getSoldoutStatus
()
&&
skuInfoVo
.
getSoldoutStatus
().
equals
(
"1"
)))
{
skuInfoVo
.
setIsStock
(
0
);
skuInfoVo
.
setIsStock
(
0
);
}
else
{
}
else
{
...
@@ -115,8 +130,11 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
...
@@ -115,8 +130,11 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
String
spuId
=
goodsSkuInfoVo
.
getSpuId
();
String
spuId
=
goodsSkuInfoVo
.
getSpuId
();
List
<
String
>
skuArray
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
).
getSkuIdList
();
List
<
String
>
skuArray
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
).
getSkuIdList
();
for
(
String
skuIdItem
:
skuArray
)
{
for
(
String
skuIdItem
:
skuArray
)
{
GoblinGoodsSkuInfoVo
itemVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
GoblinGoodsSkuInfoVo
itemVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuIdItem
);
if
(
LocalDateTime
.
now
().
isAfter
(
itemVo
.
getSaleStartTime
())
&&
itemVo
.
getShelvesStatus
().
equals
(
"3"
))
{
//开卖后在计算库存
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
.
getSkuStock
(
null
,
skuIdItem
);
}
}
}
}
...
...
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