记得上下班打卡 | 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
12853a35
Commit
12853a35
authored
Dec 29, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
f07beae8
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
439 additions
and
44 deletions
+439
-44
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+1
-0
GoblinStorePurchaseItemParam.java
...rvice/goblin/dto/manage/GoblinStorePurchaseItemParam.java
+7
-3
GoblinStoreMarketVo.java
.../liquidnet/service/goblin/dto/vo/GoblinStoreMarketVo.java
+44
-0
IGoblinStorePurchasingService.java
.../goblin/service/manage/IGoblinStorePurchasingService.java
+17
-8
GoblinStoreMarketPurchasing.java
...et/service/goblin/entity/GoblinStoreMarketPurchasing.java
+14
-2
GoblinStoreMarketing.java
...liquidnet/service/goblin/entity/GoblinStoreMarketing.java
+9
-2
GoblinStorePurchasingController.java
...in/controller/manage/GoblinStorePurchasingController.java
+23
-16
GoblinStorePurchasingServiceImpl.java
...service/impl/manage/GoblinStorePurchasingServiceImpl.java
+152
-11
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+118
-0
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+48
-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/constant/GoblinRedisConst.java
View file @
12853a35
...
@@ -14,5 +14,6 @@ public class GoblinRedisConst {
...
@@ -14,5 +14,6 @@ public class GoblinRedisConst {
public
static
final
String
REDIS_GOBLIN_ZHENGZAI_RELATION
=
PREFIX
.
concat
(
"zhengzai:market:"
);
public
static
final
String
REDIS_GOBLIN_ZHENGZAI_RELATION
=
PREFIX
.
concat
(
"zhengzai:market:"
);
public
static
final
String
REDIS_GOBLIN_STORE_SELF_RELATION
=
PREFIX
.
concat
(
"zhengzai:storeId:"
);
public
static
final
String
REDIS_GOBLIN_STORE_SELF_RELATION
=
PREFIX
.
concat
(
"zhengzai:storeId:"
);
public
static
final
String
REDIS_GOBLIN_STORE_MARKET
=
PREFIX
.
concat
(
"store:market:"
);
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStorePurchaseItemParam.java
View file @
12853a35
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
java.math.BigDecimal
;
@ApiModel
(
value
=
"GoblinStorePurchaseItemParam"
)
@ApiModel
(
value
=
"GoblinStorePurchaseItemParam"
)
@Data
@Data
...
@@ -16,19 +17,22 @@ public class GoblinStorePurchaseItemParam {
...
@@ -16,19 +17,22 @@ public class GoblinStorePurchaseItemParam {
@ApiModelProperty
(
required
=
true
,
value
=
"商铺Id"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"商铺Id"
,
example
=
"1"
)
@NotBlank
(
message
=
"商铺id不能为空"
)
@NotBlank
(
message
=
"商铺id不能为空"
)
private
String
storeId
;
private
String
storeId
;
@ApiModelProperty
(
required
=
true
,
value
=
"spuId"
,
example
=
"1"
)
@NotBlank
(
message
=
"spuId不能空"
)
private
String
spuId
;
@ApiModelProperty
(
required
=
true
,
value
=
"skuId"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"skuId"
,
example
=
"1"
)
@NotBlank
(
message
=
"skuId不能为空"
)
@NotBlank
(
message
=
"skuId不能为空"
)
private
String
skuId
;
private
String
skuId
;
@ApiModelProperty
(
required
=
true
,
value
=
"活动价格"
,
example
=
"1.00"
)
@ApiModelProperty
(
required
=
true
,
value
=
"活动价格"
,
example
=
"1.00"
)
@NotBlank
(
message
=
"活动价格不能为空"
)
@NotBlank
(
message
=
"活动价格不能为空"
)
private
String
priceMarketing
;
private
BigDecimal
priceMarketing
;
@ApiModelProperty
(
required
=
true
,
value
=
"活动库存"
,
example
=
"1.00"
)
@ApiModelProperty
(
required
=
true
,
value
=
"活动库存"
,
example
=
"1.00"
)
@NotBlank
(
message
=
"活动库存不能为空"
)
@NotBlank
(
message
=
"活动库存不能为空"
)
private
String
stockMarketing
;
private
String
stockMarketing
;
@ApiModelProperty
(
required
=
true
,
value
=
"用户限购[0-不限购|x-限购数量]"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"用户限购[0-不限购|x-限购数量]"
,
example
=
"1"
)
@NotBlank
(
message
=
"用户限购类型不能为空"
)
@NotBlank
(
message
=
"用户限购类型不能为空"
)
private
String
buyLimit
;
private
Integer
buyLimit
;
@ApiModelProperty
(
required
=
true
,
value
=
"购买条件[0-全部用户|1-仅支持会员|2-指定用户可买]"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"购买条件[0-全部用户|1-仅支持会员|2-指定用户可买]"
,
example
=
"1"
)
@NotBlank
(
message
=
"购买条件不能为空"
)
@NotBlank
(
message
=
"购买条件不能为空"
)
private
String
buyType
;
private
Integer
buyType
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinStoreMarketVo.java
0 → 100644
View file @
12853a35
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
@ApiModel
@Data
public
class
GoblinStoreMarketVo
implements
Cloneable
{
@ApiModelProperty
(
value
=
" 商铺营销表id"
)
private
String
storeMarketId
;
@ApiModelProperty
(
value
=
" 营销名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
" 营销类型[1-满赠|2-限时秒杀]"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
" 活动状态[-1-全部|0-等待开始|1-活动中|2-活动结束|7-停用]"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
" 商铺id"
)
private
String
storeId
;
@ApiModelProperty
(
value
=
" 营销描述"
)
private
String
desc
;
@ApiModelProperty
(
value
=
" 营销开始时间"
)
private
LocalDateTime
startTime
;
@ApiModelProperty
(
value
=
" 营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间"
)
private
LocalDateTime
endTime
;
@ApiModelProperty
(
value
=
"活动是否预热[0-否|1-是]"
)
private
Integer
isPre
;
@ApiModelProperty
(
value
=
" 活动预热时间"
)
private
LocalDateTime
preTime
;
@ApiModelProperty
(
value
=
" 创建时间"
)
private
LocalDateTime
createdAt
;
private
static
final
GoblinStoreMarketVo
obj
=
new
GoblinStoreMarketVo
();
public
static
GoblinStoreMarketVo
getNew
()
{
try
{
return
(
GoblinStoreMarketVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinStoreMarketVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinStorePurchasingService.java
View file @
12853a35
package
com
.
liquidnet
.
service
.
goblin
.
service
.
manage
;
package
com
.
liquidnet
.
service
.
goblin
.
service
.
manage
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam
;
import
com.liquidnet.service.goblin.dto.vo.Goblin
Purchasing
Vo
;
import
com.liquidnet.service.goblin.dto.vo.Goblin
StoreMarket
Vo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -19,7 +20,7 @@ public interface IGoblinStorePurchasingService {
...
@@ -19,7 +20,7 @@ public interface IGoblinStorePurchasingService {
* @param ct 创建时间
* @param ct 创建时间
* @return
* @return
*/
*/
ResponseDto
<
List
<
GoblinPurchasing
Vo
>>
purchasingList
(
int
page
,
String
purchaseName
,
int
status
,
String
st
,
String
et
,
String
ct
);
ResponseDto
<
PageInfo
<
GoblinStoreMarket
Vo
>>
purchasingList
(
int
page
,
String
purchaseName
,
int
status
,
String
st
,
String
et
,
String
ct
);
/**
/**
* 活动状态操作
* 活动状态操作
...
@@ -28,7 +29,7 @@ public interface IGoblinStorePurchasingService {
...
@@ -28,7 +29,7 @@ public interface IGoblinStorePurchasingService {
* @param status 状态
* @param status 状态
* @return
* @return
*/
*/
ResponseDto
<
Boolean
>
purchasingStatus
(
String
marketId
,
int
status
);
ResponseDto
<
Boolean
>
purchasingStatus
(
String
marketId
,
String
storeId
,
int
status
);
/**
/**
* 添加 限时秒杀活动
* 添加 限时秒杀活动
...
@@ -61,7 +62,7 @@ public interface IGoblinStorePurchasingService {
...
@@ -61,7 +62,7 @@ public interface IGoblinStorePurchasingService {
* @param marketId 活动秒杀id
* @param marketId 活动秒杀id
* @return
* @return
*/
*/
ResponseDto
<
Goblin
PurchasingVo
>
purchasingDetails
(
String
market
Id
);
ResponseDto
<
Goblin
StoreMarketVo
>
purchasingDetails
(
String
marketId
,
String
store
Id
);
/**
/**
* 获取活动内sku列表
* 获取活动内sku列表
...
@@ -70,15 +71,23 @@ public interface IGoblinStorePurchasingService {
...
@@ -70,15 +71,23 @@ public interface IGoblinStorePurchasingService {
* @param page 页数
* @param page 页数
* @return
* @return
*/
*/
ResponseDto
<
String
>
purchasingSkuList
(
String
marketId
,
int
page
);
//TODO 返回值
ResponseDto
<
String
>
purchasingSkuList
(
String
marketId
,
String
storeId
,
int
page
);
//TODO 返回值
/**
/**
*
配置
活动相关sku
*
添加
活动相关sku
*
*
* @param params
* @param params
* @return
* @return
*/
*/
ResponseDto
<
Boolean
>
purchasingSkuOperation
(
List
<
GoblinStorePurchaseItemParam
>
params
);
ResponseDto
<
Boolean
>
purchasingSkuInsert
(
List
<
GoblinStorePurchaseItemParam
>
params
);
/**
* 编辑活动相关sku
*
* @param params
* @return
*/
ResponseDto
<
Boolean
>
purchasingSkuUpdate
(
List
<
GoblinStorePurchaseItemParam
>
params
);
/**
/**
* 删除活动内sku
* 删除活动内sku
...
@@ -87,5 +96,5 @@ public interface IGoblinStorePurchasingService {
...
@@ -87,5 +96,5 @@ public interface IGoblinStorePurchasingService {
* @param skuId skuId
* @param skuId skuId
* @return
* @return
*/
*/
ResponseDto
<
Boolean
>
purchasingSkuDel
(
String
marketId
,
String
skuId
);
ResponseDto
<
Boolean
>
purchasingSkuDel
(
String
marketId
,
String
s
toreId
,
String
spuId
,
String
s
kuId
);
}
}
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinStoreMarketPurchasing.java
View file @
12853a35
...
@@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode;
...
@@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode;
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
GoblinStoreMarketPurchasing
implements
Serializable
{
public
class
GoblinStoreMarketPurchasing
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -35,6 +35,11 @@ public class GoblinStoreMarketPurchasing implements Serializable {
...
@@ -35,6 +35,11 @@ public class GoblinStoreMarketPurchasing implements Serializable {
*/
*/
private
String
storeMarketId
;
private
String
storeMarketId
;
/**
* spu_id
*/
private
String
spuId
;
/**
/**
* sku_id
* sku_id
*/
*/
...
@@ -76,5 +81,12 @@ public class GoblinStoreMarketPurchasing implements Serializable {
...
@@ -76,5 +81,12 @@ public class GoblinStoreMarketPurchasing implements Serializable {
private
String
comment
;
private
String
comment
;
private
static
final
GoblinStoreMarketPurchasing
obj
=
new
GoblinStoreMarketPurchasing
();
public
static
GoblinStoreMarketPurchasing
getNew
()
{
try
{
return
(
GoblinStoreMarketPurchasing
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinStoreMarketPurchasing
();
}
}
}
}
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinStoreMarketing.java
View file @
12853a35
...
@@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode;
...
@@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode;
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
GoblinStoreMarketing
implements
Serializable
{
public
class
GoblinStoreMarketing
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -87,5 +87,12 @@ public class GoblinStoreMarketing implements Serializable {
...
@@ -87,5 +87,12 @@ public class GoblinStoreMarketing implements Serializable {
private
String
comment
;
private
String
comment
;
private
static
final
GoblinStoreMarketing
obj
=
new
GoblinStoreMarketing
();
public
static
GoblinStoreMarketing
getNew
()
{
try
{
return
(
GoblinStoreMarketing
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinStoreMarketing
();
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStorePurchasingController.java
View file @
12853a35
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam;
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseParam
;
import
com.liquidnet.service.goblin.dto.vo.GoblinPurchasingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinPurchasingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService
;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.*
;
...
@@ -39,27 +40,27 @@ public class GoblinStorePurchasingController {
...
@@ -39,27 +40,27 @@ public class GoblinStorePurchasingController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"endTime"
,
value
=
"活动结束时间"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"endTime"
,
value
=
"活动结束时间"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"createdAt"
,
value
=
"活动创建时间"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"createdAt"
,
value
=
"活动创建时间"
,
example
=
""
),
})
})
public
ResponseDto
<
PageInfo
<
GoblinPurchasingVo
>>
purchasingList
(
@RequestParam
(
value
=
"page"
,
required
=
false
)
@Valid
Integer
page
,
public
ResponseDto
<
PageInfo
<
GoblinStoreMarketVo
>>
purchasingList
(
@RequestParam
(
value
=
"page"
,
required
=
false
)
@Valid
Integer
page
,
@RequestParam
(
value
=
"purchaseName"
,
required
=
false
)
String
purchaseName
,
@RequestParam
(
value
=
"purchaseName"
,
required
=
false
)
String
purchaseName
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
st
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
st
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
et
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
et
,
@RequestParam
(
value
=
"createdAt"
,
required
=
false
)
String
ct
)
{
@RequestParam
(
value
=
"createdAt"
,
required
=
false
)
String
ct
)
{
PageInfo
<
GoblinPurchasingVo
>
data
=
new
PageInfo
<>();
return
goblinStorePurchasingService
.
purchasingList
(
page
,
purchaseName
,
status
,
st
,
et
,
ct
);
data
.
setList
(
goblinStorePurchasingService
.
purchasingList
(
page
,
purchaseName
,
status
,
st
,
et
,
ct
).
getData
());
return
ResponseDto
.
success
(
data
);
}
}
@PutMapping
(
"purchasing/status"
)
@PutMapping
(
"purchasing/status"
)
@ApiOperation
(
"活动操作-限时秒杀"
)
@ApiOperation
(
"活动操作-限时秒杀"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"status"
,
value
=
"活动状态[0-等待开始|7-停用]"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"商铺id"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"status"
,
value
=
"活动状态[0-等待开始(启用)|7-停用|-1-删除]"
,
example
=
""
),
})
})
public
ResponseDto
<
Boolean
>
purchasingStatus
(
@RequestParam
(
value
=
"marketId"
)
@Valid
String
marketId
,
public
ResponseDto
<
Boolean
>
purchasingStatus
(
@RequestParam
(
value
=
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
value
=
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
value
=
"status"
)
@Valid
Integer
status
)
{
@RequestParam
(
value
=
"status"
)
@Valid
Integer
status
)
{
return
goblinStorePurchasingService
.
purchasingStatus
(
marketId
,
status
);
return
goblinStorePurchasingService
.
purchasingStatus
(
marketId
,
st
oreId
,
st
atus
);
}
}
@PostMapping
(
"purchasing"
)
@PostMapping
(
"purchasing"
)
...
@@ -84,9 +85,11 @@ public class GoblinStorePurchasingController {
...
@@ -84,9 +85,11 @@ public class GoblinStorePurchasingController {
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
@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"
),
})
})
public
ResponseDto
<
GoblinPurchasingVo
>
purchasingDetails
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
)
{
public
ResponseDto
<
GoblinStoreMarketVo
>
purchasingDetails
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
return
goblinStorePurchasingService
.
purchasingDetails
(
marketId
);
@RequestParam
(
"storeId"
)
@Valid
String
storeId
)
{
return
goblinStorePurchasingService
.
purchasingDetails
(
marketId
,
storeId
);
}
}
@GetMapping
(
"purchasing/sku"
)
@GetMapping
(
"purchasing/sku"
)
...
@@ -94,11 +97,13 @@ public class GoblinStorePurchasingController {
...
@@ -94,11 +97,13 @@ public class GoblinStorePurchasingController {
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
@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
=
"Integer"
,
name
=
"page"
,
value
=
"页数"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"page"
,
value
=
"页数"
,
example
=
"1"
),
})
})
public
ResponseDto
<
String
>
purchasingSkuList
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
public
ResponseDto
<
String
>
purchasingSkuList
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"page"
)
@Valid
Integer
page
)
{
@RequestParam
(
"page"
)
@Valid
Integer
page
)
{
return
goblinStorePurchasingService
.
purchasingSkuList
(
marketId
,
page
);
return
goblinStorePurchasingService
.
purchasingSkuList
(
marketId
,
storeId
,
page
);
}
}
@PostMapping
(
"purchasing/sku"
)
@PostMapping
(
"purchasing/sku"
)
...
@@ -114,11 +119,13 @@ public class GoblinStorePurchasingController {
...
@@ -114,11 +119,13 @@ public class GoblinStorePurchasingController {
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
@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
=
"skuId"
,
value
=
"skuId"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"skuId"
,
value
=
"skuId"
,
example
=
"1"
),
})
})
public
ResponseDto
<
Boolean
>
purchasingSkuDel
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
public
ResponseDto
<
Boolean
>
purchasingSkuDel
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"skuId"
)
@Valid
String
skuId
)
{
@RequestParam
(
"skuId"
)
@Valid
String
skuId
)
{
return
goblinStorePurchasingService
.
purchasingSkuDel
(
marketId
,
skuId
);
return
goblinStorePurchasingService
.
purchasingSkuDel
(
marketId
,
s
toreId
,
s
kuId
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStorePurchasingServiceImpl.java
View file @
12853a35
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam
;
import
com.liquidnet.service.goblin.dto.vo.GoblinPurchasingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo
;
import
com.liquidnet.service.goblin.entity.GoblinStoreMarketPurchasing
;
import
com.liquidnet.service.goblin.entity.GoblinStoreMarketing
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
@Service
@Service
public
class
GoblinStorePurchasingServiceImpl
implements
IGoblinStorePurchasingService
{
public
class
GoblinStorePurchasingServiceImpl
implements
IGoblinStorePurchasingService
{
@Autowired
GoblinRedisUtils
goblinRedisUtils
;
@Autowired
GoblinMongoUtils
goblinMongoUtils
;
@Override
@Override
public
ResponseDto
<
List
<
GoblinPurchasingVo
>>
purchasingList
(
int
page
,
String
purchaseName
,
int
status
,
String
st
,
String
et
,
String
ct
)
{
public
ResponseDto
<
PageInfo
<
GoblinStoreMarketVo
>>
purchasingList
(
int
page
,
String
purchaseName
,
int
status
,
String
st
,
String
et
,
String
ct
)
{
return
null
;
PageInfo
pageInfo
=
new
PageInfo
();
HashMap
<
String
,
Object
>
map
=
goblinMongoUtils
.
getStoreMarketList
(
page
,
purchaseName
,
status
,
st
,
et
,
ct
);
pageInfo
.
setList
((
List
)
map
.
get
(
"data"
));
pageInfo
.
setTotal
((
Long
)
map
.
get
(
"total"
));
return
ResponseDto
.
success
(
pageInfo
);
}
}
@Override
@Override
public
ResponseDto
<
Boolean
>
purchasingStatus
(
String
marketId
,
int
status
)
{
public
ResponseDto
<
Boolean
>
purchasingStatus
(
String
marketId
,
String
storeId
,
int
status
)
{
return
null
;
GoblinStoreMarketing
bean
=
GoblinStoreMarketing
.
getNew
();
LocalDateTime
now
=
LocalDateTime
.
now
();
bean
.
setUpdatedAt
(
now
);
switch
(
status
)
{
case
0
:
case
7
:
bean
.
setStatus
(
status
);
GoblinStoreMarketVo
vo
=
GoblinStoreMarketVo
.
getNew
();
vo
.
setStatus
(
status
);
goblinMongoUtils
.
updateStoreMarket
(
marketId
,
storeId
,
vo
);
vo
=
goblinRedisUtils
.
getGoblinStoreMarketVo
(
marketId
,
storeId
);
vo
.
setStatus
(
status
);
goblinRedisUtils
.
setGoblinStoreMarketVo
(
marketId
,
storeId
,
vo
);
break
;
case
-
1
:
bean
.
setStatus
(
7
);
bean
.
setDelFlag
(
1
);
goblinMongoUtils
.
delStoreMarket
(
marketId
,
storeId
);
goblinRedisUtils
.
delGoblinStoreMarketVo
(
marketId
,
storeId
);
break
;
}
//mysql todo
return
ResponseDto
.
success
();
}
}
@Override
@Override
public
ResponseDto
<
Boolean
>
purchasingInsert
(
String
purchaseName
,
String
storeId
,
String
st
,
String
et
,
Integer
isPre
,
String
preTime
)
{
public
ResponseDto
<
Boolean
>
purchasingInsert
(
String
purchaseName
,
String
storeId
,
String
st
,
String
et
,
Integer
isPre
,
String
preTime
)
{
return
null
;
String
storeMarketId
=
IDGenerator
.
nextTimeId2
();
GoblinStoreMarketing
bean
=
GoblinStoreMarketing
.
getNew
();
bean
.
setStoreMarketId
(
storeMarketId
);
bean
.
setName
(
purchaseName
);
bean
.
setType
(
2
);
bean
.
setStatus
(
0
);
bean
.
setStoreId
(
storeId
);
bean
.
setDesc
(
""
);
bean
.
setStartTime
(
LocalDateTime
.
parse
(
st
,
DTF_YMD_HMS
));
bean
.
setEndTime
(
LocalDateTime
.
parse
(
et
,
DTF_YMD_HMS
));
bean
.
setDelFlag
(
0
);
bean
.
setIsPre
(
isPre
);
if
(
isPre
==
1
)
{
bean
.
setPreTime
(
LocalDateTime
.
parse
(
preTime
,
DTF_YMD_HMS
));
}
bean
.
setCreatedAt
(
LocalDateTime
.
now
());
GoblinStoreMarketVo
vo
=
GoblinStoreMarketVo
.
getNew
();
BeanUtils
.
copyProperties
(
bean
,
vo
);
//mongo
goblinMongoUtils
.
insertStoreMarket
(
vo
);
//redis
goblinRedisUtils
.
setGoblinStoreMarketVo
(
storeMarketId
,
storeId
,
vo
);
//mysql todo
return
ResponseDto
.
success
();
}
}
@Override
@Override
public
ResponseDto
<
Boolean
>
purchasingUpdate
(
String
marketId
,
String
purchaseName
,
String
storeId
,
String
st
,
String
et
,
Integer
isPre
,
String
preTime
)
{
public
ResponseDto
<
Boolean
>
purchasingUpdate
(
String
marketId
,
String
purchaseName
,
String
storeId
,
String
st
,
String
et
,
Integer
isPre
,
String
preTime
)
{
return
null
;
GoblinStoreMarketing
bean
=
GoblinStoreMarketing
.
getNew
();
bean
.
setName
(
purchaseName
);
bean
.
setType
(
2
);
bean
.
setStatus
(
0
);
bean
.
setStoreId
(
storeId
);
bean
.
setDesc
(
""
);
bean
.
setStartTime
(
LocalDateTime
.
parse
(
st
,
DTF_YMD_HMS
));
bean
.
setEndTime
(
LocalDateTime
.
parse
(
et
,
DTF_YMD_HMS
));
bean
.
setDelFlag
(
0
);
bean
.
setIsPre
(
isPre
);
if
(
isPre
==
1
)
{
bean
.
setPreTime
(
LocalDateTime
.
parse
(
preTime
,
DTF_YMD_HMS
));
}
bean
.
setCreatedAt
(
LocalDateTime
.
now
());
GoblinStoreMarketVo
vo
=
GoblinStoreMarketVo
.
getNew
();
BeanUtils
.
copyProperties
(
bean
,
vo
);
//mongo
goblinMongoUtils
.
updateStoreMarket
(
marketId
,
storeId
,
vo
);
//redis
goblinRedisUtils
.
setGoblinStoreMarketVo
(
marketId
,
storeId
,
vo
);
//mysql todo
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
<
GoblinStoreMarketVo
>
purchasingDetails
(
String
marketId
,
String
storeId
)
{
return
ResponseDto
.
success
(
goblinRedisUtils
.
getGoblinStoreMarketVo
(
marketId
,
storeId
));
}
}
@Override
@Override
public
ResponseDto
<
GoblinPurchasingVo
>
purchasingDetails
(
String
marketId
)
{
public
ResponseDto
<
String
>
purchasingSkuList
(
String
marketId
,
String
storeId
,
int
page
)
{
return
null
;
return
null
;
}
}
@Override
@Override
public
ResponseDto
<
String
>
purchasingSkuList
(
String
marketId
,
int
page
)
{
public
ResponseDto
<
Boolean
>
purchasingSkuInsert
(
List
<
GoblinStorePurchaseItemParam
>
params
)
{
String
purchaseId
=
IDGenerator
.
nextMilliId2
();
LocalDateTime
now
=
LocalDateTime
.
now
();
for
(
GoblinStorePurchaseItemParam
item
:
params
)
{
GoblinStoreMarketPurchasing
bean
=
GoblinStoreMarketPurchasing
.
getNew
();
bean
.
setPurchaseId
(
purchaseId
);
bean
.
setStoreMarketId
(
item
.
getStoreMarketId
());
bean
.
setStoreId
(
item
.
getStoreId
());
bean
.
setSkuId
(
item
.
getSkuId
());
bean
.
setSpuId
(
item
.
getSpuId
());
bean
.
setPriceMarketing
(
item
.
getPriceMarketing
());
bean
.
setStockMarketing
(
item
.
hashCode
());
bean
.
setBuyLimit
(
item
.
getBuyLimit
());
bean
.
setBuyType
(
item
.
getBuyType
());
bean
.
setDelFlag
(
0
);
bean
.
setCreatedAt
(
now
);
//mongo
//redis
}
//mysql
return
null
;
return
null
;
}
}
@Override
@Override
public
ResponseDto
<
Boolean
>
purchasingSkuOperation
(
List
<
GoblinStorePurchaseItemParam
>
params
)
{
public
ResponseDto
<
Boolean
>
purchasingSkuUpdate
(
List
<
GoblinStorePurchaseItemParam
>
params
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
for
(
GoblinStorePurchaseItemParam
item
:
params
)
{
GoblinStoreMarketPurchasing
bean
=
GoblinStoreMarketPurchasing
.
getNew
();
// bean.setStoreMarketId(item.getStoreMarketId());
// bean.setStoreId(item.getStoreId());
// bean.setSkuId(item.getSkuId());
// bean.setSpuId(item.getSpuId());
bean
.
setPriceMarketing
(
item
.
getPriceMarketing
());
bean
.
setStockMarketing
(
item
.
hashCode
());
bean
.
setBuyLimit
(
item
.
getBuyLimit
());
bean
.
setBuyType
(
item
.
getBuyType
());
bean
.
setDelFlag
(
0
);
bean
.
setUpdatedAt
(
now
);
//mongo
//redis
}
//mysql
return
null
;
return
null
;
}
}
@Override
@Override
public
ResponseDto
<
Boolean
>
purchasingSkuDel
(
String
marketId
,
String
skuId
)
{
public
ResponseDto
<
Boolean
>
purchasingSkuDel
(
String
marketId
,
String
storeId
,
String
spuId
,
String
skuId
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
GoblinStoreMarketPurchasing
bean
=
GoblinStoreMarketPurchasing
.
getNew
();
bean
.
setUpdatedAt
(
now
);
bean
.
setDelFlag
(
1
);
//mysql
//mongo
//redis
return
null
;
return
null
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
12853a35
package
com
.
liquidnet
.
service
.
goblin
.
util
;
package
com
.
liquidnet
.
service
.
goblin
.
util
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo
;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.client.result.DeleteResult
;
import
com.mongodb.client.result.UpdateResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.convert.MongoConverter
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
@Component
@Component
public
class
GoblinMongoUtils
{
public
class
GoblinMongoUtils
{
@Autowired
@Autowired
MongoTemplate
mongoTemplate
;
MongoTemplate
mongoTemplate
;
@Autowired
MongoConverter
mongoConverter
;
/**
* 添加 商铺活动 mongo
*
* @param data
* @return
*/
public
GoblinStoreMarketVo
insertStoreMarket
(
GoblinStoreMarketVo
data
)
{
return
mongoTemplate
.
insert
(
data
,
GoblinStoreMarketVo
.
class
.
getSimpleName
());
}
/**
* 修改 商铺活动 mongo
*
* @param marketId
* @param data
* @return
*/
public
UpdateResult
updateStoreMarket
(
String
marketId
,
String
storeId
,
GoblinStoreMarketVo
data
)
{
BasicDBObject
object
=
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
data
));
return
mongoTemplate
.
getCollection
(
GoblinStoreMarketVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"storeMarketId"
).
is
(
marketId
).
and
(
"storeId"
).
is
(
storeId
)).
getQueryObject
(),
object
);
}
/**
* 获取 商铺活动 mongo
*
* @param marketId
* @param storeId
* @return
*/
public
GoblinStoreMarketVo
getStoreMarket
(
String
marketId
,
String
storeId
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"storeMarketId"
).
is
(
marketId
).
and
(
"storeId"
).
is
(
storeId
)),
GoblinStoreMarketVo
.
class
,
GoblinStoreMarketVo
.
class
.
getSimpleName
());
}
/**
* 删除 商铺活动 mongo
*
* @param marketId
* @param storeId
* @return
*/
public
DeleteResult
delStoreMarket
(
String
marketId
,
String
storeId
)
{
return
mongoTemplate
.
remove
(
Query
.
query
(
Criteria
.
where
(
"storeMarketId"
).
is
(
marketId
).
and
(
"storeId"
).
is
(
storeId
)),
GoblinStoreMarketVo
.
class
.
getSimpleName
());
}
/**
* 获取 商铺活动列表
*
* @param page
* @param purchaseName
* @param status
* @param st
* @param et
* @param ct
* @return
*/
public
HashMap
<
String
,
Object
>
getStoreMarketList
(
int
page
,
String
purchaseName
,
int
status
,
String
st
,
String
et
,
String
ct
)
{
String
nowStr
=
DateUtil
.
getNowTime
();
int
size
=
40
;
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
// 排序 分页
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
size
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdAt"
));
//条件
Criteria
criteria
=
new
Criteria
();
if
(
purchaseName
!=
null
)
{
criteria
=
criteria
.
and
(
"name"
).
regex
(
".*?\\"
+
purchaseName
);
}
if
(
st
!=
null
&&
et
!=
null
)
{
criteria
=
criteria
.
and
(
"endTime"
).
lte
(
et
).
and
(
"startTime"
).
gte
(
st
);
}
if
(
ct
!=
null
)
{
criteria
=
criteria
.
and
(
"createdAt"
).
regex
(
".*?\\"
+
ct
);
}
switch
(
status
)
{
case
0
:
criteria
=
criteria
.
and
(
"startTime"
).
gte
(
nowStr
);
break
;
case
1
:
criteria
=
criteria
.
and
(
"endTime"
).
gte
(
nowStr
).
and
(
"startTime"
).
lte
(
nowStr
);
break
;
case
2
:
criteria
=
criteria
.
and
(
"endTime"
).
lte
(
nowStr
);
break
;
case
7
:
criteria
=
criteria
.
and
(
"status"
).
lte
(
7
);
break
;
}
Query
query
=
Query
.
query
(
criteria
);
// 查询总数
long
count
=
mongoTemplate
.
count
(
query
,
GoblinStoreMarketVo
.
class
,
GoblinStoreMarketVo
.
class
.
getSimpleName
());
query
.
with
(
pageable
);
List
<
GoblinStoreMarketVo
>
voList
=
mongoTemplate
.
find
(
query
,
GoblinStoreMarketVo
.
class
,
GoblinStoreMarketVo
.
class
.
getSimpleName
());
info
.
put
(
"total"
,
count
);
info
.
put
(
"data"
,
voList
);
return
info
;
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
12853a35
package
com
.
liquidnet
.
service
.
goblin
.
util
;
package
com
.
liquidnet
.
service
.
goblin
.
util
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketingZhengzaiRelationVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketingZhengzaiRelationVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Component
@Component
public
class
GoblinRedisUtils
{
public
class
GoblinRedisUtils
{
@Autowired
@Autowired
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@Autowired
GoblinMongoUtils
goblinMongoUtils
;
/**
* 覆盖 商铺活动vo
*
* @param storeMarketId
* @param storeId
* @param vo
* @return
*/
public
boolean
setGoblinStoreMarketVo
(
String
storeMarketId
,
String
storeId
,
GoblinStoreMarketVo
vo
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_STORE_MARKET
.
concat
(
storeMarketId
).
concat
(
":store_id:"
+
storeId
);
return
redisUtil
.
set
(
redisKey
,
vo
);
}
/**
* 获取 商铺活动vo
*
* @param storeMarketId
* @param storeId
* @return
*/
public
GoblinStoreMarketVo
getGoblinStoreMarketVo
(
String
storeMarketId
,
String
storeId
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_STORE_MARKET
.
concat
(
storeMarketId
).
concat
(
":store_id:"
+
storeId
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
GoblinStoreMarketVo
vo
=
goblinMongoUtils
.
getStoreMarket
(
storeMarketId
,
storeId
);
setGoblinStoreMarketVo
(
storeMarketId
,
storeId
,
vo
);
return
vo
;
}
else
{
return
(
GoblinStoreMarketVo
)
obj
;
}
}
/**
* 删除 商铺活动vo
*
* @param storeMarketId
* @param storeId
* @return
*/
public
void
delGoblinStoreMarketVo
(
String
storeMarketId
,
String
storeId
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_STORE_MARKET
.
concat
(
storeMarketId
).
concat
(
":store_id:"
+
storeId
);
redisUtil
.
del
(
redisKey
);
}
/**
/**
* 获取 当前商铺能参与的官方活动id列表
* 获取 当前商铺能参与的官方活动id列表
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/ObjectUtil.java
View file @
12853a35
...
@@ -4,6 +4,7 @@ import com.liquidnet.service.base.PagedResult;
...
@@ -4,6 +4,7 @@ import com.liquidnet.service.base.PagedResult;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.mongodb.BasicDBObject
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -11,6 +12,11 @@ public class ObjectUtil {
...
@@ -11,6 +12,11 @@ public class ObjectUtil {
private
static
final
PagedResult
<
GoblinStoreMgtGoodsListVo
>
goblinStoreMgtGoodsVoPagedResult
=
new
PagedResult
<>();
private
static
final
PagedResult
<
GoblinStoreMgtGoodsListVo
>
goblinStoreMgtGoodsVoPagedResult
=
new
PagedResult
<>();
private
static
final
ArrayList
<
GoblinFrontBanner
>
goblinFrontBannerArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinFrontBanner
>
goblinFrontBannerArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinSelfMarketingVo
>
goblinSelfMarketingVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinSelfMarketingVo
>
goblinSelfMarketingVoArrayList
=
new
ArrayList
<>();
private
static
final
BasicDBObject
basicDBObject
=
new
BasicDBObject
();
public
static
BasicDBObject
cloneBasicDBObject
()
{
return
(
BasicDBObject
)
basicDBObject
.
clone
();
}
public
static
PagedResult
<
GoblinStoreMgtGoodsListVo
>
getGoblinStoreMgtGoodsVoPagedResult
()
{
public
static
PagedResult
<
GoblinStoreMgtGoodsListVo
>
getGoblinStoreMgtGoodsVoPagedResult
()
{
return
goblinStoreMgtGoodsVoPagedResult
.
clone
();
return
goblinStoreMgtGoodsVoPagedResult
.
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