package com.zhyc.module.sale.domain;

import java.math.BigDecimal;
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;

/**
 * 羊只销售记录对象 sx_sheep_sale
 *
 * @author ruoyi
 * @date 2025-08-19
 */
public class SxSheepSale extends BaseEntity {
    private static final long serialVersionUID = 1L;

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

    /** 耳号 */
    @Excel(name = "耳号")
    private String bsManageTags;

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

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

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

    /** 羊只类别快照 */
    @Excel(name = "羊只类别")
    private String sheepName;

    /** 性别快照 */
    @Excel(name = "性别")
    private String gender;

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

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

    /** 【新增】当前重量（档案关联生成） */
    @Excel(name = "当前重量(kg)")
    private BigDecimal currentWeight;

    /** 计价方式 */
    @Excel(name = "计价方式")
    private String pricingMethod;

    /** 单价 */
    @Excel(name = "单价")
    private BigDecimal unitPrice;

    /** 重量（单只羊重量：单只时为总体重，多只时为平均重） - 对应数据库 avg_weight */
    @Excel(name = "重量(kg)")
    private BigDecimal avgWeight;

    /** 单只羊价格（单只羊销售时填的总价或计算的总价；多只羊销售时计算出每只羊的平均价格） */
    @Excel(name = "单只羊价格(元)")
    private BigDecimal avgPricePerSheep;

    /** 销售类别（dict_type = sale_type） */
    @Excel(name = "销售类别", dictType = "sale_type")
    private String saleType;

    /** 【非数据库字段】客户名称 */
    @Excel(name = "客户名称")
    private String customerName;

    /** 【非数据库字段】客户电话 */
    @Excel(name = "客户电话")
    private String customerPhone;

    /** 【新增】【非数据库字段】所在地区 */
    @Excel(name = "所在地区")
    private String customerArea;

    /** 【非数据库字段】客户地址 */
    @Excel(name = "详细地址")
    private String customerAddress;

    /** 【非数据库字段】销售人员姓名 */
    @Excel(name = "销售人员")
    private String salesPersonName;

    /** 检疫证号 */
    @Excel(name = "检疫证号")
    private String quarantineNo;

    /** 审批编号 */
    @Excel(name = "审批编号")
    private String approvalNo;

    /** 疾病类型（dict_type = disease_type） */
    @Excel(name = "疾病类型", dictType = "disease_type")
    private String diseaseType;

    /** 次要原因 */
    @Excel(name = "次要原因")
    private String secondaryReason;

    /** 【非数据库字段】羊舍名称 */
    @Excel(name = "羊舍")
    private String sheepfoldName;

    /** 班组（dict_type = group） */
    @Excel(name = "班组", dictType = "group")
    private String groupCode;

    /** 繁育状态快照 */
    @Excel(name = "繁育状态")
    private String breed;

    /** 产后天数快照 */
    @Excel(name = "销售时产后天数")
    private Long postLambingDay;

    /** 泌乳天数快照 */
    @Excel(name = "销售时泌乳天数")
    private Long lactationDay;

    /** 怀孕天数快照 */
    @Excel(name = "销售时怀孕天数")
    private Long lambingDay;

    /** 【非数据库字段】技术员姓名 */
    @Excel(name = "技术员")
    private String technicianName;

    /** 【非数据库字段】处理人姓名 */
    @Excel(name = "处理人")
    private String handlerName;

    /** 【非数据库字段】创建人姓名 */
    @Excel(name = "创建人")
    private String createdByName;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    // --- 以下字段在导出中不显示，但在业务中需要 ---

    /** 总价（自动计算） */
    private BigDecimal totalPrice;

    /** 总体重（按体重时输入） */
    private BigDecimal totalWeight;

    /** 羊舍ID（当时销售的羊舍） */
    private Long sheepfoldId;

    /** 客户ID（sx_customer.id） */
    private Long customerId;

    /** 销售人员ID（sys_user.id） */
    private Long salesPersonId;

    /** 技术员ID（sys_user.id） */
    private Long technicianId;

    /** 处理人ID（sys_user.id） */
    private Long handlerId;

    /** 创建人ID（sys_user.id） */
    private Long createdBy;

    /** 用户ID */
    private Long userId;

    /** 部门ID */
    private Long deptId;

    // --- 非数据库辅助字段 ---

    /** 【新增】非数据库字段：用于前端展示和选择羊舍后传递多个耳号 */
    private List<String> bsManageTagsList;

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

    public Long getId() {
        return id;
    }

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

    public String getBsManageTags() {
        return bsManageTags;
    }

    public void setSheepfoldId(Long sheepfoldId) {
        this.sheepfoldId = sheepfoldId;
    }

    public Long getSheepfoldId() {
        return sheepfoldId;
    }

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

    public String getVariety() {
        return variety;
    }

    public void setSheepName(String sheepName) {
        this.sheepName = sheepName;
    }

