记得上下班打卡 | 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
60fac20e
Commit
60fac20e
authored
Jan 04, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 正在下单部分接口
parent
b0b732ab
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
210 additions
and
36 deletions
+210
-36
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+0
-1
GoblinSelfZhengzaiController.java
...troller/zhengzai/goblin/GoblinSelfZhengzaiController.java
+25
-5
IGoblinZhengzaiMarketService.java
...zhengzai/goblin/service/IGoblinZhengzaiMarketService.java
+14
-3
GoblinZhengzaiMarketServiceImpl.java
.../goblin/service/impl/GoblinZhengzaiMarketServiceImpl.java
+40
-8
application-dev.yml
liquidnet-bus-config/liquidnet-config/application-dev.yml
+2
-0
application-test.yml
liquidnet-bus-config/liquidnet-config/application-test.yml
+2
-0
liquidnet-service-goblin.yml
...-bus-config/liquidnet-config/liquidnet-service-goblin.yml
+1
-0
GoblinZhengzaiController.java
...ice/goblin/controller/Inner/GoblinZhengzaiController.java
+71
-0
GoblinZhengzaiController.java
...ce/goblin/controller/manage/GoblinZhengzaiController.java
+9
-10
GoblinAppZhengzaiServiceImpl.java
...ice/goblin/service/impl/GoblinAppZhengzaiServiceImpl.java
+27
-2
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+0
-7
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+14
-0
ObjectUtil.java
...in/java/com/liquidnet/service/goblin/util/ObjectUtil.java
+5
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
60fac20e
...
...
@@ -42,7 +42,6 @@ public class GoblinRedisConst {
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:"
);
//活动-当前商铺能参与的官方活动id列表
public
static
final
String
REDIS_GOBLIN_STORE_MARKET
=
PREFIX
.
concat
(
"store:market:"
);
//商铺活动
public
static
final
String
REDIS_GOBLIN_ZHENGZAI_LIST
=
PREFIX
.
concat
(
"zhengzai:list"
);
//全部正在下单内容
public
static
final
String
REDIS_GOBLIN_STORE_MARKET_ISCONFIG
=
PREFIX
.
concat
(
"store:is_config:"
);
//商铺活动-该活动配置了款式的商品
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinSelfZhengzaiController.java
View file @
60fac20e
...
...
@@ -5,7 +5,9 @@ import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinZhengzaiMarketService
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiParam
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfZhengzaiSkuVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiStoreListVo
;
import
com.liquidnet.service.goblin.entity.GoblinSelfMarketing
;
import
io.swagger.annotations.*
;
...
...
@@ -144,16 +146,32 @@ public class GoblinSelfZhengzaiController extends BaseController {
return
goblinZhengzaiMarketService
.
zhengzaiStoreList
(
marketId
);
}
@GetMapping
(
"zhengzai/spu"
)
@ApiOperation
(
"活动详情-正在下单-店铺spu列表"
)
@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
=
"Integer"
,
name
=
"page"
,
value
=
"页数"
,
example
=
"1"
),
})
public
ResponseDto
<
List
<
GoblinMarketSpuListVo
>>
purchasingSpuList
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"page"
)
@Valid
int
page
)
{
return
goblinZhengzaiMarketService
.
zhengzaiSpuList
(
marketId
,
storeId
,
page
);
}
@GetMapping
(
"zhengzai/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
=
"页数"
,
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
=
"spuId"
,
example
=
"1"
),
})
public
ResponseDto
<
String
>
purchasingSkuList
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
)
{
return
goblinZhengzaiMarketService
.
zhengzaiSkuList
(
marketId
,
storeId
);
public
ResponseDto
<
List
<
GoblinSelfZhengzaiSkuVo
>>
purchasingSkuList
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"spuId"
)
@Valid
String
spuId
)
{
return
goblinZhengzaiMarketService
.
zhengzaiSkuList
(
marketId
,
storeId
,
spuId
);
}
@DeleteMapping
(
"zhengzai/sku"
)
...
...
@@ -161,11 +179,13 @@ public class GoblinSelfZhengzaiController extends BaseController {
@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
=
"storeId"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"skuId"
,
value
=
"skuId"
,
example
=
"1"
),
})
public
ResponseDto
<
Boolean
>
purchasingSkuDel
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"skuId"
)
@Valid
String
skuId
)
{
return
goblinZhengzaiMarketService
.
zhengzaiSkuDel
(
marketId
,
skuId
);
return
goblinZhengzaiMarketService
.
zhengzaiSkuDel
(
marketId
,
s
toreId
,
s
kuId
);
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/IGoblinZhengzaiMarketService.java
View file @
60fac20e
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfZhengzaiSkuVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiStoreListVo
;
import
com.liquidnet.service.goblin.entity.GoblinSelfMarketing
;
...
...
@@ -61,6 +63,15 @@ public interface IGoblinZhengzaiMarketService {
*/
ResponseDto
<
GoblinSelfMarketingVo
>
zhengzaiDetails
(
String
marketId
);
/**
* 获取活动内spu列表
*
* @param marketId 活动秒杀id
* @param storeId 页数
* @return
*/
ResponseDto
<
List
<
GoblinMarketSpuListVo
>>
zhengzaiSpuList
(
String
marketId
,
String
storeId
,
int
page
);
/**
* 获取活动内sku列表
*
...
...
@@ -68,16 +79,16 @@ public interface IGoblinZhengzaiMarketService {
* @param storeId 页数
* @return
*/
ResponseDto
<
String
>
zhengzaiSkuList
(
String
marketId
,
String
storeId
);
//TODO 返回值
ResponseDto
<
List
<
GoblinSelfZhengzaiSkuVo
>>
zhengzaiSkuList
(
String
marketId
,
String
storeId
,
String
spuId
);
/**
* 删除活动内sku
*
* @param marketId 活动秒杀id
* @param s
kuId sk
uId
* @param s
puId sp
uId
* @return
*/
ResponseDto
<
Boolean
>
zhengzaiSkuDel
(
String
marketId
,
String
sk
uId
);
ResponseDto
<
Boolean
>
zhengzaiSkuDel
(
String
marketId
,
String
storeId
,
String
sp
uId
);
/**
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinZhengzaiMarketServiceImpl.java
View file @
60fac20e
...
...
@@ -2,18 +2,20 @@ package com.liquidnet.client.admin.zhengzai.goblin.service.impl;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinZhengzaiMarketService
;
import
com.liquidnet.client.admin.zhengzai.goblin.utils.GoblinMongoUtils
;
import
com.liquidnet.client.admin.zhengzai.goblin.utils.GoblinRedisUtils
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.adam.dto.vo.AdamUserInfoVo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreDetailsDto
;
import
com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketingZhengzaiRelationVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiStoreListVo
;
import
com.liquidnet.service.goblin.dto.vo.*
;
/*import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiVo;*/
import
com.liquidnet.service.goblin.entity.GoblinMarketingZhengzaiRelation
;
import
com.liquidnet.service.goblin.entity.GoblinSelfMarketing
;
...
...
@@ -21,7 +23,10 @@ import com.liquidnet.service.goblin.mapper.GoblinMarketingZhengzaiRelationMapper
import
com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
...
...
@@ -35,6 +40,8 @@ import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
@Service
public
class
GoblinZhengzaiMarketServiceImpl
implements
IGoblinZhengzaiMarketService
{
@Value
(
"${liquidnet.service.adam.url}"
)
String
goblinUrl
;
@Autowired
GoblinRedisUtils
goblinRedisUtils
;
@Autowired
...
...
@@ -226,14 +233,39 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
}
@Override
public
ResponseDto
<
String
>
zhengzaiSkuList
(
String
marketId
,
String
storeId
)
{
List
<
GoblinZhengzaiStoreDetailsDto
>
dtoList
=
goblinSelfMarketingMapper
.
getZhengzaiStoreDetails
(
marketId
,
storeId
);
return
null
;
public
ResponseDto
<
List
<
GoblinMarketSpuListVo
>>
zhengzaiSpuList
(
String
marketId
,
String
storeId
,
int
page
)
{
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
params
.
add
(
"selfMarketId"
,
marketId
);
params
.
add
(
"storeId"
,
storeId
);
params
.
add
(
"page"
,
page
+
""
);
String
returnData
=
HttpUtil
.
post
(
goblinUrl
+
"/goblin/inner/config/del"
,
params
,
null
);
ResponseDto
<
List
<
GoblinMarketSpuListVo
>>
rsp
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
List
<
GoblinMarketSpuListVo
>>>()
{
});
return
rsp
;
}
@Override
public
ResponseDto
<
Boolean
>
zhengzaiSkuDel
(
String
marketId
,
String
skuId
)
{
public
ResponseDto
<
List
<
GoblinSelfZhengzaiSkuVo
>>
zhengzaiSkuList
(
String
marketId
,
String
storeId
,
String
spuId
)
{
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
params
.
add
(
"selfMarketId"
,
marketId
);
params
.
add
(
"storeId"
,
storeId
);
params
.
add
(
"spuId"
,
spuId
);
String
returnData
=
HttpUtil
.
post
(
goblinUrl
+
"/goblin/inner/config/del"
,
params
,
null
);
ResponseDto
<
List
<
GoblinSelfZhengzaiSkuVo
>>
rsp
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
List
<
GoblinSelfZhengzaiSkuVo
>>>()
{
});
return
rsp
;
}
@Override
public
ResponseDto
<
Boolean
>
zhengzaiSkuDel
(
String
marketId
,
String
storeId
,
String
spuId
)
{
//调用goblin商铺配置商铺接口
return
null
;
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
();
params
.
add
(
"selfMarketId"
,
marketId
);
params
.
add
(
"storeId"
,
storeId
);
params
.
add
(
"spuId"
,
spuId
);
String
returnData
=
HttpUtil
.
post
(
goblinUrl
+
"/goblin/inner/config/del"
,
params
,
null
);
ResponseDto
<
Boolean
>
rsp
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
Boolean
>>()
{
});
return
rsp
;
}
}
liquidnet-bus-config/liquidnet-config/application-dev.yml
View file @
60fac20e
...
...
@@ -92,6 +92,8 @@ liquidnet:
localUrl
:
http://devorder.zhengzai.tv/order/order/syncOrder
candy
:
url
:
http://devcandy.zhengzai.tv/candy
goblin
:
url
:
http://devgoblin.zhengzai.tv
stone
:
url
:
http://devstone.zhengzai.tv/stone
dragon
:
...
...
liquidnet-bus-config/liquidnet-config/application-test.yml
View file @
60fac20e
...
...
@@ -87,6 +87,8 @@ liquidnet:
url
:
http://testkylin.zhengzai.tv/kylin
candy
:
url
:
http://testcandy.zhengzai.tv/candy
goblin
:
url
:
http://testgoblin.zhengzai.tv
stone
:
url
:
http://teststone.zhengzai.tv/stone
order
:
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-goblin.yml
View file @
60fac20e
...
...
@@ -99,6 +99,7 @@ global-auth:
-
${liquidnet.info.context}/webjars/**
-
${liquidnet.info.context}/swagger-resources/**
-
${liquidnet.info.context}/v2/api-docs*
-
${liquidnet.info.context}/inner/*
oncheck-url-pattern
:
-
# -----------------------------------------------------------
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/Inner/GoblinZhengzaiController.java
0 → 100644
View file @
60fac20e
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
Inner
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfZhengzaiSkuVo
;
import
com.liquidnet.service.goblin.service.manage.IGoblinZhengzaiService
;
import
io.swagger.annotations.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.List
;
/**
* 正在下单活动管理
*/
@Slf4j
@RestController
@Api
(
tags
=
"活动-内部接口调用"
)
@RequestMapping
(
"inner"
)
public
class
GoblinZhengzaiController
{
@Autowired
IGoblinZhengzaiService
goblinZhengzaiService
;
@PostMapping
(
"config/del/noAuth"
)
@ApiOperation
(
"活动详情-正在下单-删除商铺spu"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"商铺id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"selfMarketId"
,
value
=
"官方活动id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
,
example
=
"1"
),
})
public
ResponseDto
<
Boolean
>
zhengzaiStoreDelNoAuth
(
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"selfMarketId"
)
@Valid
String
selfMarketId
,
@RequestParam
(
"spuId"
)
@Valid
String
spuId
)
{
return
goblinZhengzaiService
.
zhengzaiSpuDel
(
selfMarketId
,
storeId
,
spuId
);
}
@GetMapping
(
"config/spu"
)
@ApiOperation
(
"活动详情-正在下单-获取商铺spu"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"商铺id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"selfMarketId"
,
value
=
"官方活动id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"page"
,
value
=
"页数"
,
example
=
"1"
)
})
public
ResponseDto
<
List
<
GoblinMarketSpuListVo
>>
zhengzaiStoreConfigSpuList
(
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"selfMarketId"
)
@Valid
String
selfMarketId
,
@RequestParam
(
"page"
)
@Valid
int
page
)
{
return
goblinZhengzaiService
.
zhengzaiSpuList
(
selfMarketId
,
storeId
,
page
);
}
@GetMapping
(
"config/sku"
)
@ApiOperation
(
"活动详情-正在下单-获取商铺sku"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"商铺id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"selfMarketId"
,
value
=
"官方活动id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
,
example
=
"1"
)
})
public
ResponseDto
<
List
<
GoblinSelfZhengzaiSkuVo
>>
zhengzaiStoreConfigSkuList
(
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"spuId"
)
@Valid
String
spuId
,
@RequestParam
(
"selfMarketId"
)
@Valid
String
selfMarketId
)
{
return
goblinZhengzaiService
.
zhengzaiSkuList
(
selfMarketId
,
storeId
,
spuId
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinZhengzaiController.java
View file @
60fac20e
...
...
@@ -28,7 +28,7 @@ public class GoblinZhengzaiController {
@Autowired
IGoblinZhengzaiService
goblinZhengzaiService
;
@GetMapping
(
"
zhengzai/
list"
)
@GetMapping
(
"list"
)
@ApiOperation
(
"活动详情-正在下单-可参与活动列表"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
...
...
@@ -38,7 +38,7 @@ public class GoblinZhengzaiController {
return
ResponseDto
.
success
(
goblinZhengzaiService
.
zhengzaiCanJoin
(
storeId
));
}
@GetMapping
(
"
zhengzai/
detals"
)
@GetMapping
(
"detals"
)
@ApiOperation
(
"活动详情-正在下单-可参与活动详情"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
...
...
@@ -50,7 +50,7 @@ public class GoblinZhengzaiController {
return
ResponseDto
.
success
(
goblinZhengzaiService
.
zhengzaiCanJoinDetails
(
selfMarketId
,
storeId
));
}
@GetMapping
(
"
zhengzai/
config/spu"
)
@GetMapping
(
"config/spu"
)
@ApiOperation
(
"活动详情-正在下单-获取商铺spu"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
...
...
@@ -64,7 +64,7 @@ public class GoblinZhengzaiController {
return
goblinZhengzaiService
.
zhengzaiSpuList
(
selfMarketId
,
storeId
,
page
);
}
@GetMapping
(
"
zhengzai/
config/sku"
)
@GetMapping
(
"config/sku"
)
@ApiOperation
(
"活动详情-正在下单-获取商铺sku"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
...
...
@@ -78,7 +78,7 @@ public class GoblinZhengzaiController {
return
goblinZhengzaiService
.
zhengzaiSkuList
(
selfMarketId
,
storeId
,
spuId
);
}
@PostMapping
(
"
zhengzai/
config/insert"
)
@PostMapping
(
"config/insert"
)
@ApiOperation
(
"活动详情-正在下单-配置商铺sku"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
Boolean
>
zhengzaiStoreInsert
(
@RequestBody
GoblinStoreZhengzaiCommonParam
params
)
{
...
...
@@ -86,15 +86,15 @@ public class GoblinZhengzaiController {
return
goblinZhengzaiService
.
zhengzaiSkuInsert
(
params
);
}
@PostMapping
(
"
zhengzai/
config/update"
)
@PostMapping
(
"config/update"
)
@ApiOperation
(
"活动详情-正在下单-配置商铺sku"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
Boolean
>
zhengzaiStoreUpdate
(
@RequestBody
GoblinStoreZhengzaiCommonParam
params
)
{
return
goblinZhengzaiService
.
zhengzaiSkuUpdate
(
params
);
}
@
DeleteMapping
(
"zhengzai/
config/del"
)
@ApiOperation
(
"活动详情-正在下单-删除商铺s
k
u"
)
@
PostMapping
(
"
config/del"
)
@ApiOperation
(
"活动详情-正在下单-删除商铺s
p
u"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"商铺id"
,
example
=
"1"
),
...
...
@@ -104,7 +104,6 @@ public class GoblinZhengzaiController {
public
ResponseDto
<
Boolean
>
zhengzaiStoreDel
(
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"selfMarketId"
)
@Valid
String
selfMarketId
,
@RequestParam
(
"spuId"
)
@Valid
String
spuId
)
{
return
goblinZhengzaiService
.
zhengzaiSpuDel
(
selfMarketId
,
storeId
,
spuId
);
return
goblinZhengzaiService
.
zhengzaiSpuDel
(
selfMarketId
,
storeId
,
spuId
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinAppZhengzaiServiceImpl.java
View file @
60fac20e
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMarketRelationVo
;
...
...
@@ -9,13 +12,18 @@ import com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo;
import
com.liquidnet.service.goblin.service.IGoblinAppZhengzaiService
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.ObjectUtil
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
@Service
public
class
GoblinAppZhengzaiServiceImpl
implements
IGoblinAppZhengzaiService
{
...
...
@@ -29,13 +37,30 @@ public class GoblinAppZhengzaiServiceImpl implements IGoblinAppZhengzaiService {
@Override
public
List
<
GoblinSelfMarketingVo
>
getZhengzaiMarketList
()
{
return
mongoUtils
.
getGoblinSelfMarketingVoList
();
List
<
GoblinSelfMarketingVo
>
list
=
redisUtils
.
getGoblinSelfMarketingVoList
();
List
<
GoblinSelfMarketingVo
>
voList
=
ObjectUtil
.
getGoblinSelfMarketingVoList
();
LocalDateTime
now
=
LocalDateTime
.
now
();
for
(
GoblinSelfMarketingVo
item
:
list
)
{
if
(
LocalDateTime
.
parse
(
item
.
getStartTime
(),
DTF_YMD_HMS
).
isBefore
(
now
)
&&
LocalDateTime
.
parse
(
item
.
getEndTime
(),
DTF_YMD_HMS
).
isAfter
(
now
))
{
voList
.
add
(
item
);
}
}
return
voList
;
}
@Override
public
List
<
GoblinShowStoreInfoVo
>
getStoreList
(
String
marketId
)
{
List
<
GoblinMarketRelationVo
>
relationVo
=
redisUtils
.
getMarketRelation
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
marketId
);
List
<
String
>
storeIdList
=
relationVo
.
stream
().
map
(
GoblinMarketRelationVo:
:
getStoreId
).
collect
(
Collectors
.
toList
());
return
mongoUtils
.
getGoblinStoreVoList
(
storeIdList
);
List
<
GoblinShowStoreInfoVo
>
voList
=
ObjectUtil
.
getGoblinShowStoreInfoVoArrayList
();
for
(
String
storeId
:
storeIdList
)
{
GoblinStoreInfoVo
vo
=
redisUtils
.
getStoreInfoVo
(
storeId
);
if
(
vo
.
getStatus
().
equals
(
"5"
))
{
GoblinShowStoreInfoVo
returnVo
=
GoblinShowStoreInfoVo
.
getNew
();
BeanUtils
.
copyProperties
(
vo
,
returnVo
);
voList
.
add
(
returnVo
);
}
}
return
voList
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
60fac20e
...
...
@@ -304,11 +304,4 @@ public class GoblinMongoUtils {
List
<
GoblinSelfMarketingVo
>
voList
=
mongoTemplate
.
find
(
Query
.
query
(
Criteria
.
where
(
"type"
).
is
(
2
).
and
(
"status"
).
ne
(
7
).
and
(
"endTime"
).
gte
(
nowStr
).
and
(
"startTime"
).
lte
(
nowStr
)),
GoblinSelfMarketingVo
.
class
,
GoblinSelfMarketingVo
.
class
.
getSimpleName
());
return
voList
;
}
//获取 参加正在下单的商品列表
public
List
<
GoblinShowStoreInfoVo
>
getGoblinStoreVoList
(
List
<
String
>
storeIdList
)
{
//todo 没redis
List
<
GoblinShowStoreInfoVo
>
voList
=
mongoTemplate
.
find
(
Query
.
query
(
Criteria
.
where
(
"storeId"
).
in
(
storeIdList
).
and
(
"status"
).
is
(
5
)),
GoblinShowStoreInfoVo
.
class
,
GoblinStoreInfoVo
.
class
.
getSimpleName
());
return
voList
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
60fac20e
package
com
.
liquidnet
.
service
.
goblin
.
util
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
...
...
@@ -321,4 +324,15 @@ public class GoblinRedisUtils {
return
(
GoblinSelfMarketingVo
)
obj
;
}
}
//获取全部正在下单的活动
public
List
<
GoblinSelfMarketingVo
>
getGoblinSelfMarketingVoList
()
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_ZHENGZAI_LIST
;
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
return
goblinMongoUtils
.
getGoblinSelfMarketingVoList
();
}
else
{
return
(
List
<
GoblinSelfMarketingVo
>)
obj
;
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/ObjectUtil.java
View file @
60fac20e
...
...
@@ -27,6 +27,7 @@ public class ObjectUtil {
private
static
final
ArrayList
<
GoblinMarketSpuListVo
>
goblinMarketSpuListVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinStorePurchaseSkuVo
>
goblinStorePurchaseSkuVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinSelfZhengzaiSkuVo
>
goblinSelfZhengzaiSkuVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinShowStoreInfoVo
>
goblinShowStoreInfoVoArrayList
=
new
ArrayList
<>();
private
static
final
BasicDBObject
basicDBObject
=
new
BasicDBObject
();
...
...
@@ -34,6 +35,10 @@ public class ObjectUtil {
return
goblinStoreMgtGoodsVoPagedResult
.
clone
();
}
public
static
ArrayList
<
GoblinShowStoreInfoVo
>
getGoblinShowStoreInfoVoArrayList
()
{
return
(
ArrayList
<
GoblinShowStoreInfoVo
>)
goblinShowStoreInfoVoArrayList
.
clone
();
}
public
static
ArrayList
<
GoblinGoodsInfoVo
>
goblinGoodsInfoVoArrayList
()
{
return
(
ArrayList
<
GoblinGoodsInfoVo
>)
goblinGoodsInfoVoArrayList
.
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