Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
base-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
赵啸非
base-platform
Commits
46407696
Commit
46407696
authored
Apr 07, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加事项同步数据
parent
e944a784
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
0 deletions
+108
-0
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteTreeSelect.java
...ava/com/mortals/xhx/module/site/model/SiteTreeSelect.java
+108
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteTreeSelect.java
0 → 100644
View file @
46407696
package
com.mortals.xhx.module.site.model
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
lombok.Data
;
import
org.springframework.util.ObjectUtils
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 区域前端映射树结构实体类
*
* @author zxfei
* @date 2022-01-12
*/
@Data
public
class
SiteTreeSelect
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 节点ID
*/
private
String
id
;
/**
* 节点名称
*/
private
String
label
;
/**
* 区域编码
*/
private
String
areaCode
;
/**
* 是否叶子节点
*/
private
Boolean
isLeaf
;
/**
* 节点类型
*/
private
String
type
;
/**
* 图标
*/
private
String
icon
;
/**
* 子节点
*/
private
List
<
SiteTreeSelect
>
children
;
public
SiteTreeSelect
(
AreaEntity
entity
)
{
//如果是站点,则替换名称和id
this
.
id
=
entity
.
getIid
();
this
.
label
=
entity
.
getName
();
if
(
"False"
.
equalsIgnoreCase
(
entity
.
getHaveSonArea
()))
{
this
.
isLeaf
=
true
;
this
.
children
=
new
ArrayList
();
}
else
{
this
.
isLeaf
=
false
;
}
this
.
areaCode
=
entity
.
getAreaCode
();
this
.
type
=
"area"
;
this
.
icon
=
"el-icon-folder"
;
}
public
SiteTreeSelect
(
AreaEntity
entity
,
Map
<
String
,
SiteEntity
>
siteMap
)
{
List
<
SiteEntity
>
collect
=
siteMap
.
entrySet
().
stream
().
filter
(
f
->
f
.
getKey
().
startsWith
(
entity
.
getAreaCode
()))
.
map
(
m
->
m
.
getValue
())
.
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
collect
))
{
this
.
id
=
collect
.
stream
().
map
(
item
->
item
.
getId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
this
.
label
=
collect
.
stream
().
map
(
item
->
item
.
getSiteName
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
this
.
type
=
"site"
;
this
.
icon
=
"el-icon-document"
;
}
else
{
this
.
id
=
entity
.
getIid
();
this
.
label
=
entity
.
getName
();
this
.
type
=
"area"
;
this
.
icon
=
"el-icon-folder"
;
}
if
(
"False"
.
equalsIgnoreCase
(
entity
.
getHaveSonArea
()))
{
this
.
isLeaf
=
true
;
//this.children = new ArrayList();
}
else
{
this
.
isLeaf
=
false
;
this
.
children
=
entity
.
getChildren
().
stream
().
map
(
item
->
new
SiteTreeSelect
(
item
,
siteMap
)).
collect
(
Collectors
.
toList
());
}
this
.
areaCode
=
entity
.
getAreaCode
();
}
public
SiteTreeSelect
(
SiteEntity
entity
)
{
this
.
id
=
entity
.
getId
().
toString
();
this
.
label
=
entity
.
getSiteName
();
this
.
isLeaf
=
true
;
this
.
type
=
"site"
;
this
.
icon
=
"el-icon-document"
;
}
}
\ No newline at end of file
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