Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
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
mengmeng
pension
Commits
d2594ab7
Commit
d2594ab7
authored
Feb 06, 2021
by
lings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务改为树形
parent
24eb707e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
11 deletions
+52
-11
PensionServiceController.java
...les/serviceOrder/controller/PensionServiceController.java
+12
-0
PensionServiceDTO.java
...a/io/hmit/modules/serviceOrder/dto/PensionServiceDTO.java
+8
-2
PensionServiceEntity.java
...mit/modules/serviceOrder/entity/PensionServiceEntity.java
+6
-2
PensionServiceService.java
...t/modules/serviceOrder/service/PensionServiceService.java
+5
-1
PensionServiceServiceImpl.java
.../serviceOrder/service/impl/PensionServiceServiceImpl.java
+17
-3
PensionServiceDao.xml
.../main/resources/mapper/serviceOrder/PensionServiceDao.xml
+4
-3
No files found.
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/controller/PensionServiceController.java
View file @
d2594ab7
...
@@ -72,6 +72,18 @@ public class PensionServiceController {
...
@@ -72,6 +72,18 @@ public class PensionServiceController {
return
new
Result
<
List
<
PensionServiceDTO
>>().
ok
(
pensionServiceDTOList
);
return
new
Result
<
List
<
PensionServiceDTO
>>().
ok
(
pensionServiceDTOList
);
}
}
@GetMapping
(
"getServiceTree"
)
@ApiOperation
(
"获取服务list不分页"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"查询字段,"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"serviceType"
,
value
=
"服务类型"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Result
<
List
<
PensionServiceDTO
>>
getServiceTree
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
List
<
PensionServiceDTO
>
pensionServiceDTOList
=
pensionServiceService
.
getServiceTree
(
params
);
return
new
Result
<
List
<
PensionServiceDTO
>>().
ok
(
pensionServiceDTOList
);
}
@GetMapping
(
"{id}"
)
@GetMapping
(
"{id}"
)
@ApiOperation
(
"信息"
)
@ApiOperation
(
"信息"
)
@RequiresPermissions
(
"serviceOrder:pensionservice:info"
)
@RequiresPermissions
(
"serviceOrder:pensionservice:info"
)
...
...
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/dto/PensionServiceDTO.java
View file @
d2594ab7
package
io
.
hmit
.
modules
.
serviceOrder
.
dto
;
package
io
.
hmit
.
modules
.
serviceOrder
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.hmit.common.utils.TreeNode
;
import
io.hmit.modules.sys.dto.SysMenuDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -19,14 +21,18 @@ import java.util.List;
...
@@ -19,14 +21,18 @@ import java.util.List;
*/
*/
@Data
@Data
@ApiModel
(
value
=
"服务表"
)
@ApiModel
(
value
=
"服务表"
)
public
class
PensionServiceDTO
implements
Serializable
{
public
class
PensionServiceDTO
extends
TreeNode
<
PensionServiceDTO
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"pid"
)
private
Long
pid
;
@ApiModelProperty
(
value
=
"服务名称"
)
@ApiModelProperty
(
value
=
"服务名称"
)
private
String
n
ame
;
private
String
serviceN
ame
;
@ApiModelProperty
(
value
=
"服务内容介绍"
)
@ApiModelProperty
(
value
=
"服务内容介绍"
)
private
String
serviceContent
;
private
String
serviceContent
;
...
...
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/entity/PensionServiceEntity.java
View file @
d2594ab7
package
io
.
hmit
.
modules
.
serviceOrder
.
entity
;
package
io
.
hmit
.
modules
.
serviceOrder
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
io.hmit.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -23,7 +24,10 @@ public class PensionServiceEntity extends BaseEntity {
...
@@ -23,7 +24,10 @@ public class PensionServiceEntity extends BaseEntity {
/**
/**
* 服务名称
* 服务名称
*/
*/
private
String
name
;
private
String
serviceName
;
private
Long
pid
;
/**
/**
* 服务类型
* 服务类型
*/
*/
...
...
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/service/PensionServiceService.java
View file @
d2594ab7
...
@@ -4,6 +4,9 @@ import io.hmit.common.service.CrudService;
...
@@ -4,6 +4,9 @@ import io.hmit.common.service.CrudService;
import
io.hmit.modules.serviceOrder.dto.PensionServiceDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionServiceDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionServiceEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionServiceEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 服务表
* 服务表
*
*
...
@@ -12,4 +15,5 @@ import io.hmit.modules.serviceOrder.entity.PensionServiceEntity;
...
@@ -12,4 +15,5 @@ import io.hmit.modules.serviceOrder.entity.PensionServiceEntity;
*/
*/
public
interface
PensionServiceService
extends
CrudService
<
PensionServiceEntity
,
PensionServiceDTO
>
{
public
interface
PensionServiceService
extends
CrudService
<
PensionServiceEntity
,
PensionServiceDTO
>
{
List
<
PensionServiceDTO
>
getServiceTree
(
Map
<
String
,
Object
>
params
);
}
}
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionServiceServiceImpl.java
View file @
d2594ab7
...
@@ -2,13 +2,19 @@ package io.hmit.modules.serviceOrder.service.impl;
...
@@ -2,13 +2,19 @@ package io.hmit.modules.serviceOrder.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.TreeUtils
;
import
io.hmit.modules.serviceOrder.dao.PensionServiceDao
;
import
io.hmit.modules.serviceOrder.dao.PensionServiceDao
;
import
io.hmit.modules.serviceOrder.dto.PensionServiceDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionServiceDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionServiceEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionServiceEntity
;
import
io.hmit.modules.serviceOrder.service.PensionServiceService
;
import
io.hmit.modules.serviceOrder.service.PensionServiceService
;
import
io.hmit.modules.sys.dto.SysMenuDTO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -20,17 +26,18 @@ import java.util.Map;
...
@@ -20,17 +26,18 @@ import java.util.Map;
@Service
@Service
public
class
PensionServiceServiceImpl
extends
CrudServiceImpl
<
PensionServiceDao
,
PensionServiceEntity
,
PensionServiceDTO
>
implements
PensionServiceService
{
public
class
PensionServiceServiceImpl
extends
CrudServiceImpl
<
PensionServiceDao
,
PensionServiceEntity
,
PensionServiceDTO
>
implements
PensionServiceService
{
@Autowired
private
PensionServiceService
pensionServiceService
;
@Override
@Override
public
QueryWrapper
<
PensionServiceEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
public
QueryWrapper
<
PensionServiceEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
String
id
=
(
String
)
params
.
get
(
"id"
);
String
keyword
=
(
String
)
params
.
get
(
"keyword"
);
String
keyword
=
(
String
)
params
.
get
(
"keyword"
);
String
serviceType
=
(
String
)
params
.
get
(
"serviceType"
);
QueryWrapper
<
PensionServiceEntity
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PensionServiceEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
serviceType
),
"service_type_id"
,
serviceType
);
wrapper
.
like
(
StringUtils
.
isNotBlank
(
keyword
),
"service_name"
,
keyword
);
wrapper
.
like
(
StringUtils
.
isNotBlank
(
keyword
),
"name"
,
keyword
);
...
@@ -38,4 +45,11 @@ public class PensionServiceServiceImpl extends CrudServiceImpl<PensionServiceDao
...
@@ -38,4 +45,11 @@ public class PensionServiceServiceImpl extends CrudServiceImpl<PensionServiceDao
}
}
@Override
public
List
<
PensionServiceDTO
>
getServiceTree
(
Map
<
String
,
Object
>
params
)
{
List
<
PensionServiceEntity
>
list
=
baseDao
.
selectList
(
getWrapper
(
params
));
List
<
PensionServiceDTO
>
dtos
=
ConvertUtils
.
sourceToTarget
(
list
,
PensionServiceDTO
.
class
);
return
TreeUtils
.
build
(
dtos
);
}
}
}
hmit-admin/src/main/resources/mapper/serviceOrder/PensionServiceDao.xml
View file @
d2594ab7
...
@@ -5,8 +5,9 @@
...
@@ -5,8 +5,9 @@
<resultMap
type=
"io.hmit.modules.serviceOrder.entity.PensionServiceEntity"
id=
"pensionServiceMap"
>
<resultMap
type=
"io.hmit.modules.serviceOrder.entity.PensionServiceEntity"
id=
"pensionServiceMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"serviceName"
column=
"service_name"
/>
<result
property=
"serviceTypeId"
column=
"service_type_id"
/>
<result
property=
"serviceParentId"
column=
"service_parent_id"
/>
<result
property=
"pid"
column=
"pid"
/>
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"icon"
column=
"icon"
/>
<result
property=
"icon"
column=
"icon"
/>
<result
property=
"detailPicture"
column=
"detail_picture"
/>
<result
property=
"detailPicture"
column=
"detail_picture"
/>
...
...
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