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

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.BaseEntity;
import java.util.Date;

/**
 * 配种记录对象 sc_breed_record
 *
 * @author ruoyi
 * @date 2025-07-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ScBreedRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    // ===================== 基础主键/关联ID字段 =====================
    // 基础关联ID
    private Long id;
    private Long sheepId;
    private String ramId;
    private String eweId;

    // --- 导出及表单顺序 ---
    @Excel(name = "耳号")
    private String eweManageTags; // 母羊耳号

    @Excel(name = "品种")
    private String eweVariety;

    @Excel(name = "事件类型")
    private String eventType = "配种";

    // 核心注解：指定JSON解析/序列化的日期格式，时区指定为东八区（Asia/Shanghai）
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    @Excel(name = "配种日期", dateFormat = "yyyy-MM-dd")
    private Date createTime;

    @Excel(name = "配种公羊")
    private String ramManageTags;

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

    @Excel(name = "供体母羊")
    private String donorEweNo;

    @Excel(name = "供体母羊品种")
    private String donorEweVariety;

    @Excel(name = "供体公羊")
    private String donorRamNo;

    @Excel(name = "供体公羊品种")
    private String donorRamVariety;

    @Excel(name = "移胚数")
    private Integer embryoCount;

    /** 1-同期发情, 2-本交, 3-自然发情, 4-胚胎移植 */
    @Excel(name = "配种方式", readConverterExp = "1=供体母羊配种,2=同期发情人工授精,3=本交,4=胚胎移植,5=自然发情人工授精")
    private Integer breedType;

    @Excel(name = "配种子类型")
    private String embryoSubType; // 体内/体外 + 冻胚/鲜胚

    @Excel(name = "月龄")
    private Integer eweMonthAge;

    @Excel(name = "配种时羊只类别")
    private String sheepType;

    @Excel(name = "胎次")
    private Integer eweParity;

    @Excel(name = "孕检记录id")
    private Integer pregnancyRecordId;

    @Excel(name = "配次")
    private Integer matingCount;

    @Excel(name = "发情后配种时间")
    private Long timeSincePlanning;

    @Excel(name = "当前羊舍")
    private String eweSheepfoldName;

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

    @Excel(name = "繁殖用药")
    private String breedDrugs;

    @Excel(name = "羊只备注")
    private String eweComment;

    @Excel(name = "繁育状态")
    private String eweBreedStatus;

    @Excel(name = "孕检日期")
    private Date pregnancyCheckDate;

    @Excel(name = "孕检结果")
    private String pregnancyResult;

    @Excel(name = "配种到孕检间隔(天)")
    private Integer daysToPregnancyCheck;


    @Excel(name = "预产日期")
    private Date expectedDate;

    @Excel(name = "实产日期")
    private Date actualLambingDate;

    @Excel(name = "配种时产后天数")
    private Long daysPostLambing; // 距离上一次产羔

    @Excel(name = "配种时泌乳天数")
    private Long daysLactation; // 距离上一次孕检且怀孕

    @Excel(name = "配种时配后天数")
    private Long daysPostMating; // 距离上一次配种

    @Excel(name = "上次配种日期")
    private Date lastMatingDate;

    @Excel(name = "冻精号")
    private String frozenSemenNo; // 新增字段：自行输入

    @Excel(name = "是否性控", readConverterExp = "0=否,1=是")
    private Integer eweControlled;

    @Excel(name = "耗精量")
    private String spermConsumption;

    @Excel(name = "创建人")
    private String createBy;

    @Excel(name = "创建日期")
    private Date createDate;

    @Excel(name = "所在牧场")
    private String ranchName;

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