package com.dev.swms.server.service.picking.allocate;

import java.util.Date;

import com.dev.swms.server.model.inventory.Inventory;

/**
 * @author  dev
 *
 */
public class InventoryWrap{
    private Inventory inventory;
    private Date storageDate;
    private Date productionDate;
    private Date expireDate;
    private Integer convertFigure;
    private Integer locationIndex;
    private String locationCode;
    private String locationStatus;
    private double locationUsedRate;
    private Integer lpIndex;
    private Long locationId;
    private double avaliableQuantity;
    private String locationType;
    
	public String getLocationType() {
		return locationType;
	}
	public void setLocationType(String locationType) {
		this.locationType = locationType;
	}
	public Long getLocationId() {
		return locationId;
	}
	public void setLocationId(Long locationId) {
		this.locationId = locationId;
	}
	public double getAvaliableQuantity() {
		return avaliableQuantity;
	}
	public void setAvaliableQuantity(double avaliableQuantity) {
		this.avaliableQuantity = avaliableQuantity;
	}
	public String getLocationStatus() {
		return locationStatus;
	}
	public void setLocationStatus(String locationStatus) {
		this.locationStatus = locationStatus;
	}
	public double getLocationUsedRate() {
		return locationUsedRate;
	}
	public void setLocationUsedRate(double locationUsedRate) {
		this.locationUsedRate = locationUsedRate;
	}
	public Integer getConvertFigure() {
        return convertFigure;
    }
    public void setConvertFigure(Integer convertFigure) {
        this.convertFigure = convertFigure;
    }
    public Date getStorageDate() {
        return storageDate;
    }
    public void setStorageDate(Date storageDate) {
        this.storageDate = storageDate;
    }
    public Inventory getInventory() {
        return inventory;
    }
    public void setInventory(Inventory inventory) {
        this.inventory = inventory;
    }
	public Date getExpireDate() {
		return expireDate;
	}
	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}
	public Integer getLocationIndex() {
		return locationIndex;
	}
	public void setLocationIndex(Integer locationIndex) {
		this.locationIndex = locationIndex;
	}
	public Date getProductionDate() {
		return productionDate;
	}
	public void setProductionDate(Date productionDate) {
		this.productionDate = productionDate;
	}	
	public String getLocationCode() {
		return locationCode;
	}
	public void setLocationCode(String locationCode) {
		this.locationCode = locationCode;
	}	
	public Integer getLpIndex() {
		return lpIndex;
	}
	public void setLpIndex(Integer lpIndex) {
		this.lpIndex = lpIndex;
	}
	
	/**
     * @param inventory
     */
    public InventoryWrap(Inventory inventory) {
        super();
        this.inventory = inventory;
        this.locationIndex = inventory.getLocation().getSortIndex();
        this.locationCode = inventory.getLocation().getCode();
        this.storageDate = inventory.getStorageDate();
        this.convertFigure = inventory.getPackageUnit().getConvertFigure();
        this.productionDate = inventory.getItemKeyInventory().getItemKey().getLotInfo().getPropD1() == null? new Date():inventory.getItemKeyInventory().getItemKey().getLotInfo().getPropD1();
        this.expireDate = inventory.getItemKeyInventory().getItemKey().getLotInfo().getPropD2() == null? new Date():inventory.getItemKeyInventory().getItemKey().getLotInfo().getPropD2();
        this.locationUsedRate = inventory.getLocation().getUsedRate();
       	this.lpIndex = inventory.getLP() == null ? 0 : inventory.getLP().getLocationIndex();
        this.locationStatus = inventory.getLocation().getStatus();
        this.locationId = inventory.getLocation().getId();
        this.locationType = inventory.getLocation().getType();
        this.avaliableQuantity = this.inventory.getAvaliableQuantity();
    }

}

