Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeiZhen-Java
peizhen-java
Commits
df346608
Commit
df346608
authored
Sep 22, 2023
by
邹磊浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
21a505c3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
pz-system/src/main/java/com/pz/system/domain/vo/ServicesVo.java
+2
-0
pz-system/src/main/java/com/pz/system/service/impl/BusinessServiceImpl.java
+29
-13
No files found.
pz-system/src/main/java/com/pz/system/domain/vo/ServicesVo.java
View file @
df346608
...
...
@@ -35,6 +35,8 @@ public class ServicesVo {
* 城市id
*/
private
Integer
cityId
;
private
String
cityName
;
/**
* 所属业务
*/
...
...
pz-system/src/main/java/com/pz/system/service/impl/BusinessServiceImpl.java
View file @
df346608
...
...
@@ -11,7 +11,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.pz.common.utils.JsonUtils
;
import
com.pz.system.domain.Hospital
;
import
com.pz.system.domain.Services
;
import
com.pz.system.domain.vo.CityVo
;
import
com.pz.system.domain.vo.HospitalVo
;
import
com.pz.system.domain.vo.ServicesVo
;
import
com.pz.system.mapper.CityMapper
;
import
com.pz.system.mapper.HospitalMapper
;
import
com.pz.system.mapper.ServicesMapper
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -44,6 +47,8 @@ public class BusinessServiceImpl implements IBusinessService {
private
final
ServicesMapper
servicesMapper
;
private
final
CityMapper
cityMapper
;
/**
* 查询业务
*/
...
...
@@ -64,25 +69,36 @@ public class BusinessServiceImpl implements IBusinessService {
public
TableDataInfo
<
BusinessVo
>
queryPageList
(
BusinessBo
bo
,
PageQuery
pageQuery
)
{
LambdaQueryWrapper
<
Business
>
lqw
=
buildQueryWrapper
(
bo
);
Page
<
BusinessVo
>
result
=
baseMapper
.
selectVoPage
(
pageQuery
.
build
(),
lqw
);
Optional
.
ofNullable
(
result
.
getRecords
()).
ifPresent
(
businessVos
->
{
businessVos
.
forEach
(
businessVo
->
{
if
(
result
.
getRecords
()
!=
null
)
{
List
<
BusinessVo
>
businessVos
=
result
.
getRecords
();
for
(
BusinessVo
businessVo
:
businessVos
)
{
if
(
StringUtils
.
isNotBlank
(
businessVo
.
getHospitals
()))
{
//
获取绑定所以
医院id
//
获取绑定的所有
医院id
List
<
Long
>
ids
=
JsonUtils
.
parseArray
(
businessVo
.
getHospitals
(),
Long
.
class
);
Optional
.
ofNullable
(
hospitalMapper
.
selectVoList
(
Wrappers
.<
Hospital
>
lambdaQuery
().
in
(
Hospital:
:
getId
,
ids
)))
.
ifPresent
(
hospitalVos
->
{
businessVo
.
setHospitalsList
(
hospitalVos
.
stream
().
map
(
HospitalVo:
:
getName
).
collect
(
Collectors
.
toList
()));
});
if
(!
ids
.
isEmpty
())
{
List
<
HospitalVo
>
hospitalVos
=
hospitalMapper
.
selectVoList
(
Wrappers
.<
Hospital
>
lambdaQuery
()
.
in
(
Hospital:
:
getId
,
ids
));
businessVo
.
setHospitalsList
(
hospitalVos
.
stream
()
.
map
(
HospitalVo:
:
getName
)
.
collect
(
Collectors
.
toList
()));
}
}
// 获取关联服务
List
<
ServicesVo
>
servicesVos
=
servicesMapper
.
selectVoList
(
Wrappers
.<
Services
>
lambdaQuery
()
.
eq
(
Services:
:
getBid
,
businessVo
.
getId
()));
for
(
ServicesVo
servicesVo
:
servicesVos
)
{
CityVo
cityVo
=
cityMapper
.
selectVoById
(
servicesVo
.
getCityId
());
if
(
cityVo
!=
null
)
{
servicesVo
.
setCityName
(
cityVo
.
getName
());
}
}
//获取关联服务
Optional
.
ofNullable
(
servicesMapper
.
selectVoList
(
Wrappers
.<
Services
>
lambdaQuery
().
eq
(
Services:
:
getBid
,
businessVo
.
getId
())))
.
ifPresent
(
servicesVos
->
{
businessVo
.
setServicesVoList
(
servicesVos
);
});
});
});
}
}
return
TableDataInfo
.
build
(
result
);
}
/**
...
...
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