/**
 * 
 */
package com.dev.swms.server.model.inventory;

import java.util.Date;
import java.util.Set;

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;

/**
 * @author  dev
 *
 */
public class InventoryApply extends Entity {
	
	/** 定义单据状态 */
	public final static String INPUT = "INPUT";//录入
	public final static String APPLY = "APPLY";//申请
	public final static String CLOSED = "CLOSED";//关闭
	public final static String CANCEL = "CANCEL";//取消
	
	private static final long serialVersionUID = 1L;
	/** 申请单号 */
	private String code;
	/** 申请仓库 */
	private Warehouse applyWarehouse;
	/** 受理仓库 */
	private Warehouse acceptWarehouse;
	/** 货主 */
	private Structure company;
	/** 状态 */
	private String status;
	/** 申请数量 */
	private double quantity;
	/** 申请日期 */
	private Date applyDate;
	/** 描述 */
	private String description;
	/** 补货单明细记录 */
	private Set<InventoryApplyDetail> inventoryApplyDetails;
	
	
	public Warehouse getAcceptWarehouse() {
		return acceptWarehouse;
	}

	public void setAcceptWarehouse(Warehouse acceptWarehouse) {
		this.acceptWarehouse = acceptWarehouse;
	}

	public Date getApplyDate() {
		return applyDate;
	}

	public void setApplyDate(Date applyDate) {
		this.applyDate = applyDate;
	}

	public Warehouse getApplyWarehouse() {
		return applyWarehouse;
	}

	public void setApplyWarehouse(Warehouse applyWarehouse) {
		this.applyWarehouse = applyWarehouse;
	}

	public String getCode() {
		return code;
	}

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

	public Structure getCompany() {
		return company;
	}

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

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<InventoryApplyDetail> getInventoryApplyDetails() {
		return inventoryApplyDetails;
	}

	public void setInventoryApplyDetails(
			Set<InventoryApplyDetail> inventoryApplyDetails) {
		this.inventoryApplyDetails = inventoryApplyDetails;
	}

	public double getQuantity() {
		return quantity;
	}

	public void setQuantity(double quantity) {
		this.quantity = quantity;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof Task))
			return false;
		InventoryApply castOther = (InventoryApply) other;
		return new EqualsBuilder().append(code, castOther.getCode()).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(code).toHashCode();
	}

}
