package com.aegis.resource.procurement.domain;

import java.math.BigDecimal;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aegis.common.core.domain.BaseEntity;

/**
 * 供应商报价实体类 resource_procurement_quote
 * 
 * @author aegis
 */
public class ProcurementQuote extends BaseEntity {
    
    private static final long serialVersionUID = 1L;

    /** 报价ID */
    private Long id;

    /** 采购申请ID */
    private Long procurementId;

    /** 供应商ID */
    private Long supplierId;

    /** 供应商名称（关联查询，不持久化） */
    private transient String supplierName;

    /** 总价 */
    private BigDecimal totalPrice;

    /** 预计交货时间 */
    private String eta;

    /** 报价说明 */
    private String note;

    /** 是否中标：0-未中标，1-已中标 */
    private Integer isAwarded;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @NotNull(message = "采购申请ID不能为空")
    public Long getProcurementId() {
        return procurementId;
    }

    public void setProcurementId(Long procurementId) {
        this.procurementId = procurementId;
    }

    @NotNull(message = "供应商ID不能为空")
    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    @NotNull(message = "总价不能为空")
    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    @Size(min = 0, max = 100, message = "预计交货时间长度不能超过100个字符")
    public String getEta() {
        return eta;
    }

    public void setEta(String eta) {
        this.eta = eta;
    }

    @Size(min = 0, max = 500, message = "报价说明长度不能超过500个字符")
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Integer getIsAwarded() {
        return isAwarded;
    }

    public void setIsAwarded(Integer isAwarded) {
        this.isAwarded = isAwarded;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("procurementId", getProcurementId())
            .append("supplierId", getSupplierId())
            .append("totalPrice", getTotalPrice())
            .append("eta", getEta())
            .append("note", getNote())
            .append("isAwarded", getIsAwarded())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}