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

import java.util.Date;

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.PackageUnit;
import com.dev.energy.server.model.Entity;
import com.dev.energy.server.util.BeanUtils;

/**
 * @author  dev
 * @description 
 */

public class DeliveryPlanDetail extends Entity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** 配送计划 **/
	private DeliveryPlan deliveryPlan;
	
	private int lineNo;
	/** 项目名称  **/
	private String project;
	
	/** 货品  **/
	private Item item;
	
	/** 包装单位 */
	private PackageUnit packageUnit;

	/** 计划数量  **/
	private double expectedQuantity;
	
	/** 实际数量  **/
	private double quantity;
	
	/** 工位  **/
	private String station;
	
	/** 计划日期  **/
	private Date planDate;
	
	/** 库管组号  **/
	private String warehouse;
	
	/** 配送班 **/
	private String workGroup;
	
	/** 仓库代码 **/
	private String warehouseCode;
	
	/** 描述  **/
	private String description;
	
	public DeliveryPlanDetail(){}
	
	public boolean equals(final Object other) {
		if (!(other instanceof DeliveryPlanDetail))
			return false;
		DeliveryPlanDetail castOther = (DeliveryPlanDetail) other;
		return new EqualsBuilder()
				.append(deliveryPlan, castOther.getDeliveryPlan())
				.append(lineNo, castOther.getLineNo())
				.isEquals();
	}

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

	public DeliveryPlan getDeliveryPlan() {
		return deliveryPlan;
	}

	public void setDeliveryPlan(DeliveryPlan deliveryPlan) {
		this.deliveryPlan = deliveryPlan;
	}

	public int getLineNo() {
		return lineNo;
	}

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

	public String getProject() {
		return project;
	}

	public void setProject(String project) {
		this.project = project;
	}

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public PackageUnit getPackageUnit() {
		return packageUnit;
	}

	public void setPackageUnit(PackageUnit packageUnit) {
		this.packageUnit = packageUnit;
	}

	public double getExpectedQuantity() {
		return expectedQuantity;
	}

	public void setExpectedQuantity(double expectedQuantity) {
		this.expectedQuantity = expectedQuantity;
	}

	public double getQuantity() {
		return quantity;
	}

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

	public String getStation() {
		return station;
	}

	public void setStation(String station) {
		this.station = station;
	}

	public Date getPlanDate() {
		return planDate;
	}

	public void setPlanDate(Date planDate) {
		this.planDate = planDate;
	}

	public String getWarehouse() {
		return warehouse;
	}

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

	public String getWorkGroup() {
		return workGroup;
	}

	public void setWorkGroup(String workGroup) {
		this.workGroup = workGroup;
	}

	public String getDescription() {
		return description;
	}

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

	public String getWarehouseCode() {
		return warehouseCode;
	}

	public void setWarehouseCode(String warehouseCode) {
		this.warehouseCode = warehouseCode;
	}
	
	public ExecutePlanDetail cloneExecutePlanDetail(){
		ExecutePlanDetail epd = new ExecutePlanDetail();
		BeanUtils.copyEntity(epd, this);
		epd.setId(null);
		return epd;
	}
}
