package com.zhyc.module.produce.breed.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;

/**
 * 流产记录对象 sc_miscarriage_record
 *
 * @author ruoyi
 * @date 2025-08-23
 */
public class ScMiscarriageRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 羊只id */
    private String sheepId;

    /** 事件日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date datetime;

    /** 备注 */
    @Excel(name = "备注")
    private String comment;

    /** 技术员 */
    @Excel(name = "技术员")
    private String technician;

    /** 流产原因 */
    @Excel(name = "流产原因")
    private String reason;

    /** 是否见胎 (1-是, 2-复检无胎, 3-返情) */
    @Excel(name = "是否见胎", readConverterExp = "1=是,2=复检无胎,3=返情")
    private Long exposeType;

    /** 是否列胎次 (1-是, 0-否) */
    @Excel(name = "是否列胎次", readConverterExp = "1=是,0=否")
    private Long status;

    /** 流产羔羊数 */
    @Excel(name = "流产羔羊数")
    private Long miscaLamb;

    // 以下是关联查询字段，不存储到数据库
    /** 管理耳号 */
    @Excel(name = "耳号")
    private String bsManageTags;

    /** 品种 */
    @Excel(name = "品种")
    private String variety;

    /** 事件类型 */
    @Excel(name = "事件类型")
    private String eventType = "流产";

    /** 配种类型ID */
    private Integer matingTypeId;

    /** 配种类型 */
    @Excel(name = "配种类型")
    private String matingTypeName;

    /** 配种日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "配种日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date matingDate;

    /** 胎次 */
    @Excel(name = "胎次")
    private Integer parity;

    /** 配种公羊品种 */
    @Excel(name = "配种公羊品种")
    private String ramVariety;

    /** 月龄 */
    @Excel(name = "月龄")
    private Long monthAge;

    /** 流产时怀孕天数 */
    @Excel(name = "流产时怀孕天数")
    private Integer pregnantDays;

    /** 当前羊舍 */
    @Excel(name = "当前羊舍")
    private String sheepfoldName;

    /** 所在牧场 */
    @Excel(name = "所在牧场")
    private String drRanch;

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

    public Long getId()
    {
        return id;
    }

    public void setSheepId(String sheepId)
    {
        this.sheepId = sheepId;
    }

    public String getSheepId()
    {
        return sheepId;
    }

    public void setDatetime(Date datetime)
    {
        this.datetime = datetime;
    }

    public Date getDatetime()
    {
        return datetime;
    }

    public void setComment(String comment)
    {
        this.comment = comment;
    }

    public String getComment()
    {
        return comment;
    }

    public void setTechnician(String technician)
    {
        this.technician = technician;
    }

    public String getTechnician()
    {
        return technician;
    }

    public void setReason(String reason)
    {
        this.reason = reason;
    }

    public String getReason()
    {
        return reason;
    }

    public void setExposeType(Long exposeType)
    {
        this.exposeType = exposeType;
    }

    public Long getExposeType()
    {
        return exposeType;
    }

    public void setStatus(Long status)
    {
        this.status = status;
    }

    public Long getStatus()
    {
        return status;
    }

    public void setMiscaLamb(Long miscaLamb)
    {
        this.miscaLamb = miscaLamb;
    }

    public Long getMiscaLamb()
    {
        return miscaLamb;
    }

    public String getBsManageTags() {
        return bsManageTags;
    }

    public void setBsManageTags(String bsManageTags) {
        this.bsManageTags = bsManageTags;
    }

    public String getVariety() {
        return variety;
    }

    public void setVariety(String variety) {
        this.variety = variety;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public Integer getMatingTypeId() {
        return matingTypeId;
    }

    public void setMatingTypeId(Integer matingTypeId) {
        this.matingTypeId = matingTypeId;
    }

    public String getMatingTypeName() {
        return matingTypeName;
    }

    public void setMatingTypeName(String matingTypeName) {
        this.matingTypeName = matingTypeName;
    }

    public Date getMatingDate() {
        return matingDate;
    }

    public void setMatingDate(Date matingDate) {
        this.matingDate = matingDate;
    }

    public Integer getParity() {
        return parity;
    }

    public void setParity(Integer parity) {
        this.parity = parity;
    }

    public String getRamVariety() {
        return ramVariety;
    }

    public void setRamVariety(String ramVariety) {
        this.ramVariety = ramVariety;
    }

    public Long getMonthAge() {
        return monthAge;
    }

    public void setMonthAge(Long monthAge) {
        this.monthAge = monthAge;
    }

    public Integer getPregnantDays() {
        return pregnantDays;
    }

    public void setPregnantDays(Integer pregnantDays) {
        this.pregnantDays = pregnantDays;
    }

    public String getSheepfoldName() {
        return sheepfoldName;
    }

    public void setSheepfoldName(String sheepfoldName) {
        this.sheepfoldName = sheepfoldName;
    }

    public String getDrRanch() {
        return drRanch;
    }

    public void setDrRanch(String drRanch) {
        this.drRanch = drRanch;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("sheepId", getSheepId())
                .append("datetime", getDatetime())
                .append("comment", getComment())
                .append("technician", getTechnician())
                .append("reason", getReason())
                .append("exposeType", getExposeType())
                .append("status", getStatus())
                .append("miscaLamb", getMiscaLamb())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("bsManageTags", getBsManageTags())
                .append("variety", getVariety())
                .toString();
    }

    /** 全部羊耳号列表（用于多耳号查询） */
    private List<String> allEarNumbers;

    public List<String> getAllEarNumbers() {
        return allEarNumbers;
    }

    public void setAllEarNumbers(List<String> allEarNumbers) {
        this.allEarNumbers = allEarNumbers;
    }
}