记得上下班打卡 | 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
1
Merge Requests
1
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
7df42cee
Commit
7df42cee
authored
Mar 28, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nft商品列表详情完善
parent
1646fdd9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
110 additions
and
209 deletions
+110
-209
GoblinNftGoodsInfoListVo.java
...idnet/service/goblin/dto/vo/GoblinNftGoodsInfoListVo.java
+0
-100
GoblinNftGoodsSkuInfoVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
+18
-46
GoblinNftGoodsSpuInfoVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSpuInfoVo.java
+40
-0
IGoblinNftGoodsAppService.java
...net/service/goblin/service/IGoblinNftGoodsAppService.java
+3
-3
liquidnet-service-goblin.yml
...-bus-config/liquidnet-config/liquidnet-service-goblin.yml
+2
-0
GoblinNftGoodsAppController.java
...ervice/goblin/controller/GoblinNftGoodsAppController.java
+5
-7
GoblinNftGoodsAppServiceImpl.java
...ice/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
+39
-50
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+3
-3
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsInfoListVo.java
deleted
100644 → 0
View file @
1646fdd9
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinNftGoodsInfoListVo"
,
description
=
"NFT商品SPU详情[不包含具体SKU,SKU详情参见'GoblinNftGoodsSkuInfoVo']"
)
@Data
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
GoblinNftGoodsInfoListVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
3869909399504844722L
;
@ApiModelProperty
(
position
=
10
,
value
=
"店铺ID"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
11
,
value
=
"商品ID[64]"
)
private
String
spuId
;
@ApiModelProperty
(
position
=
12
,
value
=
"商品编码[默认为系统编码,也可手动输入商家自己的编码]"
)
private
String
spuNo
;
@ApiModelProperty
(
position
=
13
,
value
=
"商品名称[100]"
)
private
String
name
;
@ApiModelProperty
(
position
=
14
,
value
=
"商品副标题[128]"
)
private
String
subtitle
;
@ApiModelProperty
(
position
=
20
,
value
=
"封面图片地址[256]"
)
private
String
coverPic
;
@ApiModelProperty
(
position
=
21
,
value
=
"商品视频地址"
)
private
String
video
;
@ApiModelProperty
(
position
=
15
,
value
=
"销售价-原价[20,2]"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
16
,
value
=
"价格区间MIN[20,2]"
)
private
BigDecimal
priceGe
;
@ApiModelProperty
(
position
=
17
,
value
=
"价格区间MAX[20,2]"
)
private
BigDecimal
priceLe
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@ApiModelProperty
(
position
=
31
,
value
=
"开售时间"
)
private
LocalDateTime
saleStartTime
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@ApiModelProperty
(
position
=
31
,
value
=
"停售时间"
)
private
LocalDateTime
saleStopTime
;
@ApiModelProperty
(
position
=
32
,
value
=
"商品有效期[YYYY-MM-DD]"
)
private
String
spuValidity
;
@ApiModelProperty
(
position
=
34
,
value
=
"审核状态[0-编辑中|1-审核中|2-审核不通过|3-审核通过]"
)
private
String
status
;
@ApiModelProperty
(
position
=
36
,
value
=
"商品上架状态[0-待上架|1-下架|2-违规|3-上架]"
)
private
String
shelvesStatus
;
@ApiModelProperty
(
position
=
37
,
value
=
"自定义展示[0-默认展示|1-隐藏不可购买]"
)
private
String
spuAppear
;
@ApiModelProperty
(
position
=
37
,
value
=
"创作者"
)
private
String
author
;
@ApiModelProperty
(
position
=
37
,
value
=
"发行方"
)
private
String
publisher
;
@ApiModelProperty
(
position
=
39
,
value
=
"上架时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
shelvesAt
;
@ApiModelProperty
(
position
=
40
,
value
=
"商品图片列表"
)
private
List
<
String
>
imageList
;
@ApiModelProperty
(
position
=
52
,
value
=
"商品标签列表"
)
private
List
<
GoblinGoodsTagVo
>
tagVoList
;
@ApiModelProperty
(
position
=
54
,
value
=
"音乐人、艺术家、IP列表"
)
private
List
<
GoblinGoodsExtagVo
>
extagVoList
;
@ApiModelProperty
(
position
=
55
,
value
=
"AR标签"
)
private
List
<
GoblinGoodsExtagVo
>
artagVoList
;
@ApiModelProperty
(
position
=
56
,
value
=
"SPU包含的SKU_ID列表"
)
private
List
<
String
>
skuIdList
;
@ApiModelProperty
(
position
=
61
,
value
=
"销量"
)
private
Integer
count
;
@ApiModelProperty
(
position
=
62
,
value
=
"商铺名称"
)
private
String
storeName
;
@ApiModelProperty
(
position
=
63
,
value
=
"skuList"
)
private
List
<
GoblinNftGoodsSkuInfoVo
>
nftGoodsSkuInfoVoList
;
private
static
final
GoblinNftGoodsInfoListVo
obj
=
new
GoblinNftGoodsInfoListVo
();
public
static
GoblinNftGoodsInfoListVo
getNew
()
{
try
{
return
(
GoblinNftGoodsInfoListVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinNftGoodsInfoListVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
View file @
7df42cee
...
...
@@ -26,8 +26,6 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
private
String
spuId
;
@ApiModelProperty
(
position
=
12
,
value
=
"单品的编号[45]"
)
private
String
skuNo
;
@ApiModelProperty
(
position
=
12
,
value
=
"商品类型[0-常规|1-数字藏品]"
)
private
int
skuType
;
@ApiModelProperty
(
position
=
13
,
value
=
"单品的名称[100]"
)
private
String
name
;
@ApiModelProperty
(
position
=
14
,
value
=
"单品的副标题[128]"
)
...
...
@@ -36,48 +34,29 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
private
String
skuPic
;
@ApiModelProperty
(
position
=
15
,
value
=
"单品详情展示文件URL[256]"
)
private
String
skuWatch
;
@ApiModelProperty
(
position
=
15
,
value
=
"展示文件类型[1-图片|2-视频|3-模型]"
)
private
String
watchType
;
@ApiModelProperty
(
position
=
15
,
value
=
"素材原始文件类型[1-图片|2-视频|3-模型]"
)
private
String
materialType
;
@ApiModelProperty
(
position
=
15
,
value
=
"素材原始文件URL"
)
private
String
materialUrl
;
@ApiModelProperty
(
position
=
16
,
value
=
"ISBN,针对CD/图书等[50]"
)
private
String
skuIsbn
;
@ApiModelProperty
(
position
=
17
,
value
=
"总库存"
)
private
Integer
stock
;
@ApiModelProperty
(
position
=
18
,
value
=
"单品库存"
)
private
Integer
skuStock
;
@ApiModelProperty
(
position
=
18
,
value
=
"兑换库存"
)
private
Integer
giftStock
;
@ApiModelProperty
(
position
=
18
,
value
=
"盲盒命中率[0.01~100%]"
)
private
BigDecimal
hitRatio
;
@ApiModelProperty
(
position
=
19
,
value
=
"预警库存"
)
private
Integer
warningStock
;
@ApiModelProperty
(
position
=
20
,
value
=
"单品销售价-原价[20,2]"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
21
,
value
=
"单品现价[20,2]"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
22
,
value
=
"单品会员价格[20,2]"
)
private
BigDecimal
priceMember
;
@ApiModelProperty
(
position
=
23
,
value
=
"单品的重量[20,2]"
)
private
BigDecimal
weight
;
@ApiModelProperty
(
position
=
23
,
value
=
"单品简介[256]"
,
example
=
"单品简介..."
)
private
String
intro
;
@ApiModelProperty
(
position
=
23
,
value
=
"单品详情"
,
example
=
"单品详情..."
)
private
String
details
;
@ApiModelProperty
(
position
=
24
,
value
=
"购买限制[0-全部用户|1-仅会员|2-指定用户]"
)
private
String
buyFactor
;
@ApiModelProperty
(
position
=
25
,
value
=
"购买限制人员名单[购买限制为2-指定用户时必填]"
)
private
String
buyRoster
;
@ApiModelProperty
(
position
=
26
,
value
=
"限量[0-无限制|X:限购数量]"
)
private
Integer
buyLimit
;
@ApiModelProperty
(
position
=
27
,
value
=
"商品的店铺ID,如果是平台的则为0"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
27
,
value
=
"上架处理方式[1-等待手动上架|2-直接上架售卖|3-预约定时上架]"
)
private
String
shelvesHandle
;
@ApiModelProperty
(
position
=
27
,
value
=
"预约上架时间[上架处理方式为3-预约定时上架时需要指定]"
)
private
String
shelvesTime
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@ApiModelProperty
(
position
=
27
,
value
=
"开售时间"
)
private
LocalDateTime
saleStartTime
;
...
...
@@ -87,22 +66,22 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
28
,
value
=
"单品有效期"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
skuValidity
;
@ApiModelProperty
(
position
=
29
,
value
=
"是否是虚拟商品[0-否|1-是]"
)
private
String
virtualFlg
;
@ApiModelProperty
(
position
=
30
,
value
=
"审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过]"
)
private
String
status
;
@ApiModelProperty
(
position
=
31
,
value
=
"审核拒绝原因[256]"
)
private
String
reason
;
@ApiModelProperty
(
position
=
32
,
value
=
"单品上架状态[0-待上架|1-下架|2-违规|3-上架]"
)
private
String
shelvesStatus
;
@ApiModelProperty
(
position
=
33
,
value
=
"自定义展示[0-默认展示|1-隐藏不可购买]"
)
private
String
skuAppear
;
@ApiModelProperty
(
position
=
33
,
value
=
"是否盲盒[0-否|1-是]"
)
private
String
unbox
;
@ApiModelProperty
(
position
=
33
,
value
=
"盲盒开启时间"
)
private
LocalDateTime
openingTime
;
@ApiModelProperty
(
position
=
33
,
value
=
"盲盒开启时限[单位秒]"
)
private
Integer
openingLimit
;
@ApiModelProperty
(
position
=
33
,
value
=
"NFT路由"
)
private
String
routeType
;
@ApiModelProperty
(
position
=
33
,
value
=
"NFT上传声明状态[0-待上传|1-已上传|2-上传失败|9-上传中]"
)
...
...
@@ -119,31 +98,24 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
private
String
nftHash
;
@ApiModelProperty
(
position
=
33
,
value
=
"NFT系列声明时间"
)
private
String
declareAt
;
@ApiModelProperty
(
position
=
34
,
value
=
"删除标记[0-未删除|1-删除]"
)
private
String
delFlg
;
@ApiModelProperty
(
position
=
35
,
value
=
"上架时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
shelvesAt
;
@ApiModelProperty
(
position
=
36
,
value
=
"活动Id"
)
private
String
marketId
;
@ApiModelProperty
(
position
=
37
,
value
=
"物流模版ID"
)
private
String
logisticsTemplate
;
private
String
createdBy
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createdAt
;
private
String
updatedBy
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updatedAt
;
private
String
deletedBy
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
deletedAt
;
@ApiModelProperty
(
position
=
40
,
value
=
"单品规格信息"
)
private
List
<
GoblinGoodsSpecDto
>
skuSpecList
;
@ApiModelProperty
(
position
=
54
,
value
=
"单品音乐人标签[藏品类型时使用]"
)
private
List
<
GoblinGoodsExtagVo
>
extagVoList
;
@ApiModelProperty
(
position
=
55
,
value
=
"spu相关信息"
)
private
GoblinNftGoodsSpuInfoVo
goblinNftGoodsSpuInfoVo
;
@ApiModelProperty
(
position
=
56
,
value
=
"是否还有库存 0没有库存 1有库存"
)
private
int
isStock
;
@ApiModelProperty
(
position
=
57
,
value
=
"还可以购买数量"
)
private
int
canBuyNum
;
private
static
final
GoblinNftGoodsSkuInfoVo
obj
=
new
GoblinNftGoodsSkuInfoVo
();
public
static
GoblinNftGoodsSkuInfoVo
getNew
()
{
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsSpuInfoVo.java
0 → 100644
View file @
7df42cee
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"GoblinNftGoodsSpuInfoVo"
,
description
=
"NFT商品SPU详情[不包含具体SKU,SKU详情参见'GoblinNftGoodsSkuInfoVo']"
)
@Data
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
GoblinNftGoodsSpuInfoVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
3869909399504844722L
;
@ApiModelProperty
(
position
=
11
,
value
=
"商品ID[64]"
)
private
String
spuId
;
@ApiModelProperty
(
position
=
37
,
value
=
"创作者"
)
private
String
author
;
@ApiModelProperty
(
position
=
37
,
value
=
"发行方"
)
private
String
publisher
;
@ApiModelProperty
(
position
=
61
,
value
=
"销量"
)
private
Integer
count
;
@ApiModelProperty
(
position
=
62
,
value
=
"商铺名称"
)
private
String
storeName
;
private
static
final
GoblinNftGoodsSpuInfoVo
obj
=
new
GoblinNftGoodsSpuInfoVo
();
public
static
GoblinNftGoodsSpuInfoVo
getNew
()
{
try
{
return
(
GoblinNftGoodsSpuInfoVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinNftGoodsSpuInfoVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinNftGoodsAppService.java
View file @
7df42cee
...
...
@@ -2,13 +2,13 @@ package com.liquidnet.service.goblin.service;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftGoods
InfoList
Vo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftGoods
SkuInfo
Vo
;
public
interface
IGoblinNftGoodsAppService
{
ResponseDto
<
PageInfo
<
GoblinNftGoods
InfoList
Vo
>>
goodsList
(
int
pag
);
ResponseDto
<
PageInfo
<
GoblinNftGoods
SkuInfo
Vo
>>
goodsList
(
int
pag
);
GoblinNftGoods
InfoListVo
goodsDetail
(
String
spuId
,
String
skuId
);
GoblinNftGoods
SkuInfoVo
goodsDetail
(
String
skuId
);
Boolean
exchange
(
String
code
);
}
liquidnet-bus-config/liquidnet-config/liquidnet-service-goblin.yml
View file @
7df42cee
...
...
@@ -108,6 +108,8 @@ global-auth:
-
${liquidnet.info.context}/store/coupon/backCoupon
-
${liquidnet.info.context}/store/coupon/useCoupon
-
${liquidnet.info.context}/zhengzai/store/paySuccess
-
${liquidnet.info.context}/nftGoods/list
-
${liquidnet.info.context}/nftGoods/detail
oncheck-url-pattern
:
-
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinNftGoodsAppController.java
View file @
7df42cee
...
...
@@ -2,7 +2,7 @@ package com.liquidnet.service.goblin.controller;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftGoods
InfoList
Vo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftGoods
SkuInfo
Vo
;
import
com.liquidnet.service.goblin.service.IGoblinNftGoodsAppService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -26,7 +26,7 @@ public class GoblinNftGoodsAppController {
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"page"
,
value
=
"页码"
,
example
=
"1"
),
})
public
ResponseDto
<
PageInfo
<
GoblinNftGoods
InfoList
Vo
>>
getGoodsList
(
public
ResponseDto
<
PageInfo
<
GoblinNftGoods
SkuInfo
Vo
>>
getGoodsList
(
@RequestParam
(
name
=
"page"
,
defaultValue
=
"1"
)
Integer
page
)
{
return
goblinNftGoodsAppService
.
goodsList
(
page
);
...
...
@@ -35,14 +35,12 @@ public class GoblinNftGoodsAppController {
@GetMapping
(
"detail"
)
@ApiOperation
(
"获得商品详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"query"
,
required
=
true
,
dataType
=
"String"
,
name
=
"skuId"
,
value
=
"skuId"
,
example
=
"1"
),
})
public
ResponseDto
<
GoblinNftGoodsInfoListVo
>
getGoodsDetail
(
@RequestParam
(
"spuId"
)
String
spuId
,
public
ResponseDto
<
GoblinNftGoodsSkuInfoVo
>
getGoodsDetail
(
@RequestParam
(
"skuId"
)
String
skuId
)
{
GoblinNftGoods
InfoListVo
vo
=
goblinNftGoodsAppService
.
goodsDetail
(
spuId
,
skuId
);
GoblinNftGoods
SkuInfoVo
vo
=
goblinNftGoodsAppService
.
goodsDetail
(
skuId
);
if
(
vo
==
null
)
{
return
ResponseDto
.
failure
(
"商品不存在"
);
}
...
...
@@ -50,7 +48,7 @@ public class GoblinNftGoodsAppController {
}
@PostMapping
(
"exchange"
)
@ApiOperation
(
"兑换码兑换"
)
//
@ApiOperation("兑换码兑换")
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"from"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"兑换码"
,
example
=
"1"
),
})
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
View file @
7df42cee
...
...
@@ -5,8 +5,8 @@ import com.liquidnet.commons.lang.util.CurrentUtil;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsInfoListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSkuInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSpuInfoVo
;
import
com.liquidnet.service.goblin.service.GoblinCouponService
;
import
com.liquidnet.service.goblin.service.IGoblinNftGoodsAppService
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
...
...
@@ -43,83 +43,72 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
GoblinCouponService
goblinCouponService
;
@Override
public
ResponseDto
<
PageInfo
<
GoblinNftGoodsInfoListVo
>>
goodsList
(
int
page
)
{
public
ResponseDto
<
PageInfo
<
GoblinNftGoodsSkuInfoVo
>>
goodsList
(
int
page
)
{
int
size
=
20
;
//条件
Query
query
=
Query
.
query
(
Criteria
.
where
(
"s
puType"
).
is
(
1
).
and
(
"delFlg"
).
is
(
0
).
and
(
"status"
).
is
(
3
).
and
(
"shelvesStatus"
).
is
(
3
).
and
(
"
"
)
Criteria
.
where
(
"s
kuType"
).
is
(
1
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"status"
).
is
(
"3"
).
and
(
"shelvesStatus"
).
is
(
"3
"
)
);
long
count
=
mongoTemplate
.
count
(
query
,
GoblinGoods
InfoVo
.
class
,
GoblinGoods
InfoVo
.
class
.
getSimpleName
());
List
<
GoblinNftGoods
InfoListVo
>
sp
uList
=
goblinRedisUtils
.
getGoblinNftGoodsInfoListVo
();
if
(
null
==
s
p
uList
||
page
>
1
)
{
s
p
uList
=
new
ArrayList
<>();
long
count
=
mongoTemplate
.
count
(
query
,
GoblinGoods
SkuInfoVo
.
class
,
GoblinGoodsSku
InfoVo
.
class
.
getSimpleName
());
List
<
GoblinNftGoods
SkuInfoVo
>
sk
uList
=
goblinRedisUtils
.
getGoblinNftGoodsInfoListVo
();
if
(
null
==
s
k
uList
||
page
>
1
)
{
s
k
uList
=
new
ArrayList
<>();
// 排序 分页
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
size
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdAt"
));
query
.
with
(
pageable
);
List
<
GoblinGoodsInfoVo
>
goodsInfoVoList
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
for
(
GoblinGoodsInfoVo
info
:
goodsInfoVoList
)
{
List
<
String
>
skuIdList
=
info
.
getSkuIdList
();
List
<
GoblinNftGoodsSkuInfoVo
>
spuSkuVoList
=
new
ArrayList
<>();
for
(
String
skuId
:
skuIdList
)
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
GoblinNftGoodsSkuInfoVo
nftGoodsSkuInfoVo
=
GoblinNftGoodsSkuInfoVo
.
getNew
();
BeanUtils
.
copyProperties
(
skuInfoVo
,
nftGoodsSkuInfoVo
);
spuSkuVoList
.
add
(
nftGoodsSkuInfoVo
);
}
List
<
GoblinGoodsSkuInfoVo
>
skuInfoVos
=
mongoTemplate
.
find
(
query
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
for
(
GoblinGoodsSkuInfoVo
info
:
skuInfoVos
)
{
GoblinGoodsInfoVo
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
info
.
getSpuId
());
GoblinNftGoodsSpuInfoVo
nftGoodsSpuInfoVo
=
GoblinNftGoodsSpuInfoVo
.
getNew
();
BeanUtils
.
copyProperties
(
goodsInfoVo
,
nftGoodsSpuInfoVo
);
GoblinNftGoods
InfoListVo
nftGoodsInfoListVo
=
GoblinNftGoodsInfoList
Vo
.
getNew
();
BeanUtils
.
copyProperties
(
info
,
nftGoods
InfoList
Vo
);
nftGoods
InfoListVo
.
setNftGoodsSkuInfoVoList
(
spuSkuVoList
);
s
puList
.
add
(
nftGoodsInfoList
Vo
);
GoblinNftGoods
SkuInfoVo
nftGoodsSkuInfoVo
=
GoblinNftGoodsSkuInfo
Vo
.
getNew
();
BeanUtils
.
copyProperties
(
info
,
nftGoods
SkuInfo
Vo
);
nftGoods
SkuInfoVo
.
setGoblinNftGoodsSpuInfoVo
(
nftGoodsSpuInfoVo
);
s
kuList
.
add
(
nftGoodsSkuInfo
Vo
);
}
if
(
page
<=
1
)
{
goblinRedisUtils
.
setGoblinNftGoodsInfoListVo
(
s
p
uList
);
goblinRedisUtils
.
setGoblinNftGoodsInfoListVo
(
s
k
uList
);
}
}
PageInfo
<
GoblinNftGoods
InfoListVo
>
pageInfo
=
new
PageInfo
(
sp
uList
);
PageInfo
<
GoblinNftGoods
SkuInfoVo
>
pageInfo
=
new
PageInfo
(
sk
uList
);
pageInfo
.
setTotal
(
count
);
pageInfo
.
setPageSize
(
size
);
return
ResponseDto
.
success
(
pageInfo
);
}
@Override
public
GoblinNftGoods
InfoListVo
goodsDetail
(
String
spuId
,
String
skuId
)
{
GoblinGoods
InfoVo
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
sp
uId
);
if
(
null
!=
goods
InfoVo
)
{
public
GoblinNftGoods
SkuInfoVo
goodsDetail
(
String
skuId
)
{
GoblinGoods
SkuInfoVo
goodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
sk
uId
);
if
(
null
!=
goods
SkuInfoVo
&&
goodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
)
&&
goodsSkuInfoVo
.
getShelvesStatus
().
equals
(
"3"
)
)
{
Integer
buyCount
=
0
;
String
userId
=
CurrentUtil
.
getCurrentUid
();
if
(
StringUtils
.
isNotBlank
(
userId
))
{
buyCount
=
goblinRedisUtils
.
getSkuCountByUid
(
userId
,
skuId
);
}
GoblinGoodsSkuInfoVo
goodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(
null
!=
goodsSkuInfoVo
&&
goodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
)
&&
goodsSkuInfoVo
.
getShelvesStatus
().
equals
(
"3"
))
{
//获取 sku 库存数量
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuId
);
log
.
info
(
"skuId:{}, 库存数量:{}"
,
skuId
,
stock
);
if
(
0
!=
goodsSkuInfoVo
.
getBuyLimit
())
{
buyCount
=
0
;
// TODO: jxl 2022/3/25 新vo处理
// goodsSkuInfoVo.setCanBuy(goodsSkuInfoVo.getBuyLimit() - buyCount);
}
else
{
// goodsSkuInfoVo.setCanBuy(-9999);
}
if
(
stock
<=
0
)
{
// goodsSkuInfoVo.setStockLess(true);
}
else
{
// goodsSkuInfoVo.setStockLess(false);
}
List
<
GoblinGoodsSkuInfoVo
>
spuSkuVoList
=
new
ArrayList
<>();
spuSkuVoList
.
add
(
goodsSkuInfoVo
);
goodsInfoVo
.
setGoblinOrderSkuVos
(
spuSkuVoList
);
//获取 sku 库存数量
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
skuId
);
log
.
info
(
"skuId:{}, 库存数量:{}"
,
skuId
,
stock
);
GoblinNftGoodsSkuInfoVo
nftGoodsSkuInfoVo
=
GoblinNftGoodsSkuInfoVo
.
getNew
();
BeanUtils
.
copyProperties
(
goodsSkuInfoVo
,
nftGoodsSkuInfoVo
);
if
(
0
!=
goodsSkuInfoVo
.
getBuyLimit
())
{
nftGoodsSkuInfoVo
.
setCanBuyNum
(
goodsSkuInfoVo
.
getBuyLimit
()
-
buyCount
);
}
if
(
stock
<=
0
)
{
nftGoodsSkuInfoVo
.
setIsStock
(
0
);
}
else
{
return
null
;
nftGoodsSkuInfoVo
.
setIsStock
(
1
)
;
}
GoblinGoodsInfoVo
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
goodsSkuInfoVo
.
getSpuId
());
GoblinNftGoodsSpuInfoVo
nftGoodsSpuInfoVo
=
GoblinNftGoodsSpuInfoVo
.
getNew
();
BeanUtils
.
copyProperties
(
goodsInfoVo
,
nftGoodsSpuInfoVo
);
nftGoodsSkuInfoVo
.
setGoblinNftGoodsSpuInfoVo
(
nftGoodsSpuInfoVo
);
return
nftGoodsSkuInfoVo
;
}
else
{
return
null
;
}
// return goodsInfoVo;
return
GoblinNftGoodsInfoListVo
.
getNew
();
}
@Override
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
7df42cee
...
...
@@ -1350,16 +1350,16 @@ public class GoblinRedisUtils {
}
}
public
List
<
GoblinNftGoods
InfoList
Vo
>
getGoblinNftGoodsInfoListVo
()
{
public
List
<
GoblinNftGoods
SkuInfo
Vo
>
getGoblinNftGoodsInfoListVo
()
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_GOODS_LIST
;
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
return
null
;
}
else
{
return
(
List
<
GoblinNftGoods
InfoList
Vo
>)
obj
;
return
(
List
<
GoblinNftGoods
SkuInfo
Vo
>)
obj
;
}
}
public
void
setGoblinNftGoodsInfoListVo
(
List
<
GoblinNftGoods
InfoList
Vo
>
spuList
)
{
public
void
setGoblinNftGoodsInfoListVo
(
List
<
GoblinNftGoods
SkuInfo
Vo
>
spuList
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_NFT_GOODS_LIST
;
redisUtil
.
set
(
redisKey
,
spuList
);
}
...
...
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