package com.ssm.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

@Table(name = "salesman")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Salesman {
    /**
     * id
     */
    @Column(name = "id")
    @Id
    private Long id;

    /**
     * 业务人员类型（0=高管，1=管理员，2=普通员工）
     */
    @Column(name = "staff_type")
    private Integer staffType;

    @Getter
    @Setter
    @Transient
    private Integer type;

    /**
     * 员工编码
     */
    @Column(name = "staff_num")
    private String staffNum;

    /**
     * 员工名称
     */
    @Column(name = "staff_name")
    private String staffName;

    /**
     * 水牌号
     */
    @Column(name = "brand_number")
    private String brandNumber;

    /**
     * 身份证号
     */
    @Column(name = "identity_card")
    private String identityCard;

    /**
     * 业绩
     */
    @Column(name = "achievement_amount")
    private BigDecimal achievementAmount;

    /**
     * 提成
     */
    @Column(name = "commission_amount")
    private BigDecimal commissionAmount;

    /**
     * 单据日期
     */
    @Column(name = "order_date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date orderDate;


    /**
     * 主单据ID
     */
    @Column(name = "order_id")
    private String orderId;

    /**
     * 占比
     */
    @Column(name = "ratio")
    private BigDecimal ratio;

    /**
     * 销售单据类型（0=收银单，1=充值单）
     */
    @Column(name = "order_type")
    private Integer orderType;

    /**
     * 项目ID
     */
    @Column(name = "project_id")
    private Long projectId;

    /**
     * 项目编码
     */
    @Column(name = "project_num")
    private String projectNum;

    /**
     * 单据编码
     */
    @Column(name = "order_num")
    private String orderNum;

    /**
     * 单据金额
     */
    @Column(name = "money")
    private BigDecimal money;


    /**
     * 人员所属门店ID
     */
    @Column(name = "store_id")
    private Long storeId;


    /**
     * 0=正常，1=作废
     */
    @Column(name = "state")
    private Integer state;


    /**
     * 门店编码
     */
    @Column(name = "store_num")
    private String storeNum;

    /**
     * 门店名称
     */
    @Column(name = "store_name")
    private String storeName;

    /**
     * 单据门店ID
     */
    @Column(name = "store_id_order")
    private Long storeIdOrder;

    /**
     * 单据门店ID
     */
    @Column(name = "staff_id")
    private Long staffId;

    /**
     * 操作人
     */
    @Column(name = "operator_by")
    private String operatorBy;

    /**
     * 是否补单0:不是/1:是
     */
    @Column(name = "is_addition")
    private Integer isAddition;

    public Integer getIsAddition() {
        return isAddition;
    }

    public void setIsAddition(Integer isAddition) {
        this.isAddition = isAddition;
    }

    public String getOperatorBy() {
        return operatorBy;
    }

    public void setOperatorBy(String operatorBy) {
        this.operatorBy = operatorBy;
    }

    public Long getId() {
        return id;
    }

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

    public Integer getStaffType() {
        return staffType;
    }

    public void setStaffType(Integer staffType) {
        this.staffType = staffType;
    }

    public String getStaffNum() {
        return staffNum;
    }

    public void setStaffNum(String staffNum) {
        this.staffNum = staffNum;
    }

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public String getBrandNumber() {
        return brandNumber;
    }

    public void setBrandNumber(String brandNumber) {
        this.brandNumber = brandNumber;
    }

    public String getIdentityCard() {
        return identityCard;
    }

    public void setIdentityCard(String identityCard) {
        this.identityCard = identityCard;
    }

    public BigDecimal getAchievementAmount() {
        return achievementAmount;
    }

    public void setAchievementAmount(BigDecimal achievementAmount) {
        this.achievementAmount = achievementAmount;
    }

    public BigDecimal getCommissionAmount() {
        return commissionAmount;
    }

    public void setCommissionAmount(BigDecimal commissionAmount) {
        this.commissionAmount = commissionAmount;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public BigDecimal getRatio() {
        return ratio;
    }

    public void setRatio(BigDecimal ratio) {
        this.ratio = ratio;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public String getProjectNum() {
        return projectNum;
    }

    public void setProjectNum(String projectNum) {
        this.projectNum = projectNum;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getStoreNum() {
        return storeNum;
    }

    public void setStoreNum(String storeNum) {
        this.storeNum = storeNum;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public Long getStoreIdOrder() {
        return storeIdOrder;
    }

    public void setStoreIdOrder(Long storeIdOrder) {
        this.storeIdOrder = storeIdOrder;
    }

    public Long getStaffId() {
        return staffId;
    }

    public void setStaffId(Long staffId) {
        this.staffId = staffId;
    }

    public Salesman() {
    }

    public Salesman(Long id, Integer staffType, String staffNum, String staffName, String brandNumber, String identityCard, BigDecimal achievementAmount, BigDecimal commissionAmount, Date orderDate, String orderId, BigDecimal ratio, Integer orderType, Long projectId, String projectNum, String orderNum, BigDecimal money, Long storeId, Integer state, String storeNum, String storeName, Long storeIdOrder, Long staffId) {
        this.id = id;
        this.staffType = staffType;
        this.staffNum = staffNum;
        this.staffName = staffName;
        this.brandNumber = brandNumber;
        this.identityCard = identityCard;
        this.achievementAmount = achievementAmount;
        this.commissionAmount = commissionAmount;
        this.orderDate = orderDate;
        this.orderId = orderId;
        this.ratio = ratio;
        this.orderType = orderType;
        this.projectId = projectId;
        this.projectNum = projectNum;
        this.orderNum = orderNum;
        this.money = money;
        this.storeId = storeId;
        this.state = state;
        this.storeNum = storeNum;
        this.storeName = storeName;
        this.storeIdOrder = storeIdOrder;
        this.staffId = staffId;
    }

    @Override
    public String toString() {
        return "Salesman{" +
                "id=" + id +
                ", staffType=" + staffType +
                ", staffNum='" + staffNum + '\'' +
                ", staffName='" + staffName + '\'' +
                ", brandNumber='" + brandNumber + '\'' +
                ", identityCard='" + identityCard + '\'' +
                ", achievementAmount=" + achievementAmount +
                ", commissionAmount=" + commissionAmount +
                ", orderDate=" + orderDate +
                ", orderId='" + orderId + '\'' +
                ", ratio=" + ratio +
                ", orderType=" + orderType +
                ", projectId=" + projectId +
                ", projectNum='" + projectNum + '\'' +
                ", orderNum='" + orderNum + '\'' +
                ", money=" + money +
                ", storeId=" + storeId +
                ", state=" + state +
                ", storeNum='" + storeNum + '\'' +
                ", storeName='" + storeName + '\'' +
                ", storeIdOrder=" + storeIdOrder +
                ", staffId=" + staffId +
                '}';
    }
}
