Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
Details
Activity
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
external
on-site-service
Commits
c855ab08
Commit
c855ab08
authored
Aug 10, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 服务搜索接口
parent
c5e440c3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
ServiceCategoryController.java
...iniapp/controller/category/ServiceCategoryController.java
+1
-1
HomeCommonService.java
...teservice/miniapp/service/category/HomeCommonService.java
+1
-1
ServiceCategoryService.java
...vice/miniapp/service/category/ServiceCategoryService.java
+7
-4
No files found.
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/ServiceCategoryController.java
View file @
c855ab08
...
@@ -40,7 +40,7 @@ public class ServiceCategoryController {
...
@@ -40,7 +40,7 @@ public class ServiceCategoryController {
@ApiOperation
(
value
=
"服务列表"
)
@ApiOperation
(
value
=
"服务列表"
)
@GetMapping
(
"list"
)
@GetMapping
(
"list"
)
public
Result
<
List
<
ServiceCategoryVO
>>
list
()
{
public
Result
<
List
<
ServiceCategoryVO
>>
list
()
{
return
serviceCategoryService
.
list
(
null
);
return
serviceCategoryService
.
list
(
null
,
true
);
}
}
@ApiOperation
(
value
=
"根据key查询子类"
)
@ApiOperation
(
value
=
"根据key查询子类"
)
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/category/HomeCommonService.java
View file @
c855ab08
...
@@ -78,7 +78,7 @@ public class HomeCommonService {
...
@@ -78,7 +78,7 @@ public class HomeCommonService {
.
map
(
e
->
AttrCopyUtils
.
copy
(
e
,
new
HomeNoticeVO
())).
collect
(
Collectors
.
toList
());
.
map
(
e
->
AttrCopyUtils
.
copy
(
e
,
new
HomeNoticeVO
())).
collect
(
Collectors
.
toList
());
// 服务
// 服务
Result
<
List
<
ServiceCategoryVO
>>
serviceResult
=
serviceCategoryService
.
list
(
null
);
Result
<
List
<
ServiceCategoryVO
>>
serviceResult
=
serviceCategoryService
.
list
(
null
,
false
);
// 首页底部图片
// 首页底部图片
String
bottomImage
=
sysParamMapper
.
selectOne
(
SysParam
.
builder
().
code
(
SysParamConstants
.
HOME_BOTTOM_IMAGE
).
build
()).
getValue
();
String
bottomImage
=
sysParamMapper
.
selectOne
(
SysParam
.
builder
().
code
(
SysParamConstants
.
HOME_BOTTOM_IMAGE
).
build
()).
getValue
();
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/category/ServiceCategoryService.java
View file @
c855ab08
...
@@ -30,13 +30,16 @@ public class ServiceCategoryService extends AbstractMapper<ServiceCategory> {
...
@@ -30,13 +30,16 @@ public class ServiceCategoryService extends AbstractMapper<ServiceCategory> {
private
ServiceSubclassMapper
serviceSubclassMapper
;
private
ServiceSubclassMapper
serviceSubclassMapper
;
public
Result
<
List
<
ServiceCategoryVO
>>
list
(
String
keyWord
)
{
public
Result
<
List
<
ServiceCategoryVO
>>
list
(
String
keyWord
,
Boolean
search
)
{
List
<
ServiceCategory
>
serviceCategoryList
=
serviceCategoryMapper
.
selectAllOrderBySequence
();
List
<
ServiceCategory
>
serviceCategoryList
=
serviceCategoryMapper
.
selectAllOrderBySequence
();
var
condition
=
new
Condition
(
ServiceSubclass
.
class
);
var
condition
=
new
Condition
(
ServiceSubclass
.
class
);
condition
.
createCriteria
().
andLike
(
"serviceName"
,
keyWord
)
var
criteria
=
condition
.
createCriteria
();
.
andEqualTo
(
"enabled"
,
true
)
criteria
.
andLike
(
"serviceName"
,
keyWord
)
.
andEqualTo
(
"showInHome"
,
true
);
.
andEqualTo
(
"enabled"
,
true
);
if
(!
search
)
{
criteria
.
andEqualTo
(
"showInHome"
,
true
);
}
List
<
ServiceSubclass
>
serviceSubclassList
=
serviceSubclassMapper
.
selectByCondition
(
condition
);
List
<
ServiceSubclass
>
serviceSubclassList
=
serviceSubclassMapper
.
selectByCondition
(
condition
);
Map
<
Integer
,
List
<
ServiceSubclass
>>
categoryIdServiceSubclassMap
=
serviceSubclassList
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
ServiceSubclass:
:
getCategoryId
));
Map
<
Integer
,
List
<
ServiceSubclass
>>
categoryIdServiceSubclassMap
=
serviceSubclassList
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
ServiceSubclass:
:
getCategoryId
));
...
...
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