package com.dev.swms.server.model.base;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.dev.energy.server.model.Entity;
import com.dev.energy.server.model.security.User;

public class Worker extends Entity {
	private static final long serialVersionUID = 3893230051717181185L;
	/** 工号 */
	private String code;
	/** 姓名 */
	private String name;
	/** 分类 */
	private String type;
	/** 对应操作员 */
	private User user;
	/** 是否有效 */
	private boolean disabled = false;	
	/** 描述 */
	private String description;
	/** 所属仓库 */
	private Warehouse warehouse;
	/** 所属库区**/
	private WarehouseArea zone;
	
	private String passWord;
	
	/**设备登录号*/
	private String android_token;
	
	public String getPassWord() {
		return passWord;
	}
	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}
	public String getAndroid_token() {
		return android_token;
	}
	public void setAndroid_token(String android_token) {
		this.android_token = android_token;
	}
	@Override
	public boolean equals(final Object other) {
		if (!(other instanceof Worker))
			return false;
		Worker castOther = (Worker) other;
		return new EqualsBuilder().append(code, castOther.code).append(
				warehouse, castOther.warehouse).isEquals();
	}
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(code).append(warehouse)
				.toHashCode();
	}
	
	public Warehouse getWarehouse() {
		return warehouse;
	}
	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}
	public WarehouseArea getZone() {
		return zone;
	}
	public void setZone(WarehouseArea zone) {
		this.zone = zone;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public boolean isDisabled() {
		return disabled;
	}
	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
    protected Worker(){
		
	}
}