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.Item;
import com.dev.swms.server.model.base.Warehouse;
import com.dev.energy.server.model.Entity;

public class ItemStorageRule extends Entity {
	private static final long serialVersionUID = 6730693679716904465L;
	/**
	 * 仓库
	 */
	private Warehouse warehouse;
	/**
	 * 货品
	 */
	private Item item;
	/** 
	 * 上架分类 
	 */
	private String itemPutawayType;
	/** 
	 * 捡货分类 
	 */
	private String itemPickType;	
	/**
	 * ABC分类
	 */
	private AbcTypeCountRule abcType;
	/**
	 * ABC统计分类
	 */
	private AbcTypeCountRule abcCountType;
	/** 
	 * 安全库存上限
	 */
	private Double maxStock = 0D;
	/** 
	 * 安全库存下限
	 */
	private Double minStock = 0D;		
	/** 
	 * 补货仓库 
	 */
	private Warehouse replenishmentWarehouse;
	
	/** ABC分析运算辅助字段 */
	private Double shipQuantity = 0D;
	private Double shipWeight = 0D;
	private Double shipVolume = 0D;

	public boolean equals(final Object other) {
		if (!(other instanceof ItemStorageRule))
			return false;
		ItemStorageRule castOther = (ItemStorageRule) other;
		return new EqualsBuilder().append(warehouse, castOther.getWarehouse())
				.append(item, castOther.getItem()).isEquals();
	}
	public int hashCode() {
		return new HashCodeBuilder().append(warehouse).append(item)
				.toHashCode();
	}
	
	public AbcTypeCountRule getAbcType() {
		return abcType;
	}
	public void setAbcType(AbcTypeCountRule abcType) {
		this.abcType = abcType;
	}
	public AbcTypeCountRule getAbcCountType() {
		return abcCountType;
	}
	public void setAbcCountType(AbcTypeCountRule abcCountType) {
		this.abcCountType = abcCountType;
	}
	public String getItemPickType() {
		return itemPickType;
	}
	public void setItemPickType(String itemPickType) {
		this.itemPickType = itemPickType;
	}
	public String getItemPutawayType() {
		return itemPutawayType;
	}
	public void setItemPutawayType(String itemPutawayType) {
		this.itemPutawayType = itemPutawayType;
	}
	public Item getItem() {
		return item;
	}
	public void setItem(Item item) {
		this.item = item;
	}	
	public Warehouse getWarehouse() {
		return warehouse;
	}
	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}
	public Double getMaxStock() {
		return maxStock;
	}
	public void setMaxStock(Double maxStock) {
		this.maxStock = maxStock;
	}
	public Double getMinStock() {
		return minStock;
	}
	public void setMinStock(Double minStock) {
		this.minStock = minStock;
	}
	public Warehouse getReplenishmentWarehouse() {
		return replenishmentWarehouse;
	}
	public void setReplenishmentWarehouse(Warehouse replenishmentWarehouse) {
		this.replenishmentWarehouse = replenishmentWarehouse;
	}
	public Double getShipQuantity() {
		return shipQuantity;
	}
	public void setShipQuantity(Double shipQuantity) {
		this.shipQuantity = shipQuantity;
	}
	public Double getShipWeight() {
		return shipWeight;
	}
	public void setShipWeight(Double shipWeight) {
		this.shipWeight = shipWeight;
	}
	public Double getShipVolume() {
		return shipVolume;
	}
	public void setShipVolume(Double shipVolume) {
		this.shipVolume = shipVolume;
	}

}
