package org.jeecg.modules.basedata.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class FdPersonnelTree {

    /**
     * 对应BmCustomerClass中的id 字段,前端数据树中的value
     */
    private String value;

    /**
     * 对应BmCustomerClass中的id 字段,前端数据树中的title
     */
    private String label;
    /**
     * 是否叶子节点
     */
    private boolean isLeaf;

    private java.lang.String id;
    /**人员编码*/
    private java.lang.String code;
    /**姓名*/
    private java.lang.String name;
    private String parentId;

    private String key;
    private String title;

    private String roleId;

    private String roleName;
    /**
     * 外加字段
     */
    private List<FdPersonnelTree> children = new ArrayList<>();

    public FdPersonnelTree(){

    }

    public FdPersonnelTree(FdPersonnel fdPersonnel){
        this.value = fdPersonnel.getId();
        this.label = fdPersonnel.getName();
        this.id = fdPersonnel.getId();
        this.code = fdPersonnel.getCode();
        this.name = fdPersonnel.getName();
        this.parentId = fdPersonnel.getParentId();
        this.key=fdPersonnel.getId();
        this.title=fdPersonnel.getName();
        this.roleId=fdPersonnel.getRoleId();
        this.roleName=fdPersonnel.getRoleName();
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public boolean getIsLeaf() {
        return isLeaf;
    }

    public void setIsLeaf(boolean leaf) {
        isLeaf = leaf;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public List<FdPersonnelTree> getChildren() {
        return children;
    }

    public void setChildren(List<FdPersonnelTree> children) {
        if (children == null) {
            this.isLeaf = true;
        }
        this.children = children;
    }

}
