/**
 * Copyright &copy; 2013-2017 <a href="http://www.rhcncpa.com/">瑞华会计师事务所</a> All rights reserved.
 */
package com.jeeplus.modules.sys.entity;

import java.util.List;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.jeeplus.common.persistence.TreeEntity;

/**
 * 机构Entity
 * 
 * @author jeeplus
 * @version 2013-05-15
 */
public class Office extends TreeEntity<Office> {

	private static final long serialVersionUID = 1L;
	// private Office parent; // 父级编号
	// private String parentIds; // 所有父级编号
	private Area area; // 归属区域
	private String code; // 机构编码
	// private String name; // 机构名称
	// private Integer sort; // 排序
	private String type; // 机构类型（1：公司；2：部门；3：分公司）
	private String grade; // 机构等级（1：一级；2：二级；3：三级；4：四级）
	private String address; // 联系地址
	private String zipCode; // 邮政编码
	private String master; // 负责人
	private String masterName; // 负责人
	private String phone; // 电话
	private String fax; // 传真
	private String email; // 邮箱
	private String useable;// 是否可用
	private User primaryPerson;// 主负责人
	private User deputyPerson;// 副负责人
	private String logo;// 企业图标
	private List<String> childDeptList;// 快速添加子部门
	private String companyQrcode;//二维码
	private String groupId;//环信群组
	private String groupName;//环信群组
	private String state;//1 加入公司默认部门
	private String iscurrent;//是否当前企业（0是1否）

	private String oldName; 	// 原岗位名称
	private String simpleName; 	// 分公司简称
	private String branchSimpleName; 	// 分公司简称
	private String branchOffice; //分公司id
	private String topCompany;//上级分公司
    private String branchNo; //分公司编号
	private String isSon;

    public Office() {
		super();
		// this.sort = 30;
		this.type = "2";
		this.state = "0";
	}
	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public Office(String id) {
		super(id);
	}

	public List<String> getChildDeptList() {
		return childDeptList;
	}

	public void setChildDeptList(List<String> childDeptList) {
		this.childDeptList = childDeptList;
	}

	public String getOldName() {
		return oldName;
	}

	public void setOldName(String oldName) {
		this.oldName = oldName;
	}

	public String getUseable() {
		return useable;
	}

	public void setUseable(String useable) {
		this.useable = useable;
	}

	public User getPrimaryPerson() {
		return primaryPerson;
	}

	public void setPrimaryPerson(User primaryPerson) {
		this.primaryPerson = primaryPerson;
	}

	public User getDeputyPerson() {
		return deputyPerson;
	}

	public void setDeputyPerson(User deputyPerson) {
		this.deputyPerson = deputyPerson;
	}

	// @JsonBackReference
	// @NotNull
	public Office getParent() {
		return parent;
	}

	public void setParent(Office parent) {
		this.parent = parent;
	}
	//
	// @Length(min=1, max=2000)
	// public String getParentIds() {
	// return parentIds;
	// }
	//
	// public void setParentIds(String parentIds) {
	// this.parentIds = parentIds;
	// }

	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}
	//
	// @Length(min=1, max=100)
	// public String getName() {
	// return name;
	// }
	//
	// public void setName(String name) {
	// this.name = name;
	// }
	//
	// public Integer getSort() {
	// return sort;
	// }
	//
	// public void setSort(Integer sort) {
	// this.sort = sort;
	// }

	@Length(min = 1, max = 1)
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Length(min = 1, max = 1)
	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	@Length(min = 0, max = 255)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	public String getMaster() {
		return master;
	}

	public void setMaster(String master) {
		this.master = master;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Length(min = 0, max = 100)
	public String getCode() {
		return code;
	}

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

	// public String getParentId() {
	// return parent != null && parent.getId() != null ? parent.getId() : "0";
	// }

	@Override
	public String toString() {
		return name;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	@Override
	public boolean equals(Object obj) {
		Office s = (Office) obj;
		return id.equals(s.id) && name.equals(s.name);
	}

	@Override
	public int hashCode() {
		String in = id + name;
		return in.hashCode();

	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getIscurrent() {
		return iscurrent;
	}

	public void setIscurrent(String iscurrent) {
		this.iscurrent = iscurrent;
	}

	public String getCompanyQrcode() {
		return companyQrcode;
	}

	public void setCompanyQrcode(String companyQrcode) {
		this.companyQrcode = companyQrcode;
	}

	public String getMasterName() {
		return masterName;
	}

	public void setMasterName(String masterName) {
		this.masterName = masterName;
	}

	public String getSimpleName() {
		return simpleName;
	}

	public void setSimpleName(String simpleName) {
		this.simpleName = simpleName;
	}

	public String getBranchOffice() {
		return branchOffice;
	}

	public void setBranchOffice(String branchOffice) {
		this.branchOffice = branchOffice;
	}

    public String getBranchSimpleName() {
        return branchSimpleName;
    }

    public void setBranchSimpleName(String branchSimpleName) {
        this.branchSimpleName = branchSimpleName;
    }

	public String getTopCompany() {
		return topCompany;
	}

	public void setTopCompany(String topCompany) {
		this.topCompany = topCompany;
	}

    public String getBranchNo() {
        return branchNo;
    }

    public void setBranchNo(String branchNo) {
        this.branchNo = branchNo;
    }

	public String getIsSon() {
		return isSon;
	}

	public void setIsSon(String isSon) {
		this.isSon = isSon;
	}
}