提交 | 用户 | 时间
|
e57a89
|
1 |
package com.jcdm.common.core.domain; |
懒 |
2 |
|
|
3 |
import java.io.Serializable; |
|
4 |
import java.util.List; |
|
5 |
import java.util.stream.Collectors; |
|
6 |
import com.fasterxml.jackson.annotation.JsonInclude; |
|
7 |
import com.jcdm.common.core.domain.entity.SysDept; |
|
8 |
import com.jcdm.common.core.domain.entity.SysMenu; |
|
9 |
|
|
10 |
/** |
|
11 |
* Treeselect树结构实体类 |
|
12 |
* |
|
13 |
* @author jc |
|
14 |
*/ |
|
15 |
public class TreeSelect implements Serializable |
|
16 |
{ |
|
17 |
private static final long serialVersionUID = 1L; |
|
18 |
|
|
19 |
/** 节点ID */ |
|
20 |
private Long id; |
|
21 |
|
|
22 |
/** 节点名称 */ |
|
23 |
private String label; |
|
24 |
|
|
25 |
/** 子节点 */ |
|
26 |
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
|
27 |
private List<TreeSelect> children; |
|
28 |
|
|
29 |
public TreeSelect() |
|
30 |
{ |
|
31 |
|
|
32 |
} |
|
33 |
|
|
34 |
public TreeSelect(SysDept dept) |
|
35 |
{ |
|
36 |
this.id = dept.getDeptId(); |
|
37 |
this.label = dept.getDeptName(); |
|
38 |
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
|
39 |
} |
|
40 |
|
|
41 |
public TreeSelect(SysMenu menu) |
|
42 |
{ |
|
43 |
this.id = menu.getMenuId(); |
|
44 |
this.label = menu.getMenuName(); |
|
45 |
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
|
46 |
} |
|
47 |
|
|
48 |
public Long getId() |
|
49 |
{ |
|
50 |
return id; |
|
51 |
} |
|
52 |
|
|
53 |
public void setId(Long id) |
|
54 |
{ |
|
55 |
this.id = id; |
|
56 |
} |
|
57 |
|
|
58 |
public String getLabel() |
|
59 |
{ |
|
60 |
return label; |
|
61 |
} |
|
62 |
|
|
63 |
public void setLabel(String label) |
|
64 |
{ |
|
65 |
this.label = label; |
|
66 |
} |
|
67 |
|
|
68 |
public List<TreeSelect> getChildren() |
|
69 |
{ |
|
70 |
return children; |
|
71 |
} |
|
72 |
|
|
73 |
public void setChildren(List<TreeSelect> children) |
|
74 |
{ |
|
75 |
this.children = children; |
|
76 |
} |
|
77 |
} |