记得上下班打卡 | 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
9a9cbd37
Commit
9a9cbd37
authored
Jan 18, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug、支持商铺模糊搜索
parent
f625bba0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+2
-2
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+9
-4
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
9a9cbd37
...
@@ -112,8 +112,8 @@ public class GoblinFrontController {
...
@@ -112,8 +112,8 @@ public class GoblinFrontController {
}
}
@GetMapping
(
"getStoreGoodes"
)
@GetMapping
(
"getStoreGoodes"
)
@ApiOperation
(
"获得店铺商品"
)
@ApiOperation
(
"获得店铺商品"
)
public
ResponseDto
<
List
<
GoblinGoodsInfoVo
>>
getStoreGoodes
(
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"categoryId"
,
required
=
true
)
String
categoryId
)
throws
ParseException
{
public
ResponseDto
<
List
<
GoblinGoodsInfoVo
>>
getStoreGoodes
(
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"categoryId"
,
required
=
true
)
String
categoryId
,
@RequestParam
(
name
=
"name"
,
required
=
true
)
String
name
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getStoreGoodes
(
storeId
,
categoryId
));
return
ResponseDto
.
success
(
goblinFrontService
.
getStoreGoodes
(
storeId
,
categoryId
,
name
));
}
}
@GetMapping
(
"searchGoodesName"
)
@GetMapping
(
"searchGoodesName"
)
@ApiOperation
(
"搜索商品名字"
)
@ApiOperation
(
"搜索商品名字"
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
9a9cbd37
...
@@ -30,6 +30,7 @@ import java.text.ParseException;
...
@@ -30,6 +30,7 @@ import java.text.ParseException;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.regex.Pattern
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -353,17 +354,21 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -353,17 +354,21 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public
List
<
GoblinGoodsInfoVo
>
searchGoodesName
(
String
name
){
public
List
<
GoblinGoodsInfoVo
>
searchGoodesName
(
String
name
){
return
null
;
return
null
;
}
}
public
List
<
GoblinGoodsInfoVo
>
getStoreGoodes
(
String
storeId
,
String
categoryId
){
public
List
<
GoblinGoodsInfoVo
>
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
){
//
//
Query
query
=
new
Query
();
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
));
query
.
addCriteria
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
));
if
(
StringUtil
.
isNotBlank
(
categoryId
)){
if
(
StringUtil
.
isNotBlank
(
categoryId
)){
query
.
addCriteria
(
new
Criteria
().
orOperator
(
query
.
addCriteria
(
new
Criteria
().
orOperator
(
Criteria
.
where
(
"
c
ateFid"
).
is
(
categoryId
),
Criteria
.
where
(
"
storeC
ateFid"
).
is
(
categoryId
),
Criteria
.
where
(
"
c
ateSid"
).
is
(
categoryId
),
Criteria
.
where
(
"
storeC
ateSid"
).
is
(
categoryId
),
Criteria
.
where
(
"
c
ateTid"
).
is
(
categoryId
)
Criteria
.
where
(
"
storeC
ateTid"
).
is
(
categoryId
)
));
));
}
}
if
(
StringUtil
.
isNotBlank
(
name
)){
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
name
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
query
.
addCriteria
(
Criteria
.
where
(
"name"
).
regex
(
pattern
));
}
// 查询总数
// 查询总数
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
if
(
list
.
size
()>
0
){
if
(
list
.
size
()>
0
){
...
...
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