package com.yuchen.saas.manage.system.api.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yuchen.saas.manage.system.api.entity.Dept;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nest.springwrap.core.tool.node.INode;
import org.nest.springwrap.core.tool.utils.Func;

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


@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "OrgDeptTreeVO对象", description = "OrgDeptTreeVO对象")
public class OrgDeptTreeVO extends Dept implements INode<OrgDeptTreeVO> {

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<OrgDeptTreeVO> children;


    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Boolean hasChildren;

    @Override
    public List<OrgDeptTreeVO> getChildren() {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        return this.children;
    }

    @Override
    public Boolean getHasChildren(){
        if (Func.isNotEmpty(this.children)) {
            return true;
        }
        return false;
    }

    @ApiModelProperty(value = "组织人员")
    private List<OrgDeptUserTreeVO> orgUserList;

	@ApiModelProperty(value = "人员数量")
	private Integer count;

    @Deprecated
    @ApiModelProperty(value = "部门主管名称")
    private String deptOrgUserName;

    @ApiModelProperty(value = "层级编号")
    private Integer nodeNo;


    @ApiModelProperty(value = "是否是挂接0否1是")
    private Integer isHitch;

   /* @ApiModelProperty(value = "是否是下级组织0否1是")
    private Integer isChildOrg;*/

    @ApiModelProperty(value = "下级组织绑定关系id")
    private Long nestDeptBindingId;


    @ApiModelProperty(value = "头像(预留)")
    private String avatar;

}
