Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
aa7990b0
Commit
aa7990b0
authored
Jun 06, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加站点业务中子业务列表
parent
24de99c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
...xhx/module/site/service/impl/SiteBusinessServiceImpl.java
+23
-16
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
View file @
aa7990b0
...
@@ -41,23 +41,30 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
...
@@ -41,23 +41,30 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
protected
void
findAfter
(
SiteBusinessEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
SiteBusinessEntity
>
list
)
throws
AppException
{
protected
void
findAfter
(
SiteBusinessEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
SiteBusinessEntity
>
list
)
throws
AppException
{
list
.
stream
().
peek
(
item
->
{
list
.
stream
().
peek
(
item
->
{
List
<
SiteBusinessEntity
>
childs
=
this
.
find
(
new
SiteBusinessQuery
().
siteId
(
item
.
getSiteId
()).
parentId
(
item
.
getBusinessId
()));
List
<
SiteBusinessEntity
>
childs
=
this
.
find
(
new
SiteBusinessQuery
().
siteId
(
item
.
getSiteId
()).
parentId
(
item
.
getBusinessId
()));
if
(!
ObjectUtils
.
isEmpty
(
item
.
getBusinessId
())){
childs
.
stream
().
forEach
(
item1
->
{
BusinessEntity
businessEntity
=
businessService
.
get
(
item
.
getBusinessId
());
buildChildBusiness
(
item1
);
if
(!
ObjectUtils
.
isEmpty
(
businessEntity
)){
});
BeanUtils
.
copyProperties
(
businessEntity
,
item
,
"id"
);
//判断业务是否含有子业务
if
(
businessEntity
.
getIsBusiness
()==
IsBusinessEnum
.
一级业务
.
getValue
()){
//添加二级业务列表
List
<
BusinessEntity
>
businessEntities
=
businessService
.
find
(
new
BusinessQuery
().
parentId
(
businessEntity
.
getId
()));
businessEntity
.
setChildren
(
businessEntities
);
}
}
}
item
.
setChildren
(
childs
);
item
.
setChildren
(
childs
);
buildChildBusiness
(
item
);
}).
count
();
}).
count
();
super
.
findAfter
(
params
,
pageInfo
,
context
,
list
);
super
.
findAfter
(
params
,
pageInfo
,
context
,
list
);
}
}
private
void
buildChildBusiness
(
SiteBusinessEntity
item
)
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getBusinessId
()))
{
BusinessEntity
businessEntity
=
businessService
.
get
(
item
.
getBusinessId
());
if
(!
ObjectUtils
.
isEmpty
(
businessEntity
))
{
BeanUtils
.
copyProperties
(
businessEntity
,
item
,
"id"
);
//判断业务是否含有子业务
if
(
businessEntity
.
getIsBusiness
()
==
IsBusinessEnum
.
一级业务
.
getValue
())
{
//添加二级业务列表
List
<
BusinessEntity
>
businessEntities
=
businessService
.
find
(
new
BusinessQuery
().
parentId
(
businessEntity
.
getId
()));
businessEntity
.
setChildren
(
businessEntities
);
}
}
}
}
@Override
@Override
protected
void
saveBefore
(
SiteBusinessEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveBefore
(
SiteBusinessEntity
entity
,
Context
context
)
throws
AppException
{
...
@@ -120,11 +127,11 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
...
@@ -120,11 +127,11 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Override
@Override
public
Result
<
SiteBusinessEntity
>
flatList
(
SiteBusinessEntity
query
,
PageInfo
pageInfo
,
Context
context
)
{
public
Result
<
SiteBusinessEntity
>
flatList
(
SiteBusinessEntity
query
,
PageInfo
pageInfo
,
Context
context
)
{
Result
<
SiteBusinessEntity
>
result
=
this
.
dao
.
getList
(
query
,
pageInfo
);
Result
<
SiteBusinessEntity
>
result
=
this
.
dao
.
getList
(
query
,
pageInfo
);
result
.
getList
().
stream
().
forEach
(
item
->
{
result
.
getList
().
stream
().
forEach
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getBusinessId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getBusinessId
()))
{
BusinessEntity
businessEntity
=
businessService
.
get
(
item
.
getBusinessId
());
BusinessEntity
businessEntity
=
businessService
.
get
(
item
.
getBusinessId
());
if
(!
ObjectUtils
.
isEmpty
(
businessEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
businessEntity
))
{
BeanUtils
.
copyProperties
(
businessEntity
,
item
,
"id"
);
BeanUtils
.
copyProperties
(
businessEntity
,
item
,
"id"
);
}
}
}
}
});
});
...
...
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