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

import com.uas.platform.b2b.model.PublicInquiryReply;
import com.uas.platform.b2b.model.PurchaseInquiryReply;
import com.uas.platform.b2b.model.SaleQuotationPrice;

/**
 * 买家ERP系统的采购询价单明细的分段报价明细
 * 
 * @author yingp
 * 
 */
public class InquiryDetailDet {

	private Double idd_lapqty;
	private Double idd_price;

	public Double getIdd_lapqty() {
		return idd_lapqty;
	}

	public void setIdd_lapqty(Double idd_lapqty) {
		this.idd_lapqty = idd_lapqty;
	}

	public Double getIdd_price() {
		return idd_price;
	}

	public void setIdd_price(Double idd_price) {
		this.idd_price = idd_price;
	}

	/**
	 * 转为平台的询价单明细的报价记录
	 * 
	 * @return
	 */
	public PurchaseInquiryReply convert() {
		PurchaseInquiryReply reply = new PurchaseInquiryReply();
		reply.setLapQty(this.idd_lapqty == null ? 0 : this.idd_lapqty);
		return reply;
	}

	public InquiryDetailDet() {

	}

	/**
	 * 转为买家ERP的询价单的报价信息
	 * 
	 * @param reply
	 */
	public InquiryDetailDet(PurchaseInquiryReply reply) {
		this.idd_lapqty = reply.getLapQty();
		this.idd_price = reply.getPrice();
	}

	/**
	 * 转为买家ERP的主动报价的价格信息
	 * 
	 * @param price
	 */
	public InquiryDetailDet(SaleQuotationPrice price) {
		this.idd_lapqty = price.getLapQty();
		this.idd_price = price.getPrice();
	}

	/**
	 * 平台的公共报价转报价单的报价信息转ERP对应的报价信息
	 *
	 * @param reply 平台的公共报价转报价单的报价信息
	 */
	public InquiryDetailDet(PublicInquiryReply reply) {
		this.idd_lapqty = reply.getLapQty();
		this.idd_price = reply.getPrice();
	}

}
