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
f2a77f6c
Commit
f2a77f6c
authored
Mar 11, 2021
by
mengmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改服务大类展示接口service表数据
parent
f7108ae9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
23 deletions
+71
-23
PensionServiceController.java
...les/serviceOrder/controller/PensionServiceController.java
+34
-0
PensionServiceDTO.java
...a/io/hmit/modules/serviceOrder/dto/PensionServiceDTO.java
+2
-18
PensionServiceEntity.java
...mit/modules/serviceOrder/entity/PensionServiceEntity.java
+2
-2
PensionServiceService.java
...t/modules/serviceOrder/service/PensionServiceService.java
+5
-1
PensionServiceServiceImpl.java
.../serviceOrder/service/impl/PensionServiceServiceImpl.java
+26
-2
PensionServiceTypeServiceImpl.java
...viceOrder/service/impl/PensionServiceTypeServiceImpl.java
+2
-0
No files found.
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionServiceController.java
View file @
f2a77f6c
...
...
@@ -66,6 +66,39 @@ public class PensionServiceController {
}
@GetMapping
(
"getByServiceId/{serviceId}"
)
@ApiOperation
(
"根据服务获取详情页面"
)
public
Result
<
PensionServiceDTO
>
getByServiceId
(
@PathVariable
(
"serviceId"
)
Long
serviceId
){
PensionServiceDTO
data
=
pensionServiceService
.
get
(
serviceId
);
return
new
Result
<
PensionServiceDTO
>().
ok
(
data
);
}
@GetMapping
(
"getSecondListByServiceId"
)
@ApiOperation
(
"根据服务id获取二级列表--可查询免费"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"isFree"
,
value
=
"是否免费:1 是, 2 否"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"服务大类ID"
,
paramType
=
"query"
,
dataType
=
"int"
)
})
public
Result
<
List
<
PensionServiceDTO
>>
getSecondListByServiceId
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
List
<
PensionServiceDTO
>
data
=
pensionServiceService
.
list
(
params
);
return
new
Result
<
List
<
PensionServiceDTO
>>().
ok
(
data
);
}
@GetMapping
(
"getServiceList"
)
@ApiOperation
(
"老人/子女服务大类--包含免费"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"isFree"
,
value
=
"是否免费:1 是, 2 否"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Result
<
List
<
PensionServiceDTO
>>
getServiceList
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
List
<
PensionServiceDTO
>
data
=
pensionServiceService
.
getFirstServiceList
(
params
);
return
new
Result
<
List
<
PensionServiceDTO
>>().
ok
(
data
);
}
/*
//V1 根据serviceType 获取服务大类
@GetMapping("getByServiceTypeId/{serviceTypeId}")
@ApiOperation("根据服务大类获取详情")
public Result<PensionServiceDTO> getByServiceTypeId(@PathVariable("serviceTypeId") Long serviceTypeId){
...
...
@@ -76,6 +109,7 @@ public class PensionServiceController {
return new Result<PensionServiceDTO>().ok(data.get(0));
}
*/
@PostMapping
@ApiOperation
(
"保存"
)
public
Result
save
(
@RequestBody
PensionServiceDTO
dto
){
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/PensionServiceDTO.java
View file @
f2a77f6c
...
...
@@ -25,8 +25,8 @@ public class PensionServiceDTO implements Serializable {
@ApiModelProperty
(
value
=
"服务名称"
)
private
String
serviceName
;
@ApiModelProperty
(
value
=
"服务
类型
"
)
private
Long
serviceTypeI
d
;
@ApiModelProperty
(
value
=
"服务
父类id
"
)
private
Long
pi
d
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
...
...
@@ -52,20 +52,4 @@ public class PensionServiceDTO implements Serializable {
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"部门ID"
)
private
Long
deptId
;
@ApiModelProperty
(
value
=
"创建者"
)
private
Long
creator
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
value
=
"更新者"
)
private
Long
updater
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/entity/PensionServiceEntity.java
View file @
f2a77f6c
...
...
@@ -27,9 +27,9 @@ public class PensionServiceEntity extends BaseEntity {
// @Property(value = "name")
private
String
serviceName
;
/**
* 服务
类型
* 服务
父类id
*/
private
Long
serviceTypeI
d
;
private
Long
pi
d
;
/**
* 排序
*/
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionServiceService.java
View file @
f2a77f6c
...
...
@@ -4,6 +4,9 @@ import io.hmit.common.service.CrudService;
import
io.hmit.modules.serviceOrder.dto.PensionServiceDTO
;
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;
*/
public
interface
PensionServiceService
extends
CrudService
<
PensionServiceEntity
,
PensionServiceDTO
>
{
List
<
PensionServiceDTO
>
getFirstServiceList
(
Map
<
String
,
Object
>
params
);
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionServiceServiceImpl.java
View file @
f2a77f6c
...
...
@@ -2,6 +2,7 @@ package io.hmit.modules.serviceOrder.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.modules.serviceOrder.dao.PensionServiceDao
;
import
io.hmit.modules.serviceOrder.dto.PensionServiceDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionServiceEntity
;
...
...
@@ -9,6 +10,8 @@ import io.hmit.modules.serviceOrder.service.PensionServiceService;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -24,17 +27,38 @@ public class PensionServiceServiceImpl extends CrudServiceImpl<PensionServiceDao
@Override
public
QueryWrapper
<
PensionServiceEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
String
serviceTypeId
=
params
.
get
(
"serviceTypeId"
)
==
null
?
""
:
params
.
get
(
"serviceTypeI
d"
).
toString
();
String
pid
=
params
.
get
(
"pid"
)
==
null
?
""
:
params
.
get
(
"pi
d"
).
toString
();
String
isFree
=
(
String
)
params
.
get
(
"isFree"
);
QueryWrapper
<
PensionServiceEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
serviceTypeId
),
"service_type_id"
,
serviceTypeI
d
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
pid
),
"pid"
,
pi
d
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
isFree
),
"is_free"
,
isFree
);
return
wrapper
;
}
@Override
public
List
<
PensionServiceDTO
>
getFirstServiceList
(
Map
<
String
,
Object
>
params
)
{
String
isFree
=
(
String
)
params
.
get
(
"isFree"
);
List
<
PensionServiceEntity
>
pensionServiceLists
=
baseDao
.
selectList
(
new
QueryWrapper
<
PensionServiceEntity
>().
eq
(
"pid"
,
0
));
if
(!
""
.
equals
(
isFree
)
&&
isFree
!=
null
){
List
<
PensionServiceEntity
>
entityList
=
new
ArrayList
<>();
pensionServiceLists
.
stream
().
forEach
(
item
->{
Map
<
String
,
Object
>
pid
=
new
HashMap
<>();
pid
.
put
(
"pid"
,
item
.
getId
());
pid
.
put
(
"isFree"
,
isFree
);
if
(
list
(
pid
).
size
()>
0
){
entityList
.
add
(
item
);
}
});
return
ConvertUtils
.
sourceToTarget
(
entityList
,
PensionServiceDTO
.
class
)
;
}
return
ConvertUtils
.
sourceToTarget
(
pensionServiceLists
,
PensionServiceDTO
.
class
)
;
}
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionServiceTypeServiceImpl.java
View file @
f2a77f6c
...
...
@@ -89,10 +89,12 @@ public class PensionServiceTypeServiceImpl extends CrudServiceImpl<PensionServic
// pensionServices.stream().collect(Collectors.groupingBy(PensionServiceEntity::getServiceTypeId))
List
<
PensionServiceTypeDTO
>
resultList
=
new
ArrayList
<>();
/*
for (PensionServiceEntity pensionService:pensionServices) {
PensionServiceTypeDTO pensionServiceTypeDTO = get(pensionService.getServiceTypeId());
resultList.add(pensionServiceTypeDTO);
}
*/
return
resultList
;
}
}
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