package com.ruoyi.app.model;

import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.*;

/**
 * 分销批次对象 distribute_batch
 * 
 * @author coede
 * @date 2025-03-19
 */
public class DistributeBatch extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;

    /** 入场批次ID */
    @Excel(name = "入场批次ID")
    private Long entranceBatchId;

    /** 血码 */
    @Excel(name = "血码")
    private String slaughterCode;

    /** 供应商ID */
    @Excel(name = "供应商ID")
    private Long supplierId;

    /** 肉商ID */
    @Excel(name = "肉商ID")
    private Long purchaserId;

    /** 数量 */
    @Excel(name = "数量")
    private Integer amount;

    /** 重量 */
    @Excel(name = "重量")
    private BigDecimal weight;

    /** 待宰圈号 */
    @Excel(name = "待宰圈号")
    private String pigpenName;

    /** 删除标志 */
    private String delFlag;

    private Purchaser purchaser;

    private Supplier supplier;

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

    public Long getId() 
    {
        return id;
    }

    public void setEntranceBatchId(Long entranceBatchId) 
    {
        this.entranceBatchId = entranceBatchId;
    }

    @NotNull(message = "不存在入场信息")
    public Long getEntranceBatchId() 
    {
        return entranceBatchId;
    }

    public void setSlaughterCode(String slaughterCode) 
    {
        this.slaughterCode = slaughterCode;
    }

    @NotBlank(message = "血码编号不能为空")
    public String getSlaughterCode() 
    {
        return slaughterCode;
    }

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

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

    public void setPurchaserId(Long purchaserId) 
    {
        this.purchaserId = purchaserId;
    }

    @NotNull(message = "肉商ID不能为空")
    public Long getPurchaserId() 
    {
        return purchaserId;
    }

    public void setAmount(Integer amount)
    {
        this.amount = amount;
    }

    public Integer getAmount()
    {
        return amount;
    }

    public void setWeight(BigDecimal weight) 
    {
        this.weight = weight;
    }

    @DecimalMin(value = "0.01", inclusive = true, message = "重量输入超出设定范围限制（0.01~99999.99）")
    @DecimalMax(value = "99999.99", inclusive = true, message = "重量输入超出设定范围限制（0.01~99999.99）")
    @Digits(integer = 5, fraction = 2, message = "重量输入的整数部分不能超过5位，小数部分不能超过2位")
    public BigDecimal getWeight() 
    {
        return weight;
    }

    public void setPigpenName(String pigpenName) 
    {
        this.pigpenName = pigpenName;
    }

    public String getPigpenName() 
    {
        return pigpenName;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    public void setPurchaser(Purchaser purchaser)
    {
        this.purchaser = purchaser;
    }

    public Purchaser getPurchaser()
    {
        return purchaser;
    }

    public void setSupplier(Supplier supplier)
    {
        this.supplier = supplier;
    }

    public Supplier getSupplier()
    {
        return supplier;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("entranceBatchId", getEntranceBatchId())
            .append("slaughterCode", getSlaughterCode())
            .append("supplierId", getSupplierId())
            .append("purchaserId", getPurchaserId())
            .append("amount", getAmount())
            .append("weight", getWeight())
            .append("pigpenName", getPigpenName())
            .append("createTime", getCreateTime())
            .append("createBy", getCreateBy())
            .append("updateTime", getUpdateTime())
            .append("updateBy", getUpdateBy())
            .append("delFlag", getDelFlag())
            .append("purchaser", getPurchaser())
            .append("supplier", getSupplier())
            .toString();
    }
}
