OrgTree.java
3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package com.hotent.uc.model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.hotent.base.util.BeanUtils;
/**
* 组织树
* @author Administrator
*
*/
public class OrgTree extends Org {
private static final long serialVersionUID = -3645769164167420062L;
public static final String ICON_COMORG ="/styles/theme/default/images/icons/u_darkblue/u_zzgl_darkblue.png";
protected Long sn; /*序号*/
protected String icon; /*图标*/
protected boolean nocheck = false; /***/
protected boolean chkDisabled =false ;
protected boolean click = true;
protected String title = ""; //*title 默认为name 、如果name添加了 css 、则默认为 “” */
protected String demId = "0";
protected boolean authRoot = false; /*分级组织管理时用于判断是否为根节点*/
protected boolean post = false; /*判断是否为岗位*/
public OrgTree() {
}
public OrgTree(String name,String id,String parentId,String icon){
setName(name);
this.parentId = parentId;
this.id =id;
this.icon = icon;
}
/**
* GroupList2TreeList
*/
public static List<OrgTree> GroupList2TreeList(List<Org> groupList,String icon){
if(groupList == null || groupList.size() == 0)
return Collections.emptyList();
List<OrgTree> groupTreeList = new ArrayList<OrgTree>();
for(Org group : groupList){
OrgTree grouptree = new OrgTree(group);
grouptree.setIcon(icon);
groupTreeList.add(grouptree);
}
return groupTreeList;
}
public OrgTree(Org group) {
this.id =group.id;
this.name = group.name;
this.code = group.code;
this.sn = group.orderNo;
this.parentId = group.parentId;
this.demId = group.demId;
this.isIsParent = group.isIsParent;
this.path = group.path;
if(!this.name.contains("style=")){
this.title = name;
}
}
public OrgTree(OrgPost orgPost) {
this.id =orgPost.id;
this.name = orgPost.name;
this.code = orgPost.code;
this.parentId = orgPost.orgId;
if(BeanUtils.isNotEmpty(this.name)&& !this.name.contains("style=")){
this.title = name;
}
}
@Override
public void setName(String name) {
this.name = name;
// 将title 设置成name
if("".equals(title) && !this.name.contains("style=")){
this.title = name;
}
};
public String getDemId() {
return demId;
}
public void setDemId(String demId) {
this.demId = demId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Long getSn() {
return sn;
}
public void setSn(Long sn) {
this.sn = sn;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public boolean isNocheck() {
return nocheck;
}
public void setNocheck(boolean nocheck) {
this.nocheck = nocheck;
}
public boolean isChkDisabled() {
return chkDisabled;
}
public boolean isClick() {
return click;
}
public void setClick(boolean click) {
this.click = click;
}
public void setChkDisabled(boolean chkDisabled) {
this.chkDisabled = chkDisabled;
}
public boolean isAuthRoot() {
return authRoot;
}
public void setAuthRoot(boolean authRoot) {
this.authRoot = authRoot;
}
public boolean isPost() {
return post;
}
public void setPost(boolean post) {
this.post = post;
}
}