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

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

import com.dev.swms.server.model.base.Structure;
import com.dev.swms.server.model.base.Warehouse;
import com.dev.energy.server.model.Entity;

public class AbcTypeCountRule extends Entity {
	private static final long serialVersionUID = 5041114631999457150L;
	/** 仓库 */
	private Warehouse warehouse;
	/** 货主 */
	private Structure company;
	/** 排序号 */
	private Integer lineNo;
	/** 商品的ABC分类 */
	private String abcType;
	/** 盘点周期【天】*/
	private int cycleDay;
	/** 统计占比 */
	private Double rate = 0.0;
	/** 是否笼车 */
	private boolean beCage = false;

	@Override
	public boolean equals(final Object other) {
		if (!(other instanceof AbcTypeCountRule))
			return false;
		AbcTypeCountRule castOther = (AbcTypeCountRule) other;
		return new EqualsBuilder().append(warehouse, castOther.warehouse)
				.append(company, castOther.company).append(abcType,
						castOther.abcType).isEquals();
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(warehouse).append(company).append(
				abcType).toHashCode();
	}

	public Structure getCompany() {
		return company;
	}

	public void setCompany(Structure company) {
		this.company = company;
	}

	public boolean isBeCage() {
		return beCage;
	}

	public void setBeCage(boolean beCage) {
		this.beCage = beCage;
	}

	public Integer getLineNo() {
		return lineNo;
	}

	public void setLineNo(Integer lineNo) {
		this.lineNo = lineNo;
	}

	public Double getRate() {
		return rate;
	}

	public void setRate(Double rate) {
		this.rate = rate;
	}

	public String getAbcType() {
		return abcType;
	}

	public void setAbcType(String abcType) {
		this.abcType = abcType;
	}

	public int getCycleDay() {
		return cycleDay;
	}

	public void setCycleDay(int cycleDay) {
		this.cycleDay = cycleDay;
	}

	public Warehouse getWarehouse() {
		return warehouse;
	}

	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}
	
}
