package com.uas.platform.b2b.erp.model;

import java.util.Date;

import com.uas.platform.b2b.model.Product;
import com.uas.platform.b2b.model.PurchaseForecastAllItem;
import com.uas.platform.b2b.support.SystemSession;
import com.uas.platform.core.model.Status;

public class PurchaseForecastDetail {
	private Long pfd_id;
	private Short pfd_detno;
	private String pfd_prodcode;
	private Double pfd_qty;
	private String pfd_remark;
	private Date pfd_delivery;
	private Long ve_uu;
	private Long ve_contactuu;
	public Long getPfd_id() {
		return pfd_id;
	}
	public void setPfd_id(Long pfd_id) {
		this.pfd_id = pfd_id;
	}
	public Short getPfd_detno() {
		return pfd_detno;
	}
	public void setPfd_detno(Short pfd_detno) {
		this.pfd_detno = pfd_detno;
	}
	public String getPfd_prodcode() {
		return pfd_prodcode;
	}
	public void setPfd_prodcode(String pfd_prodcode) {
		this.pfd_prodcode = pfd_prodcode;
	}
	public Double getPfd_qty() {
		return pfd_qty;
	}
	public void setPfd_qty(Double pfd_qty) {
		this.pfd_qty = pfd_qty;
	}
	public String getPfd_remark() {
		return pfd_remark;
	}
	public void setPfd_remark(String pfd_remark) {
		this.pfd_remark = pfd_remark;
	}
	public Date getPfd_delivery() {
		return pfd_delivery;
	}
	public void setPfd_delivery(Date pfd_delivery) {
		this.pfd_delivery = pfd_delivery;
	}
	public Long getVe_uu() {
		return ve_uu;
	}
	public void setVe_uu(Long ve_uu) {
		this.ve_uu = ve_uu;
	}
	public Long getVe_contactuu() {
		return ve_contactuu;
	}
	public void setVe_contactuu(Long ve_contactuu) {
		this.ve_contactuu = ve_contactuu;
	}

	/**
	 * 转为平台的采购预测单明细
	 * 
	 * @return
	 */
	public PurchaseForecastAllItem convert() {
		PurchaseForecastAllItem item = new PurchaseForecastAllItem();
		item.setDelivery(this.pfd_delivery);
		item.setNumber(this.pfd_detno);		
		item.setQty(this.pfd_qty);
		item.setVendUU(this.ve_uu);
		item.setVendUserUU(this.ve_contactuu);//买方ERP中供应商资料中的供应商联系人
		item.setRemark(pfd_remark);
		Product product = new Product();
		product.setCode(this.pfd_prodcode);
		product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
		item.setProduct(product);
		item.setSendStatus((short) Status.NOT_UPLOAD.value());
		return item;
	}
}
