记得上下班打卡 | 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
eff176f8
Commit
eff176f8
authored
Nov 02, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加 带分页的商铺正在下单商品
parent
d08e320e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
0 deletions
+75
-0
IGoblinStoreZhengzaiService.java
...t/service/goblin/service/IGoblinStoreZhengzaiService.java
+2
-0
GoblinStoreZhengzaiController.java
...vice/goblin/controller/GoblinStoreZhengzaiController.java
+14
-0
GoblinStoreZhengzaiServiceImpl.java
...e/goblin/service/impl/GoblinStoreZhengzaiServiceImpl.java
+33
-0
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+26
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinStoreZhengzaiService.java
View file @
eff176f8
...
...
@@ -24,6 +24,8 @@ public interface IGoblinStoreZhengzaiService {
*/
ResponseDto
<
List
<
GoblinZhengzaiGoodVo
>>
getSpuList
(
String
marketId
,
String
keyword
);
ResponseDto
<
List
<
GoblinZhengzaiGoodVo
>>
getSpuList2
(
String
marketId
,
String
keyword
,
Integer
page
);
ResponseDto
<
List
<
GoblinAppOrderListVo
>>
orderList
(
int
page
);
ResponseDto
<
Boolean
>
orderPush
(
String
orderMasterCode
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinStoreZhengzaiController.java
View file @
eff176f8
...
...
@@ -45,6 +45,20 @@ public class GoblinStoreZhengzaiController {
return
goblinStoreZhengzaiService
.
getSpuList
(
marketId
,
keyword
);
}
@GetMapping
(
"spu/list2"
)
@ApiOperation
(
"正在下单-参与活动的spu"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integet"
,
name
=
"page"
,
value
=
"页数"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"kw"
,
value
=
"搜索内容【1~64位】,支持`SPU名称`、`SKU名称`、`SKU编码`"
,
example
=
""
),
})
public
ResponseDto
<
List
<
GoblinZhengzaiGoodVo
>>
getStoreList2
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"page"
)
@Valid
Integer
page
,
@RequestParam
(
value
=
"kw"
,
required
=
false
)
@Size
(
min
=
1
,
max
=
64
,
message
=
"搜索内容长度超出范围1~64位"
)
String
keyword
)
{
return
goblinStoreZhengzaiService
.
getSpuList2
(
marketId
,
keyword
,
page
);
}
@PostMapping
(
"list"
)
@ApiOperation
(
"订单列表[商铺]"
)
@ApiImplicitParams
({
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinStoreZhengzaiServiceImpl.java
View file @
eff176f8
...
...
@@ -105,6 +105,39 @@ public class GoblinStoreZhengzaiServiceImpl implements IGoblinStoreZhengzaiServi
return
ResponseDto
.
success
(
voList
);
}
@Override
public
ResponseDto
<
List
<
GoblinZhengzaiGoodVo
>>
getSpuList2
(
String
marketId
,
String
keyword
,
Integer
page
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinStoreInfoVo
storeInfoVo
=
redisUtils
.
getStoreInfoVoByUid
(
uid
);
if
(
storeInfoVo
==
null
)
{
return
ResponseDto
.
failure
(
"店铺不存在"
);
}
GoblinSelfMarketingVo
marketingVo
=
redisUtils
.
getSelfMarket
(
marketId
);
if
(
marketingVo
.
getStatus
()!=
null
&&
marketingVo
.
getStatus
()
==
7
)
{
return
ResponseDto
.
failure
(
"活动已停用"
);
}
//todo
String
storeId
=
storeInfoVo
.
getStoreId
();
GoblinMarketingZhengzaiRelationVo
marketingZhengzaiRelationVo
=
redisUtils
.
getZhengzaiRelation
(
marketId
,
storeId
);
if
(
marketingZhengzaiRelationVo
==
null
)
{
return
ResponseDto
.
failure
(
"未参加活动"
);
}
// 支持搜索SPU
List
<
String
>
hitSpuIdList
=
mongoUtils
.
getMarketSpuData
(
marketId
,
page
,
keyword
,
storeId
);
List
<
GoblinZhengzaiGoodVo
>
voList
=
ObjectUtil
.
getGoblinZhengzaiGoodVoArrayList
();
for
(
String
spuId
:
hitSpuIdList
)
{
GoblinGoodsInfoVo
vo
=
hitSpuIdList
.
contains
(
spuId
)
?
redisUtils
.
getGoodsInfoVo
(
spuId
)
:
null
;
if
(
null
!=
vo
&&
vo
.
getShelvesStatus
().
equals
(
"3"
))
{
GoblinZhengzaiGoodVo
returnVo
=
GoblinZhengzaiGoodVo
.
getNew
();
BeanUtils
.
copyProperties
(
vo
,
returnVo
);
voList
.
add
(
returnVo
);
}
}
return
ResponseDto
.
success
(
voList
);
}
@Override
public
ResponseDto
<
List
<
GoblinAppOrderListVo
>>
orderList
(
int
page
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
eff176f8
...
...
@@ -627,6 +627,32 @@ public class GoblinMongoUtils {
return
CollectionUtils
.
isEmpty
(
goodsListVos
)
?
CollectionUtil
.
arrayListString
()
:
goodsListVos
.
stream
().
map
(
GoblinStoreMgtGoodsListVo:
:
getSpuId
).
distinct
().
collect
(
Collectors
.
toList
());
}
/**
* 在指定SPU商品中模糊搜索,并返回符合条件的SPUID
*
* @param marketId 活动id
* @param keyword 搜索内容
* @param page 页数
* @return List<String>
*/
public
List
<
String
>
getMarketSpuData
(
String
marketId
,
int
page
,
String
keyword
,
String
storeId
){
int
pageSize
=
20
;
Criteria
criteria
=
Criteria
.
where
(
"delFlg"
).
is
(
"0"
)
.
and
(
"storeId"
).
is
(
storeId
)
.
and
(
"marketId"
).
is
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
().
concat
(
marketId
));
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
keyword
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
criteria
.
orOperator
(
Criteria
.
where
(
"name"
).
regex
(
pattern
)
);
}
Query
query
=
Query
.
query
(
criteria
);
query
.
with
(
PageRequest
.
of
(
page
-
1
,
pageSize
));
query
.
fields
().
include
(
"spuId"
);
List
<
GoblinStoreMgtGoodsListVo
>
goodsListVos
=
mongoTemplate
.
find
(
query
,
GoblinStoreMgtGoodsListVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
return
CollectionUtils
.
isEmpty
(
goodsListVos
)
?
CollectionUtil
.
arrayListString
()
:
goodsListVos
.
stream
().
map
(
GoblinStoreMgtGoodsListVo:
:
getSpuId
).
distinct
().
collect
(
Collectors
.
toList
());
}
public
List
<
String
>
getMgtSpuNosForMarketBySpuNos
(
List
<
String
>
spuNos
,
Object
...
shelvesStatus
)
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"spuNo"
).
in
(
spuNos
.
toArray
())
.
and
(
"marketId"
).
exists
(
true
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
in
(
shelvesStatus
));
...
...
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