    public String getSheepName() {
        return sheepName;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getGender() {
        return gender;
    }

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

    public Long getMonthAge() {
        return monthAge;
    }

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

    public Long getParity() {
        return parity;
    }

    public void setBreed(String breed) {
        this.breed = breed;
    }

    public String getBreed() {
        return breed;
    }

    public void setPostLambingDay(Long postLambingDay) {
        this.postLambingDay = postLambingDay;
    }

    public Long getPostLambingDay() {
        return postLambingDay;
    }

    public void setLactationDay(Long lactationDay) {
        this.lactationDay = lactationDay;
    }

    public Long getLactationDay() {
        return lactationDay;
    }

    public void setLambingDay(Long lambingDay) {
        this.lambingDay = lambingDay;
    }

    public Long getLambingDay() {
        return lambingDay;
    }

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

    public String getEventType() {
        return eventType;
    }

    public void setSaleDate(Date saleDate) {
        this.saleDate = saleDate;
    }

    public Date getSaleDate() {
        return saleDate;
    }

    public void setPricingMethod(String pricingMethod) {
        this.pricingMethod = pricingMethod;
    }

    public String getPricingMethod() {
        return pricingMethod;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalWeight(BigDecimal totalWeight) {
        this.totalWeight = totalWeight;
    }

    public BigDecimal getTotalWeight() {
        return totalWeight;
    }

    public void setAvgWeight(BigDecimal avgWeight) {
        this.avgWeight = avgWeight;
    }

    public BigDecimal getAvgWeight() {
        return avgWeight;
    }

    public void setAvgPricePerSheep(BigDecimal avgPricePerSheep) {
        this.avgPricePerSheep = avgPricePerSheep;
    }

    public BigDecimal getAvgPricePerSheep() {
        return avgPricePerSheep;
    }

    public void setSaleType(String saleType) {
        this.saleType = saleType;
    }

    public String getSaleType() {
        return saleType;
    }

    public void setDiseaseType(String diseaseType) {
        this.diseaseType = diseaseType;
    }

    public String getDiseaseType() {
        return diseaseType;
    }

    public void setSecondaryReason(String secondaryReason) {
        this.secondaryReason = secondaryReason;
    }

    public String getSecondaryReason() {
        return secondaryReason;
    }

    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }

    public String getGroupCode() {
        return groupCode;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setSalesPersonId(Long salesPersonId) {
        this.salesPersonId = salesPersonId;
    }

    public Long getSalesPersonId() {
        return salesPersonId;
    }

    public void setQuarantineNo(String quarantineNo) {
        this.quarantineNo = quarantineNo;
    }

    public String getQuarantineNo() {
        return quarantineNo;
    }

    public void setApprovalNo(String approvalNo) {
        this.approvalNo = approvalNo;
    }

    public String getApprovalNo() {
        return approvalNo;
    }

    public void setTechnicianId(Long technicianId) {
        this.technicianId = technicianId;
    }

    public Long getTechnicianId() {
        return technicianId;
    }

    public void setHandlerId(Long handlerId) {
        this.handlerId = handlerId;
    }

    public Long getHandlerId() {
        return handlerId;
    }

    public void setCreatedBy(Long createdBy) {
        this.createdBy = createdBy;
    }

    public Long getCreatedBy() {
        return createdBy;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public List<String> getBsManageTagsList() {
        return bsManageTagsList;
    }

    public void setBsManageTagsList(List<String> bsManageTagsList) {
        this.bsManageTagsList = bsManageTagsList;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCustomerPhone() {
        return customerPhone;
    }

    public void setCustomerPhone(String customerPhone) {
        this.customerPhone = customerPhone;
    }

    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    public String getSalesPersonName() {
        return salesPersonName;
    }

    public void setSalesPersonName(String salesPersonName) {
        this.salesPersonName = salesPersonName;
    }

    public String getTechnicianName() {
        return technicianName;
    }

    public void setTechnicianName(String technicianName) {
        this.technicianName = technicianName;
    }

    public String getHandlerName() {
        return handlerName;
    }

    public void setHandlerName(String handlerName) {
        this.handlerName = handlerName;
    }

    public String getCreatedByName() {
        return createdByName;
    }

    public void setCreatedByName(String createdByName) {
        this.createdByName = createdByName;
    }

    public String getSheepfoldName() {
        return sheepfoldName;
    }

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

    public BigDecimal getCurrentWeight() {
        return currentWeight;
    }

    public void setCurrentWeight(BigDecimal currentWeight) {
        this.currentWeight = currentWeight;
    }

    public String getCustomerArea() {
        return customerArea;
    }

    public void setCustomerArea(String customerArea) {
        this.customerArea = customerArea;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("bsManageTags", getBsManageTags())
                .append("sheepfoldId", getSheepfoldId())
                .append("variety", getVariety())
                .append("sheepName", getSheepName())
                .append("gender", getGender())
                .append("monthAge", getMonthAge())
                .append("parity", getParity())
                .append("breed", getBreed())
                .append("postLambingDay", getPostLambingDay())
                .append("lactationDay", getLactationDay())
                .append("lambingDay", getLambingDay())
                .append("eventType", getEventType())
                .append("saleDate", getSaleDate())
                .append("pricingMethod", getPricingMethod())
                .append("unitPrice", getUnitPrice())
                .append("totalPrice", getTotalPrice())
                .append("totalWeight", getTotalWeight())
                .append("avgWeight", getAvgWeight())
                .append("avgPricePerSheep", getAvgPricePerSheep())
                .append("saleType", getSaleType())
                .append("diseaseType", getDiseaseType())
                .append("secondaryReason", getSecondaryReason())
                .append("groupCode", getGroupCode())
                .append("customerId", getCustomerId())
                .append("salesPersonId", getSalesPersonId())
                .append("quarantineNo", getQuarantineNo())
                .append("approvalNo", getApprovalNo())
                .append("technicianId", getTechnicianId())
                .append("handlerId", getHandlerId())
                .append("createdBy", getCreatedBy())
                .append("createdAt", getCreatedAt())
                .append("userId", getUserId())
                .append("deptId", getDeptId())
                .append("remark", getRemark())
                .append("customerName", getCustomerName())
                .append("customerPhone", getCustomerPhone())
                .append("customerAddress", getCustomerAddress())
                .append("customerArea", getCustomerArea())
                .append("salesPersonName", getSalesPersonName())
                .append("technicianName", getTechnicianName())
                .append("handlerName", getHandlerName())
                .append("createdByName", getCreatedByName())
                .append("sheepfoldName", getSheepfoldName())
                .append("currentWeight", getCurrentWeight())
                .toString();
    }
}