记得上下班打卡 | 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
b1a2018a
Commit
b1a2018a
authored
Dec 31, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺活动相关配置 提交 待测试
parent
9f0c5ad1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
3 deletions
+105
-3
GoblinStorePurchaseSkuVo.java
...idnet/service/goblin/dto/vo/GoblinStorePurchaseSkuVo.java
+48
-0
IGoblinStorePurchasingService.java
.../goblin/service/manage/IGoblinStorePurchasingService.java
+9
-0
GoblinStorePurchasingController.java
...in/controller/manage/GoblinStorePurchasingController.java
+16
-1
GoblinStorePurchasingServiceImpl.java
...service/impl/manage/GoblinStorePurchasingServiceImpl.java
+26
-2
ObjectUtil.java
...in/java/com/liquidnet/service/goblin/util/ObjectUtil.java
+6
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinStorePurchaseSkuVo.java
0 → 100644
View file @
b1a2018a
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinStorePurchaseSkuVo"
,
description
=
"限时秒杀活动-商品SkuVo"
)
@Data
public
class
GoblinStorePurchaseSkuVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
8425727558228094904L
;
@ApiModelProperty
(
position
=
0
,
value
=
"单品规格信息"
)
private
List
<
GoblinGoodsSpecDto
>
skuSpecList
;
@ApiModelProperty
(
position
=
1
,
value
=
"marketSkuId"
)
private
String
marketSkuId
;
@ApiModelProperty
(
position
=
1
,
value
=
"总库存"
)
private
Integer
stock
;
@ApiModelProperty
(
position
=
2
,
value
=
"可配置库存"
)
private
Integer
skuStock
;
@ApiModelProperty
(
position
=
3
,
value
=
"原价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
4
,
value
=
"秒杀价"
)
private
BigDecimal
priceMarketing
;
@ApiModelProperty
(
position
=
5
,
value
=
"库存数量"
)
private
Integer
stockMarketing
;
@ApiModelProperty
(
position
=
6
,
value
=
"限量[0-无限制|X:限购数量]"
)
private
Integer
buyLimit
;
@ApiModelProperty
(
position
=
7
,
value
=
"购买限制[0-全部用户|1-仅会员|2-指定用户]"
)
private
Integer
buyFactor
;
@ApiModelProperty
(
position
=
8
,
value
=
"购买限制人员名单[购买限制为2-指定用户时必填]"
)
private
Integer
buyRoster
;
private
static
final
GoblinStorePurchaseSkuVo
obj
=
new
GoblinStorePurchaseSkuVo
();
public
static
GoblinStorePurchaseSkuVo
getNew
()
{
try
{
return
(
GoblinStorePurchaseSkuVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinStorePurchaseSkuVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinStorePurchasingService.java
View file @
b1a2018a
...
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseCommonParam;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStorePurchaseSkuVo
;
import
java.util.List
;
...
...
@@ -75,6 +76,14 @@ public interface IGoblinStorePurchasingService {
*/
ResponseDto
<
List
<
GoblinMarketSpuListVo
>>
purchasingSpuList
(
String
marketId
,
String
storeId
,
int
page
);
/**
* 获取活动内sku列表
*
* @param marketId 活动秒杀id
* @return
*/
ResponseDto
<
List
<
GoblinStorePurchaseSkuVo
>>
purchasingSkuList
(
String
marketId
,
String
storeId
,
String
spuId
);
/**
* 添加活动相关sku
*
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStorePurchasingController.java
View file @
b1a2018a
...
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseCommonParam;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseParam
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStorePurchaseSkuVo
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService
;
import
io.swagger.annotations.*
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -89,7 +90,7 @@ public class GoblinStorePurchasingController {
}
@GetMapping
(
"purchasing/spu"
)
@ApiOperation
(
"活动详情-限时秒杀-s
k
u列表"
)
@ApiOperation
(
"活动详情-限时秒杀-s
p
u列表"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
...
...
@@ -102,6 +103,20 @@ public class GoblinStorePurchasingController {
return
goblinStorePurchasingService
.
purchasingSpuList
(
marketId
,
storeId
,
page
);
}
@GetMapping
(
"purchasing/sku"
)
@ApiOperation
(
"活动详情-限时秒杀-sku列表"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"商铺id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuMarketId"
,
example
=
"1"
),
})
public
ResponseDto
<
List
<
GoblinStorePurchaseSkuVo
>>
purchasingSkuList
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"spuMarketId"
)
@Valid
String
spuId
)
{
return
goblinStorePurchasingService
.
purchasingSkuList
(
marketId
,
storeId
,
spuId
);
}
@PostMapping
(
"purchasing/sku"
)
@ApiOperation
(
"活动详情-限时秒杀-sku新增"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStorePurchasingServiceImpl.java
View file @
b1a2018a
...
...
@@ -169,8 +169,8 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
List
<
GoblinStoreMarketIsConfigVo
>
spuIds
=
goblinRedisUtils
.
getStoreMarketIsConfig
(
marketId
,
storeId
);
List
<
String
>
marketSpuList
=
spuIds
.
stream
().
map
(
GoblinStoreMarketIsConfigVo:
:
getMarketSpuId
).
collect
(
Collectors
.
toList
());
List
<
GoblinMarketSpuListVo
>
voList
=
ObjectUtil
.
getGoblinMarketSpuListVoArrayList
();
int
count
=
page
*
40
;
int
startCount
=
(
page
-
1
)
*
40
;
int
count
=
page
*
size
;
int
startCount
=
(
page
-
1
)
*
size
;
if
(
count
>=
marketSpuList
.
size
())
{
count
=
marketSpuList
.
size
();
}
...
...
@@ -188,6 +188,30 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
return
ResponseDto
.
success
(
voList
);
}
@Override
public
ResponseDto
<
List
<
GoblinStorePurchaseSkuVo
>>
purchasingSkuList
(
String
marketId
,
String
storeId
,
String
marketSpuId
)
{
GoblinGoodsInfoVo
marketSpuVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
marketSpuId
);
List
<
String
>
marketSkuIdList
=
marketSpuVo
.
getSkuIdList
();
List
<
GoblinStorePurchaseSkuVo
>
voList
=
ObjectUtil
.
getGoblinStorePurchaseSkuVoArrayList
();
for
(
String
marketSkuId
:
marketSkuIdList
)
{
GoblinGoodsSkuInfoVo
marketSkuVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
marketSkuId
);
GoblinGoodsSkuInfoVo
skuVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
marketSkuId
.
split
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
())[
0
]);
GoblinStorePurchaseSkuVo
vo
=
GoblinStorePurchaseSkuVo
.
getNew
();
vo
.
setMarketSkuId
(
marketSkuId
);
vo
.
setSkuSpecList
(
marketSkuVo
.
getSkuSpecList
());
vo
.
setPrice
(
skuVo
.
getPrice
());
vo
.
setStock
(
skuVo
.
getStock
());
vo
.
setSkuStock
(
skuVo
.
getSkuStock
());
vo
.
setPriceMarketing
(
marketSkuVo
.
getPrice
());
vo
.
setStockMarketing
(
marketSkuVo
.
getSkuStock
());
vo
.
setBuyFactor
(
vo
.
getBuyFactor
());
vo
.
setBuyLimit
(
vo
.
getBuyLimit
());
vo
.
setBuyRoster
(
vo
.
getBuyRoster
());
voList
.
add
(
vo
);
}
return
ResponseDto
.
success
(
voList
);
}
@Override
public
ResponseDto
<
Boolean
>
purchasingSkuInsert
(
GoblinStorePurchaseCommonParam
params
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/ObjectUtil.java
View file @
b1a2018a
...
...
@@ -10,6 +10,7 @@ import com.liquidnet.service.goblin.entity.GoblinFrontBanner;
import
com.mongodb.BasicDBObject
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
ObjectUtil
{
private
static
final
PagedResult
<
GoblinStoreMgtGoodsListVo
>
goblinStoreMgtGoodsVoPagedResult
=
new
PagedResult
<>();
...
...
@@ -23,6 +24,7 @@ public class ObjectUtil {
private
static
final
ArrayList
<
GoblinGoodsServiceSupportVo
>
goblinGoodsServiceSupportVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinGoodsExtagVo
>
goblinGoodsExtagVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMarketSpuListVo
>
goblinMarketSpuListVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinStorePurchaseSkuVo
>
goblinStorePurchaseSkuVoArrayList
=
new
ArrayList
<>();
private
static
final
BasicDBObject
basicDBObject
=
new
BasicDBObject
();
...
...
@@ -34,6 +36,10 @@ public class ObjectUtil {
return
(
ArrayList
<
GoblinMarketSpuListVo
>)
goblinMarketSpuListVoArrayList
.
clone
();
}
public
static
ArrayList
<
GoblinStorePurchaseSkuVo
>
getGoblinStorePurchaseSkuVoArrayList
()
{
return
(
ArrayList
<
GoblinStorePurchaseSkuVo
>)
goblinStorePurchaseSkuVoArrayList
.
clone
();
}
public
static
ArrayList
<
GoblinFrontBannerVo
>
goblinFrontBannerVoArrayList
()
{
return
(
ArrayList
<
GoblinFrontBannerVo
>)
goblinFrontBannerVoArrayList
.
clone
();
}
...
...
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