package com.zhyc.module.frozen.domain;

import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
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;

/**
 * 销售主单对象 dd_sl
 *
 * @author HashMap
 * @date 2025-12-01
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class DdSale extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

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

    /** 客户名称 */
    @Excel(name = "客户名称")
    private String custName;

    /** 客户电话 */
    @Excel(name = "客户电话")
    private String custPhone;

    /** 客户地址 */
    @Excel(name = "客户地址")
    private String custAddr;

    /** 销售人员 */
    @Excel(name = "销售人员")
    private String salesper;

    /** 检疫证号（可选） */
    @Excel(name = "检疫证号", readConverterExp = "可=选")
    private String quaranNo;

    /** 审批编号（可选） */
    @Excel(name = "审批编号", readConverterExp = "可=选")
    private String apprNo;

    /** 总价 */
    @Excel(name = "总价")
    private BigDecimal price;

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

    private Long userId;
    private Long deptId;

    /** 销售明细信息 */
    private List<DdSaleItem> ddSaleItemList;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("saleDate", getSaleDate())
            .append("custName", getCustName())
            .append("custPhone", getCustPhone())
            .append("custAddr", getCustAddr())
            .append("salesper", getSalesper())
            .append("quaranNo", getQuaranNo())
            .append("apprNo", getApprNo())
            .append("price", getPrice())
            .append("tech", getTech())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("ddSaleItemList", getDdSaleItemList())
            .toString();
    }
}
