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;

    /** 羊舍ID（当时销售的羊舍） */
    @Excel(name = "羊舍ID", readConverterExp = "当=时销售的羊舍")
    private Long sheepfoldId;

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

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

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

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

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

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

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

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

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

    /** 事件类型 */
    @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 pricingMethod;

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

    /** 总价（自动计算） */
    @Excel(name = "总价", readConverterExp = "自=动计算")
    private BigDecimal totalPrice;

    /** 总体重（按体重时输入） */
    @Excel(name = "总体重", readConverterExp = "按=体重时输入")
    private BigDecimal totalWeight;

    /** 平均体重（自动） */
    @Excel(name = "平均体重", readConverterExp = "自=动")
    private BigDecimal avgWeight;

    /** 平均单只价格（自动） */
    @Excel(name = "平均单只价格", readConverterExp = "自=动")
    private BigDecimal avgPricePerSheep;

    /** 销售类别（dict_type = sale_type） */
    @Excel(name = "销售类别", readConverterExp = "d=ict_type,==,s=ale_type")
    private String saleType;

    /** 疾病类型（dict_type = disea_type） */
    @Excel(name = "疾病类型", readConverterExp = "d=ict_type,==,d=isea_type")
    private String diseaseType;

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

    /** 班组（dict_type = group） */
    @Excel(name = "班组", readConverterExp = "d=ict_type,==,g=roup")
    private String groupCode;

    /** 客户ID（sx_customer.id） */
    @Excel(name = "客户ID", readConverterExp = "s=x_customer.id")
    private Long customerId;

    /** 销售人员ID（sys_user.id） */
    @Excel(name = "销售人员ID", readConverterExp = "s=ys_user.id")
    private Long salesPersonId;

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

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

    /** 技术员ID（sys_user.id） */
    @Excel(name = "技术员ID", readConverterExp = "s=ys_user.id")
    private Long technicianId;

    /** 处理人ID（sys_user.id） */
    @Excel(name = "处理人ID", readConverterExp = "s=ys_user.id")
    private Long handlerId;

    /** 创建人ID（sys_user.id） */
    @Excel(name = "创建人ID", readConverterExp = "s=ys_user.id")
    private Long createdBy;

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

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

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

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

    // 【新增】非数据库字段：客户名称（从客户表查询）
    private String customerName;
    // 【新增】非数据库字段：客户电话
    private String customerPhone;
    // 【新增】非数据库字段：客户地址
    private String customerAddress;
    // 【新增】非数据库字段：销售人员姓名
    private String salesPersonName;
    // 【新增】非数据库字段：技术员姓名
    private String technicianName;
    // 【新增】非数据库字段：处理人姓名
    private String handlerName;
    // 【新增】非数据库字段：创建人姓名
    private String createdByName;
    // 【新增】非数据库字段：羊舍名称
    private String sheepfoldName;

    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;
    }

    // 【新增】getter 和 setter 方法
    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;
    }

    @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("salesPersonName", getSalesPersonName())
                .append("technicianName", getTechnicianName())
                .append("handlerName", getHandlerName())
                .append("createdByName", getCreatedByName())
                .append("sheepfoldName", getSheepfoldName())
                .toString();
    }
}