qushaowei
2023-10-07 3858c775f565df000a45afd9a0c38c7b6bb39069
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
package org.jeecg.modules.eam.vo;
 
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * @Description: 级联选择框通用返回实体类
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class CommonCascade {
 
    private String value;
 
    private String label;
 
    private List<CommonCascade> children = new ArrayList<>();
 
    // 添加子节点的方法
    public CommonCascade addChildren(CommonCascade node) {
        if (this.children == null) {
            this.children = new ArrayList<CommonCascade>();
        }
        this.children.add(node);
        return node;
    }
 
    public boolean hasChildren() {
        boolean bu = true;
        if (getChildren() == null || getChildren().isEmpty()) {
            bu = false;
            return bu;
        }
        return bu;
    }
 
}