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
a24e44db
Commit
a24e44db
authored
Jul 15, 2022
by
lining
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 服务类型接口
parent
f84d97f9
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
108 additions
and
114 deletions
+108
-114
ServiceCategoryMapper.java
...siteservice/dao/mapper/service/ServiceCategoryMapper.java
+5
-0
ServiceSubclassMapper.java
...siteservice/dao/mapper/service/ServiceSubclassMapper.java
+5
-0
ServiceCategoryMapper.xml
...c/main/resources/mapper/service/ServiceCategoryMapper.xml
+18
-13
ServiceOrderMapper.xml
dao/src/main/resources/mapper/service/ServiceOrderMapper.xml
+1
-1
ServiceSubclassMapper.xml
...c/main/resources/mapper/service/ServiceSubclassMapper.xml
+24
-14
ServiceCategoryController.java
...iniapp/controller/category/ServiceCategoryController.java
+11
-6
ServiceSubclassController.java
...iniapp/controller/category/ServiceSubclassController.java
+2
-14
PageServiceSubclassDTO.java
...niapp/controller/category/dto/PageServiceSubclassDTO.java
+5
-0
ServiceCategoryVO.java
...ice/miniapp/controller/category/vo/ServiceCategoryVO.java
+2
-26
ServiceSubclassVO.java
...ice/miniapp/controller/category/vo/ServiceSubclassVO.java
+0
-23
ServiceCategoryService.java
...vice/miniapp/service/category/ServiceCategoryService.java
+33
-6
ServiceSubclassService.java
...vice/miniapp/service/category/ServiceSubclassService.java
+2
-11
No files found.
dao/src/main/java/com/onsiteservice/dao/mapper/service/ServiceCategoryMapper.java
View file @
a24e44db
...
@@ -3,5 +3,10 @@ package com.onsiteservice.dao.mapper.service;
...
@@ -3,5 +3,10 @@ package com.onsiteservice.dao.mapper.service;
import
com.onsiteservice.dao.common.Mapper
;
import
com.onsiteservice.dao.common.Mapper
;
import
com.onsiteservice.entity.category.ServiceCategory
;
import
com.onsiteservice.entity.category.ServiceCategory
;
import
java.util.List
;
public
interface
ServiceCategoryMapper
extends
Mapper
<
ServiceCategory
>
{
public
interface
ServiceCategoryMapper
extends
Mapper
<
ServiceCategory
>
{
List
<
ServiceCategory
>
selectAllOrderBySequence
();
}
}
\ No newline at end of file
dao/src/main/java/com/onsiteservice/dao/mapper/service/ServiceSubclassMapper.java
View file @
a24e44db
...
@@ -3,5 +3,10 @@ package com.onsiteservice.dao.mapper.service;
...
@@ -3,5 +3,10 @@ package com.onsiteservice.dao.mapper.service;
import
com.onsiteservice.dao.common.Mapper
;
import
com.onsiteservice.dao.common.Mapper
;
import
com.onsiteservice.entity.category.ServiceSubclass
;
import
com.onsiteservice.entity.category.ServiceSubclass
;
import
java.util.List
;
public
interface
ServiceSubclassMapper
extends
Mapper
<
ServiceSubclass
>
{
public
interface
ServiceSubclassMapper
extends
Mapper
<
ServiceSubclass
>
{
List
<
ServiceSubclass
>
selectByServiceNameLike
(
String
keyWord
);
}
}
\ No newline at end of file
dao/src/main/resources/mapper/service/ServiceCategoryMapper.xml
View file @
a24e44db
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.onsiteservice.dao.mapper.service.ServiceCategoryMapper"
>
<mapper
namespace=
"com.onsiteservice.dao.mapper.service.ServiceCategoryMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.onsiteservice.entity.category.ServiceCategory"
>
<resultMap
id=
"BaseResultMap"
type=
"com.onsiteservice.entity.category.ServiceCategory"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"service_name"
jdbcType=
"VARCHAR"
property=
"serviceName"
/>
<result
column=
"service_name"
jdbcType=
"VARCHAR"
property=
"serviceName"
/>
<result
column=
"sequence"
jdbcType=
"INTEGER"
property=
"sequence"
/>
<result
column=
"sequence"
jdbcType=
"INTEGER"
property=
"sequence"
/>
<result
column=
"img"
jdbcType=
"VARCHAR"
property=
"img"
/>
<result
column=
"img"
jdbcType=
"VARCHAR"
property=
"img"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"modify_by"
jdbcType=
"VARCHAR"
property=
"modifyBy"
/>
<result
column=
"modify_by"
jdbcType=
"VARCHAR"
property=
"modifyBy"
/>
<result
column=
"modify_time"
jdbcType=
"TIMESTAMP"
property=
"modifyTime"
/>
<result
column=
"modify_time"
jdbcType=
"TIMESTAMP"
property=
"modifyTime"
/>
</resultMap>
</resultMap>
<select
id=
"selectAllOrderBySequence"
resultType=
"com.onsiteservice.entity.category.ServiceCategory"
>
select * from service_category order by sequence asc
</select>
</mapper>
</mapper>
\ No newline at end of file
dao/src/main/resources/mapper/service/ServiceOrderMapper.xml
View file @
a24e44db
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
<mapper
namespace=
"com.onsiteservice.dao.mapper.service.ServiceOrderMapper"
>
<mapper
namespace=
"com.onsiteservice.dao.mapper.service.ServiceOrderMapper"
>
<select
id=
"selectServiceOrderPage"
resultType=
"com.onsiteservice.entity.order.ServiceOrder"
>
<select
id=
"selectServiceOrderPage"
resultType=
"com.onsiteservice.entity.order.ServiceOrder"
>
<bind
name=
"p1"
value=
"'%' + keyWord + '%'"
/>
select *
select *
from service_order
from service_order
where
where
...
@@ -15,6 +14,7 @@
...
@@ -15,6 +14,7 @@
and date_format(create_time,'%Y%m') = #{month}
and date_format(create_time,'%Y%m') = #{month}
</if>
</if>
<if
test=
"keyWord != null and keyWord != ''"
>
<if
test=
"keyWord != null and keyWord != ''"
>
<bind
name=
"p1"
value=
"'%' + keyWord + '%'"
/>
and (service_name like #{p1} or address like #{p1} or name like #{p1})
and (service_name like #{p1} or address like #{p1} or name like #{p1})
</if>
</if>
order by create_time asc
order by create_time asc
...
...
dao/src/main/resources/mapper/service/ServiceSubclassMapper.xml
View file @
a24e44db
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.onsiteservice.dao.mapper.service.ServiceSubclassMapper"
>
<mapper
namespace=
"com.onsiteservice.dao.mapper.service.ServiceSubclassMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.onsiteservice.entity.category.ServiceSubclass"
>
<resultMap
id=
"BaseResultMap"
type=
"com.onsiteservice.entity.category.ServiceSubclass"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"category_id"
jdbcType=
"INTEGER"
property=
"categoryId"
/>
<result
column=
"category_id"
jdbcType=
"INTEGER"
property=
"categoryId"
/>
<result
column=
"service_name"
jdbcType=
"VARCHAR"
property=
"serviceName"
/>
<result
column=
"service_name"
jdbcType=
"VARCHAR"
property=
"serviceName"
/>
<result
column=
"sequence"
jdbcType=
"INTEGER"
property=
"sequence"
/>
<result
column=
"sequence"
jdbcType=
"INTEGER"
property=
"sequence"
/>
<result
column=
"img"
jdbcType=
"VARCHAR"
property=
"img"
/>
<result
column=
"img"
jdbcType=
"VARCHAR"
property=
"img"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"modify_by"
jdbcType=
"VARCHAR"
property=
"modifyBy"
/>
<result
column=
"modify_by"
jdbcType=
"VARCHAR"
property=
"modifyBy"
/>
<result
column=
"modify_time"
jdbcType=
"TIMESTAMP"
property=
"modifyTime"
/>
<result
column=
"modify_time"
jdbcType=
"TIMESTAMP"
property=
"modifyTime"
/>
</resultMap>
</resultMap>
<select
id=
"selectByServiceNameLike"
resultType=
"com.onsiteservice.entity.category.ServiceSubclass"
>
select * from service_subclass
<if
test=
"keyWord != null and keyWord != ''"
>
<bind
name=
"p1"
value=
"'%' + keyWord + '%'"
/>
where service_name like #{p1}
</if>
order by sequence asc
</select>
</mapper>
</mapper>
\ No newline at end of file
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/ServiceCategoryController.java
View file @
a24e44db
...
@@ -10,14 +10,13 @@ import io.swagger.annotations.Api;
...
@@ -10,14 +10,13 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.NonNull
;
import
lombok.NonNull
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
static
com
.
onsiteservice
.
core
.
result
.
ResultGenerator
.
success
;
import
static
com
.
onsiteservice
.
core
.
result
.
ResultGenerator
.
success
;
/**
/**
...
@@ -37,11 +36,17 @@ public class ServiceCategoryController {
...
@@ -37,11 +36,17 @@ public class ServiceCategoryController {
private
ServiceCategoryService
serviceCategoryService
;
private
ServiceCategoryService
serviceCategoryService
;
@ApiOperation
(
value
=
"分页查询服务大类"
)
@ApiOperation
(
value
=
"查询服务大类"
)
@GetMapping
(
"list"
)
public
Result
<
List
<
ServiceCategoryVO
>>
list
(
@RequestParam
(
required
=
false
)
String
keyWord
)
{
return
serviceCategoryService
.
list
(
keyWord
);
}
/*@ApiOperation(value = "分页查询服务大类")
@PostMapping("page")
@PostMapping("page")
public Result<PageInfoVO<ServiceCategoryVO>> getPage(@RequestBody @NonNull @Validated PageServiceCategoryDTO dto) {
public Result<PageInfoVO<ServiceCategoryVO>> getPage(@RequestBody @NonNull @Validated PageServiceCategoryDTO dto) {
return serviceCategoryService.getPage(dto);
return serviceCategoryService.getPage(dto);
}
}
*/
}
}
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/ServiceSubclassController.java
View file @
a24e44db
package
com
.
onsiteservice
.
miniapp
.
controller
.
category
;
package
com
.
onsiteservice
.
miniapp
.
controller
.
category
;
import
com.onsiteservice.core.result.Result
;
import
com.onsiteservice.dao.common.page.PageInfoVO
;
import
com.onsiteservice.dao.common.page.PageParams
;
import
com.onsiteservice.miniapp.controller.category.dto.PageServiceSubclassDTO
;
import
com.onsiteservice.miniapp.controller.category.vo.ServiceSubclassVO
;
import
com.onsiteservice.miniapp.service.category.ServiceSubclassService
;
import
com.onsiteservice.miniapp.service.category.ServiceSubclassService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.NonNull
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
static
com
.
onsiteservice
.
core
.
result
.
ResultGenerator
.
success
;
/**
/**
* <P>服务大类模块</P>
* <P>服务大类模块</P>
*
*
...
@@ -37,11 +25,11 @@ public class ServiceSubclassController {
...
@@ -37,11 +25,11 @@ public class ServiceSubclassController {
private
ServiceSubclassService
serviceSubclassService
;
private
ServiceSubclassService
serviceSubclassService
;
@ApiOperation
(
value
=
"分页查询列表"
)
/*
@ApiOperation(value = "分页查询列表")
@PostMapping("page")
@PostMapping("page")
public Result<PageInfoVO<ServiceSubclassVO>> getPage(@RequestBody @NonNull @Validated PageServiceSubclassDTO dto) {
public Result<PageInfoVO<ServiceSubclassVO>> getPage(@RequestBody @NonNull @Validated PageServiceSubclassDTO dto) {
return serviceSubclassService.getPage(dto);
return serviceSubclassService.getPage(dto);
}
}
*/
}
}
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/dto/PageServiceSubclassDTO.java
View file @
a24e44db
...
@@ -2,6 +2,7 @@ package com.onsiteservice.miniapp.controller.category.dto;
...
@@ -2,6 +2,7 @@ package com.onsiteservice.miniapp.controller.category.dto;
import
com.onsiteservice.dao.common.page.PageParams
;
import
com.onsiteservice.dao.common.page.PageParams
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -16,4 +17,8 @@ import lombok.EqualsAndHashCode;
...
@@ -16,4 +17,8 @@ import lombok.EqualsAndHashCode;
@Data
@Data
@ApiModel
(
"分页查询服务子类请求模型"
)
@ApiModel
(
"分页查询服务子类请求模型"
)
public
class
PageServiceSubclassDTO
extends
PageParams
{
public
class
PageServiceSubclassDTO
extends
PageParams
{
@ApiModelProperty
(
value
=
"服务子类名"
)
private
String
keyWord
;
}
}
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/vo/ServiceCategoryVO.java
View file @
a24e44db
...
@@ -2,43 +2,19 @@ package com.onsiteservice.miniapp.controller.category.vo;
...
@@ -2,43 +2,19 @@ package com.onsiteservice.miniapp.controller.category.vo;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.
Date
;
import
java.util.
List
;
@Data
@Data
public
class
ServiceCategoryVO
{
public
class
ServiceCategoryVO
{
/**
* 主键
*/
private
Integer
id
;
private
Integer
id
;
/**
* 服务名称
*/
private
String
serviceName
;
private
String
serviceName
;
private
Integer
sequence
;
private
Integer
sequence
;
private
String
img
;
private
String
img
;
/**
private
List
<
ServiceSubclassVO
>
children
;
* 创建人
*/
private
String
createBy
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 修改人
*/
private
String
modifyBy
;
/**
* 修改时间
*/
private
Date
modifyTime
;
}
}
\ No newline at end of file
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/vo/ServiceSubclassVO.java
View file @
a24e44db
...
@@ -7,9 +7,6 @@ import java.util.Date;
...
@@ -7,9 +7,6 @@ import java.util.Date;
@Data
@Data
public
class
ServiceSubclassVO
{
public
class
ServiceSubclassVO
{
/**
* 主键
*/
private
Integer
id
;
private
Integer
id
;
private
Integer
categoryId
;
private
Integer
categoryId
;
...
@@ -20,24 +17,4 @@ public class ServiceSubclassVO {
...
@@ -20,24 +17,4 @@ public class ServiceSubclassVO {
private
String
img
;
private
String
img
;
/**
* 创建人
*/
private
String
createBy
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 修改人
*/
private
String
modifyBy
;
/**
* 修改时间
*/
private
Date
modifyTime
;
}
}
\ No newline at end of file
mini-app/src/main/java/com/onsiteservice/miniapp/service/category/ServiceCategoryService.java
View file @
a24e44db
package
com
.
onsiteservice
.
miniapp
.
service
.
category
;
package
com
.
onsiteservice
.
miniapp
.
service
.
category
;
import
com.g
ithub.pagehelper.PageHelper
;
import
com.g
oogle.common.collect.Lists
;
import
com.onsiteservice.core.result.Result
;
import
com.onsiteservice.core.result.Result
;
import
com.onsiteservice.core.result.ResultGenerator
;
import
com.onsiteservice.core.result.ResultGenerator
;
import
com.onsiteservice.dao.common.AbstractMapper
;
import
com.onsiteservice.dao.common.AbstractMapper
;
import
com.onsiteservice.dao.common.page.PageInfoVO
;
import
com.onsiteservice.dao.mapper.service.ServiceCategoryMapper
;
import
com.onsiteservice.dao.mapper.service.ServiceSubclassMapper
;
import
com.onsiteservice.entity.category.ServiceCategory
;
import
com.onsiteservice.entity.category.ServiceCategory
;
import
com.onsiteservice.
miniapp.controller.category.dto.PageServiceCategoryDTO
;
import
com.onsiteservice.
entity.category.ServiceSubclass
;
import
com.onsiteservice.miniapp.controller.category.vo.ServiceCategoryVO
;
import
com.onsiteservice.miniapp.controller.category.vo.ServiceCategoryVO
;
import
com.onsiteservice.miniapp.
mapper.category.ServiceCategoryBizMapper
;
import
com.onsiteservice.miniapp.
controller.category.vo.ServiceSubclassVO
;
import
com.onsiteservice.util.AttrCopyUtils
;
import
com.onsiteservice.util.AttrCopyUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
ServiceCategoryService
extends
AbstractMapper
<
ServiceCategory
>
{
public
class
ServiceCategoryService
extends
AbstractMapper
<
ServiceCategory
>
{
//@Resource
//private ServiceCategoryBizMapper serviceCategoryBizMapper;
@Resource
private
ServiceCategoryMapper
serviceCategoryMapper
;
@Resource
@Resource
private
Service
CategoryBizMapper
serviceCategoryBiz
Mapper
;
private
Service
SubclassMapper
serviceSubclass
Mapper
;
/**
/**
* 分页查询列表
* 分页查询列表
*/
*/
public
Result
<
PageInfoVO
<
ServiceCategoryVO
>>
getPage
(
PageServiceCategoryDTO
dto
)
{
/*
public Result<PageInfoVO<ServiceCategoryVO>> getPage(PageServiceCategoryDTO dto) {
PageHelper.startPage(dto.getPage(), dto.getSize());
PageHelper.startPage(dto.getPage(), dto.getSize());
List<ServiceCategory> serviceCategoryList = serviceCategoryBizMapper.selectServiceCategoryPage(dto);
List<ServiceCategory> serviceCategoryList = serviceCategoryBizMapper.selectServiceCategoryPage(dto);
List<ServiceCategoryVO> serviceCategoryVOList = serviceCategoryList.parallelStream()
List<ServiceCategoryVO> serviceCategoryVOList = serviceCategoryList.parallelStream()
.map(e -> AttrCopyUtils.copy(e, new ServiceCategoryVO())).collect(Collectors.toList());
.map(e -> AttrCopyUtils.copy(e, new ServiceCategoryVO())).collect(Collectors.toList());
return ResultGenerator.success(new PageInfoVO<>(serviceCategoryVOList));
return ResultGenerator.success(new PageInfoVO<>(serviceCategoryVOList));
}*/
public
Result
<
List
<
ServiceCategoryVO
>>
list
(
String
keyWord
)
{
List
<
ServiceCategory
>
serviceCategoryList
=
serviceCategoryMapper
.
selectAllOrderBySequence
();
List
<
ServiceSubclass
>
serviceSubclassList
=
serviceSubclassMapper
.
selectByServiceNameLike
(
keyWord
);
Map
<
Integer
,
List
<
ServiceSubclass
>>
categoryIdServiceSubclassMap
=
serviceSubclassList
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
ServiceSubclass:
:
getCategoryId
));
List
<
ServiceCategoryVO
>
serviceCategoryVOList
=
serviceCategoryList
.
parallelStream
().
map
(
e
->
{
ServiceCategoryVO
serviceCategoryVO
=
AttrCopyUtils
.
copy
(
e
,
new
ServiceCategoryVO
());
List
<
ServiceSubclass
>
childServiceSubclassList
=
categoryIdServiceSubclassMap
.
getOrDefault
(
serviceCategoryVO
.
getId
(),
Lists
.
newArrayList
());
List
<
ServiceSubclassVO
>
childServiceSubclassVOList
=
childServiceSubclassList
.
parallelStream
().
map
(
e1
->
AttrCopyUtils
.
copy
(
e1
,
new
ServiceSubclassVO
())).
collect
(
Collectors
.
toList
());
serviceCategoryVO
.
setChildren
(
childServiceSubclassVOList
);
return
serviceCategoryVO
;
}).
collect
(
Collectors
.
toList
());
return
ResultGenerator
.
success
(
serviceCategoryVOList
);
}
}
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/category/ServiceSubclassService.java
View file @
a24e44db
package
com
.
onsiteservice
.
miniapp
.
service
.
category
;
package
com
.
onsiteservice
.
miniapp
.
service
.
category
;
import
com.github.pagehelper.PageHelper
;
import
com.onsiteservice.core.result.Result
;
import
com.onsiteservice.core.result.ResultGenerator
;
import
com.onsiteservice.dao.common.AbstractMapper
;
import
com.onsiteservice.dao.common.AbstractMapper
;
import
com.onsiteservice.dao.common.page.PageInfoVO
;
import
com.onsiteservice.entity.category.ServiceSubclass
;
import
com.onsiteservice.entity.category.ServiceSubclass
;
import
com.onsiteservice.miniapp.controller.category.dto.PageServiceSubclassDTO
;
import
com.onsiteservice.miniapp.controller.category.vo.ServiceSubclassVO
;
import
com.onsiteservice.miniapp.mapper.category.ServiceSubclassBizMapper
;
import
com.onsiteservice.miniapp.mapper.category.ServiceSubclassBizMapper
;
import
com.onsiteservice.util.AttrCopyUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -24,12 +15,12 @@ public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
...
@@ -24,12 +15,12 @@ public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
@Resource
@Resource
private
ServiceSubclassBizMapper
serviceSubclassBizMapper
;
private
ServiceSubclassBizMapper
serviceSubclassBizMapper
;
public
Result
<
PageInfoVO
<
ServiceSubclassVO
>>
getPage
(
PageServiceSubclassDTO
dto
)
{
/*
public Result<PageInfoVO<ServiceSubclassVO>> getPage(PageServiceSubclassDTO dto) {
PageHelper.startPage(dto.getPage(), dto.getSize());
PageHelper.startPage(dto.getPage(), dto.getSize());
List<ServiceSubclass> serviceSubclassList = serviceSubclassBizMapper.selectServiceSubclassPage(dto);
List<ServiceSubclass> serviceSubclassList = serviceSubclassBizMapper.selectServiceSubclassPage(dto);
List<ServiceSubclassVO> serviceSubclassVOList = serviceSubclassList.parallelStream()
List<ServiceSubclassVO> serviceSubclassVOList = serviceSubclassList.parallelStream()
.map(e -> AttrCopyUtils.copy(e, new ServiceSubclassVO())).collect(Collectors.toList());
.map(e -> AttrCopyUtils.copy(e, new ServiceSubclassVO())).collect(Collectors.toList());
return ResultGenerator.success(new PageInfoVO<>(serviceSubclassVOList));
return ResultGenerator.success(new PageInfoVO<>(serviceSubclassVOList));
}
}
*/
}
}
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