package com.ruoyi.app.model;

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.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 血码关系对象 slaughter_relation
 * 
 * @author coede
 * @date 2025-03-19
 */
public class SlaughterRelation extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;

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

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

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

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

    private Supplier supplier;

    private Purchaser purchaser;

    public String getCarNum() {
        return carNum;
    }

    public void setCarNum(String carNum) {
        this.carNum = carNum;
    }

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

    public Long getId() 
    {
        return id;
    }


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

    @NotBlank(message = "血码编号不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{2,4}$",message = "血码编号格式输入错误")
    public String getSlaughterCode() 
    {
        return slaughterCode;
    }

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

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

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

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

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

    public String getDelFlag() 
    {
        return delFlag;
    }

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

    public Supplier getSupplier()
    {
        return supplier;
    }

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

    public Purchaser getPurchaser()
    {
        return purchaser;
    }

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