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_lambing_record
 *
 * @author ruoyi
 * @date 2025-07-11
 */
public class ScLambingRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

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

    /** 羊只id */
    @Excel(name = "羊只id")
    private String sheepId;

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

    /** 产羔数量 */
    @Excel(name = "产羔数量")
    private Long lambsBorn;

    /** 活羔数量 */
    @Excel(name = "活羔数量")
    private Long survival;

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

    /** 产羔评分 */
    @Excel(name = "产羔评分")
    private Long score;

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

    /** 创建日期 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createTime;  // 改为 createTime

    // ========== 关联查询字段（简化版） ==========

    /** 母羊耳号 */
    @Excel(name = "母羊耳号")
    private String femaleEarNumber;

    /** 母羊品种 */
    @Excel(name = "母羊品种")
    private String femaleBreed;

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

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

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

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

    /** 公羊耳号 */
    @Excel(name = "公羊耳号")
    private String maleEarNumber;

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

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

    /** 折损数（计算字段） */
    @Excel(name = "折损数")
    private Integer loss;

    /** 公羔数量（从羊只信息表统计） */
    @Excel(name = "公羔数量")
    private Integer maleCount;

    /** 母羔数量（从羊只信息表统计） */
    @Excel(name = "母羔数量")
    private Integer femaleCount;

    /** 留养公羔数量 */
    @Excel(name = "留养公羔数量")
    private Integer retainedMaleCount;

    /** 留养母羔数量 */
    @Excel(name = "留养母羔数量")
    private Integer retainedFemaleCount;

    /** 未留养公羔数量 */
    @Excel(name = "未留养公羔数量")
    private Integer unretainedMaleCount;

    /** 未留养母羔数量 */
    @Excel(name = "未留养母羔数量")
    private Integer unretainedFemaleCount;

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

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

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

    /** 羔羊信息列表（从羊只信息表查询） */
    private List<SheepLambInfo> lambInfoList;

    private List<ScLambDetail> lambDetails;

    // ========== 原有getter和setter方法 ==========

    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 setParity(Long parity)
    {
        this.parity = parity;
    }

    public Long getParity()
    {
        return parity;
    }

    public void setLambsBorn(Long lambsBorn)
    {
        this.lambsBorn = lambsBorn;
    }

    public Long getLambsBorn()
    {
        return lambsBorn;
    }

    public void setSurvival(Long survival)
    {
        this.survival = survival;
    }

    public Long getSurvival()
    {
        return survival;
    }

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

    public String getTechnician()
    {
        return technician;
    }

    public void setScore(Long score)
    {
        this.score = score;
    }

    public Long getScore()
    {
        return score;
    }

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

    public String getComment()
    {
        return comment;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public Date getCreateTime()
    {
        return createTime;
    }

    // ========== 简化版关联字段的getter和setter方法 ==========

    public String getFemaleEarNumber() {
        return femaleEarNumber;
    }

    public void setFemaleEarNumber(String femaleEarNumber) {
        this.femaleEarNumber = femaleEarNumber;
    }

    public String getFemaleBreed() {
        return femaleBreed;
    }

    public void setFemaleBreed(String femaleBreed) {
        this.femaleBreed = femaleBreed;
    }

    public Integer getMonthAge() {
        return monthAge;
    }

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

    public String getCurrentShed() {
        return currentShed;
    }

    public void setCurrentShed(String currentShed) {
        this.currentShed = currentShed;
    }

    public String getFarm() {
        return farm;
    }

    public void setFarm(String farm) {
        this.farm = farm;
    }

    public Date getBreedingDate() {
        return breedingDate;
    }

    public void setBreedingDate(Date breedingDate) {
        this.breedingDate = breedingDate;
    }

    public String getMaleEarNumber() {
        return maleEarNumber;
    }

    public void setMaleEarNumber(String maleEarNumber) {
        this.maleEarNumber = maleEarNumber;
    }

    public String getMaleBreed() {
        return maleBreed;
    }

    public void setMaleBreed(String maleBreed) {
        this.maleBreed = maleBreed;
    }


    public Integer getPregnancyDays() {
        return pregnancyDays;
    }

    public void setPregnancyDays(Integer pregnancyDays) {
        this.pregnancyDays = pregnancyDays;
    }

    public Integer getLoss() {
        return loss;
    }

    public void setLoss(Integer loss) {
        this.loss = loss;
    }

    public Integer getMaleCount() {
        return maleCount;
    }

    public void setMaleCount(Integer maleCount) {
        this.maleCount = maleCount;
    }

    public Integer getFemaleCount() {
        return femaleCount;
    }

    public void setFemaleCount(Integer femaleCount) {
        this.femaleCount = femaleCount;
    }

    public Integer getRetainedMaleCount() {
        return retainedMaleCount;
    }

    public void setRetainedMaleCount(Integer retainedMaleCount) {
        this.retainedMaleCount = retainedMaleCount;
    }

    public Integer getRetainedFemaleCount() {
        return retainedFemaleCount;
    }

    public void setRetainedFemaleCount(Integer retainedFemaleCount) {
        this.retainedFemaleCount = retainedFemaleCount;
    }

    public Integer getUnretainedMaleCount() {
        return unretainedMaleCount;
    }

    public void setUnretainedMaleCount(Integer unretainedMaleCount) {
        this.unretainedMaleCount = unretainedMaleCount;
    }

    public Integer getUnretainedFemaleCount() {
        return unretainedFemaleCount;
    }

    public void setUnretainedFemaleCount(Integer unretainedFemaleCount) {
        this.unretainedFemaleCount = unretainedFemaleCount;
    }

    public List<SheepLambInfo> getLambInfoList() {
        return lambInfoList;
    }

    public void setLambInfoList(List<SheepLambInfo> lambInfoList) {
        this.lambInfoList = lambInfoList;
    }

    public List<ScLambDetail> getLambDetails() {
        return lambDetails;
    }

    public void setLambDetails(List<ScLambDetail> lambDetails) {
        this.lambDetails = lambDetails;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("sheepId", getSheepId())
                .append("parity", getParity())
                .append("lambsBorn", getLambsBorn())
                .append("survival", getSurvival())
                .append("technician", getTechnician())
                .append("score", getScore())
                .append("comment", getComment())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())  // 改为 createTime
                .append("femaleEarNumber", getFemaleEarNumber())
                .append("femaleBreed", getFemaleBreed())
                .append("farm", getFarm())
                .toString();
    }
}

