package com.ssm.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ssm.manage.response.RechargeAccountResponse;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

@Table(name = "refund_order_list")
public class RefundOrderList implements Serializable {
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Transient
    @Getter@Setter
    private Date startTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Getter@Setter@Transient
    private Date endTime;
    @Getter
    @Setter

    private List<PayList> payLists;

    @Transient
    @Getter
    @Setter
    private BigDecimal refundGiftMoney;


    @Getter
    @Setter
    private List<RechargeAccountResponse> rechargeAccountResponses;

    @Getter
    @Setter
    private List<RechargeAccountGive> rechargeAccountGiveList;

    @Setter
    @Getter
    @Transient
    private BigDecimal cardAmount;
    @Setter
    @Getter
    @Transient
    private BigDecimal cashAmount;
    /**
     * 主键ID
     */
    @Id
    private Long id;

    /**
     * 退款单据号
     */
    @Column(name = "refund_num")
    private String refundNum;

    /**
     * 类别0:充值/1:疗程/2:收银
     */
    private Integer type;

    /**
     * 退款单据时间
     */
    @Column(name = "refund_date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date refundDate;

    /**
     * 门店编码
     */
    @Column(name = "store_id")
    private Long storeId;

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

    /**
     * 会员编码
     */
    @Column(name = "member_id")
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(name = "member_name")
    private String memberName;

    /**
     * 会员身份证号
     */
    @Column(name = "member_identity_card")
    private String memberIdentityCard;

    /**
     * 手机
     */
    @Column(name = "mobile_phone")
    private String mobilePhone;

    /**
     * 退款金额
     */
    @Column(name = "refund_money")
    private BigDecimal refundMoney;

    /**
     * 补偿金额
     */
    private BigDecimal compensation;

    /**
     * 状态 0:添加/1:送审/2:回收/3:审核/4:反审核
     */
    private Integer state;

    /**
     * 录单人ID
     */
    @Column(name = "input_id")
    private Long inputId;

    /**
     * 录单人名称
     */
    @Column(name = "input_by")
    private String inputBy;

    /**
     * 审核时间
     */
    @Column(name = "audit_date")
    private Date auditDate;

    /**
     * 审核人ID
     */
    @Column(name = "audit_id")
    private Long auditId;

    /**
     * 审核人名称
     */
    @Column(name = "audit_by")
    private String auditBy;

    /**
     * 实际退款金额
     */
    @Column(name = "actual_refund_money")
    private BigDecimal actualRefundMoney;

    /**
     * 充值退款金额
     */
    @Column(name = "rec_refund_money")
    private BigDecimal recRefundMoney;

    /**
     * 疗程退款金额
     */
    @Column(name = "couse_refund_money")
    private BigDecimal couseRefundMoney;

    /**
     * 来源单号
     */
    @Column(name = "source_doc_num")
    private String sourceDocNum;

    /**
     * 退款方式
     */
    @Column(name = "refund_type")
    private String refundType;

    /**
     * 退款账户
     */
    @Column(name = "refund_account")
    private String refundAccount;

    /**
     * 收款人
     */
    private String payee;

    /**
     * 退款原因
     */
    @Column(name = "refund_reason")
    private String refundReason;

    @Transient
    private List<Salesman> salesmens;

    @Transient
    private String storeNum;

    public String getStoreNum() {
        return storeNum;
    }

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

    public List<Salesman> getSalesmens() {
        return salesmens;
    }

    public void setSalesmens(List<Salesman> salesmens) {
        this.salesmens = salesmens;
    }

    private static final long serialVersionUID = 1L;

    /**
     * 获取主键ID
     *
     * @return id - 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置主键ID
     *
     * @param id 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取退款单据号
     *
     * @return refund_num - 退款单据号
     */
    public String getRefundNum() {
        return refundNum;
    }

    /**
     * 设置退款单据号
     *
     * @param refundNum 退款单据号
     */
    public void setRefundNum(String refundNum) {
        this.refundNum = refundNum;
    }

    /**
     * 获取类别0:充值/1:疗程/2:收银
     *
     * @return type - 类别0:充值/1:疗程/2:收银
     */
    public Integer getType() {
        return type;
    }

    /**
     * 设置类别0:充值/1:疗程/2:收银
     *
     * @param type 类别0:充值/1:疗程/2:收银
     */
    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * 获取退款单据时间
     *
     * @return refund_date - 退款单据时间
     */
    public Date getRefundDate() {
        return refundDate;
    }

    /**
     * 设置退款单据时间
     *
     * @param refundDate 退款单据时间
     */
    public void setRefundDate(Date refundDate) {
        this.refundDate = refundDate;
    }

    /**
     * 获取门店编码
     *
     * @return store_id - 门店编码
     */
    public Long getStoreId() {
        return storeId;
    }

    /**
     * 设置门店编码
     *
     * @param storeId 门店编码
     */
    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    /**
     * 获取门店名称
     *
     * @return store_name - 门店名称
     */
    public String getStoreName() {
        return storeName;
    }

    /**
     * 设置门店名称
     *
     * @param storeName 门店名称
     */
    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    /**
     * 获取会员编码
     *
     * @return member_id - 会员编码
     */
    public Long getMemberId() {
        return memberId;
    }

    /**
     * 设置会员编码
     *
     * @param memberId 会员编码
     */
    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    /**
     * 获取会员名称
     *
     * @return member_name - 会员名称
     */
    public String getMemberName() {
        return memberName;
    }

    /**
     * 设置会员名称
     *
     * @param memberName 会员名称
     */
    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    /**
     * 获取会员身份证号
     *
     * @return member_identity_card - 会员身份证号
     */
    public String getMemberIdentityCard() {
        return memberIdentityCard;
    }

    /**
     * 设置会员身份证号
     *
     * @param memberIdentityCard 会员身份证号
     */
    public void setMemberIdentityCard(String memberIdentityCard) {
        this.memberIdentityCard = memberIdentityCard;
    }

    /**
     * 获取手机
     *
     * @return mobile_phone - 手机
     */
    public String getMobilePhone() {
        return mobilePhone;
    }

    /**
     * 设置手机
     *
     * @param mobilePhone 手机
     */
    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    /**
     * 获取退款金额
     *
     * @return refund_money - 退款金额
     */
    public BigDecimal getRefundMoney() {
        return refundMoney;
    }

    /**
     * 设置退款金额
     *
     * @param refundMoney 退款金额
     */
    public void setRefundMoney(BigDecimal refundMoney) {
        this.refundMoney = refundMoney;
    }

    /**
     * 获取补偿金额
     *
     * @return compensation - 补偿金额
     */
    public BigDecimal getCompensation() {
        return compensation;
    }

    /**
     * 设置补偿金额
     *
     * @param compensation 补偿金额
     */
    public void setCompensation(BigDecimal compensation) {
        this.compensation = compensation;
    }

    /**
     * 获取状态 0:添加/1:送审/2:回收/3:审核/4:反审核
     *
     * @return state - 状态 0:添加/1:送审/2:回收/3:审核/4:反审核
     */
    public Integer getState() {
        return state;
    }

    /**
     * 设置状态 0:添加/1:送审/2:回收/3:审核/4:反审核
     *
     * @param state 状态 0:添加/1:送审/2:回收/3:审核/4:反审核
     */
    public void setState(Integer state) {
        this.state = state;
    }

    /**
     * 获取录单人ID
     *
     * @return input_id - 录单人ID
     */
    public Long getInputId() {
        return inputId;
    }

    /**
     * 设置录单人ID
     *
     * @param inputId 录单人ID
     */
    public void setInputId(Long inputId) {
        this.inputId = inputId;
    }

    /**
     * 获取录单人名称
     *
     * @return input_by - 录单人名称
     */
    public String getInputBy() {
        return inputBy;
    }

    /**
     * 设置录单人名称
     *
     * @param inputBy 录单人名称
     */
    public void setInputBy(String inputBy) {
        this.inputBy = inputBy;
    }

    /**
     * 获取审核时间
     *
     * @return audit_date - 审核时间
     */
    public Date getAuditDate() {
        return auditDate;
    }

    /**
     * 设置审核时间
     *
     * @param auditDate 审核时间
     */
    public void setAuditDate(Date auditDate) {
        this.auditDate = auditDate;
    }

    /**
     * 获取审核人ID
     *
     * @return audit_id - 审核人ID
     */
    public Long getAuditId() {
        return auditId;
    }

    /**
     * 设置审核人ID
     *
     * @param auditId 审核人ID
     */
    public void setAuditId(Long auditId) {
        this.auditId = auditId;
    }

    /**
     * 获取审核人名称
     *
     * @return audit_by - 审核人名称
     */
    public String getAuditBy() {
        return auditBy;
    }

    /**
     * 设置审核人名称
     *
     * @param auditBy 审核人名称
     */
    public void setAuditBy(String auditBy) {
        this.auditBy = auditBy;
    }

    /**
     * 获取实际退款金额
     *
     * @return actual_refund_money - 实际退款金额
     */
    public BigDecimal getActualRefundMoney() {
        return actualRefundMoney;
    }

    /**
     * 设置实际退款金额
     *
     * @param actualRefundMoney 实际退款金额
     */
    public void setActualRefundMoney(BigDecimal actualRefundMoney) {
        this.actualRefundMoney = actualRefundMoney;
    }

    /**
     * 获取充值退款金额
     *
     * @return rec_refund_money - 充值退款金额
     */
    public BigDecimal getRecRefundMoney() {
        return recRefundMoney;
    }

    /**
     * 设置充值退款金额
     *
     * @param recRefundMoney 充值退款金额
     */
    public void setRecRefundMoney(BigDecimal recRefundMoney) {
        this.recRefundMoney = recRefundMoney;
    }

    /**
     * 获取疗程退款金额
     *
     * @return couse_refund_money - 疗程退款金额
     */
    public BigDecimal getCouseRefundMoney() {
        return couseRefundMoney;
    }

    /**
     * 设置疗程退款金额
     *
     * @param couseRefundMoney 疗程退款金额
     */
    public void setCouseRefundMoney(BigDecimal couseRefundMoney) {
        this.couseRefundMoney = couseRefundMoney;
    }

    /**
     * 获取来源单号
     *
     * @return source_doc_num - 来源单号
     */
    public String getSourceDocNum() {
        return sourceDocNum;
    }

    /**
     * 设置来源单号
     *
     * @param sourceDocNum 来源单号
     */
    public void setSourceDocNum(String sourceDocNum) {
        this.sourceDocNum = sourceDocNum;
    }

    /**
     * 获取退款方式
     *
     * @return refund_type - 退款方式
     */
    public String getRefundType() {
        return refundType;
    }

    /**
     * 设置退款方式
     *
     * @param refundType 退款方式
     */
    public void setRefundType(String refundType) {
        this.refundType = refundType;
    }

    /**
     * 获取退款账户
     *
     * @return refund_account - 退款账户
     */
    public String getRefundAccount() {
        return refundAccount;
    }

    /**
     * 设置退款账户
     *
     * @param refundAccount 退款账户
     */
    public void setRefundAccount(String refundAccount) {
        this.refundAccount = refundAccount;
    }

    /**
     * 获取收款人
     *
     * @return payee - 收款人
     */
    public String getPayee() {
        return payee;
    }

    /**
     * 设置收款人
     *
     * @param payee 收款人
     */
    public void setPayee(String payee) {
        this.payee = payee;
    }

    /**
     * 获取退款原因
     *
     * @return refund_reason - 退款原因
     */
    public String getRefundReason() {
        return refundReason;
    }

    /**
     * 设置退款原因
     *
     * @param refundReason 退款原因
     */
    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RefundOrderList other = (RefundOrderList) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getRefundNum() == null ? other.getRefundNum() == null : this.getRefundNum().equals(other.getRefundNum()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getRefundDate() == null ? other.getRefundDate() == null : this.getRefundDate().equals(other.getRefundDate()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
            && (this.getMemberId() == null ? other.getMemberId() == null : this.getMemberId().equals(other.getMemberId()))
            && (this.getMemberName() == null ? other.getMemberName() == null : this.getMemberName().equals(other.getMemberName()))
            && (this.getMemberIdentityCard() == null ? other.getMemberIdentityCard() == null : this.getMemberIdentityCard().equals(other.getMemberIdentityCard()))
            && (this.getMobilePhone() == null ? other.getMobilePhone() == null : this.getMobilePhone().equals(other.getMobilePhone()))
            && (this.getRefundMoney() == null ? other.getRefundMoney() == null : this.getRefundMoney().equals(other.getRefundMoney()))
            && (this.getCompensation() == null ? other.getCompensation() == null : this.getCompensation().equals(other.getCompensation()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getInputId() == null ? other.getInputId() == null : this.getInputId().equals(other.getInputId()))
            && (this.getInputBy() == null ? other.getInputBy() == null : this.getInputBy().equals(other.getInputBy()))
            && (this.getAuditDate() == null ? other.getAuditDate() == null : this.getAuditDate().equals(other.getAuditDate()))
            && (this.getAuditId() == null ? other.getAuditId() == null : this.getAuditId().equals(other.getAuditId()))
            && (this.getAuditBy() == null ? other.getAuditBy() == null : this.getAuditBy().equals(other.getAuditBy()))
            && (this.getActualRefundMoney() == null ? other.getActualRefundMoney() == null : this.getActualRefundMoney().equals(other.getActualRefundMoney()))
            && (this.getRecRefundMoney() == null ? other.getRecRefundMoney() == null : this.getRecRefundMoney().equals(other.getRecRefundMoney()))
            && (this.getCouseRefundMoney() == null ? other.getCouseRefundMoney() == null : this.getCouseRefundMoney().equals(other.getCouseRefundMoney()))
            && (this.getSourceDocNum() == null ? other.getSourceDocNum() == null : this.getSourceDocNum().equals(other.getSourceDocNum()))
            && (this.getRefundType() == null ? other.getRefundType() == null : this.getRefundType().equals(other.getRefundType()))
            && (this.getRefundAccount() == null ? other.getRefundAccount() == null : this.getRefundAccount().equals(other.getRefundAccount()))
            && (this.getPayee() == null ? other.getPayee() == null : this.getPayee().equals(other.getPayee()))
            && (this.getRefundReason() == null ? other.getRefundReason() == null : this.getRefundReason().equals(other.getRefundReason()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getRefundNum() == null) ? 0 : getRefundNum().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getRefundDate() == null) ? 0 : getRefundDate().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
        result = prime * result + ((getMemberId() == null) ? 0 : getMemberId().hashCode());
        result = prime * result + ((getMemberName() == null) ? 0 : getMemberName().hashCode());
        result = prime * result + ((getMemberIdentityCard() == null) ? 0 : getMemberIdentityCard().hashCode());
        result = prime * result + ((getMobilePhone() == null) ? 0 : getMobilePhone().hashCode());
        result = prime * result + ((getRefundMoney() == null) ? 0 : getRefundMoney().hashCode());
        result = prime * result + ((getCompensation() == null) ? 0 : getCompensation().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getInputId() == null) ? 0 : getInputId().hashCode());
        result = prime * result + ((getInputBy() == null) ? 0 : getInputBy().hashCode());
        result = prime * result + ((getAuditDate() == null) ? 0 : getAuditDate().hashCode());
        result = prime * result + ((getAuditId() == null) ? 0 : getAuditId().hashCode());
        result = prime * result + ((getAuditBy() == null) ? 0 : getAuditBy().hashCode());
        result = prime * result + ((getActualRefundMoney() == null) ? 0 : getActualRefundMoney().hashCode());
        result = prime * result + ((getRecRefundMoney() == null) ? 0 : getRecRefundMoney().hashCode());
        result = prime * result + ((getCouseRefundMoney() == null) ? 0 : getCouseRefundMoney().hashCode());
        result = prime * result + ((getSourceDocNum() == null) ? 0 : getSourceDocNum().hashCode());
        result = prime * result + ((getRefundType() == null) ? 0 : getRefundType().hashCode());
        result = prime * result + ((getRefundAccount() == null) ? 0 : getRefundAccount().hashCode());
        result = prime * result + ((getPayee() == null) ? 0 : getPayee().hashCode());
        result = prime * result + ((getRefundReason() == null) ? 0 : getRefundReason().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", refundNum=").append(refundNum);
        sb.append(", type=").append(type);
        sb.append(", refundDate=").append(refundDate);
        sb.append(", storeId=").append(storeId);
        sb.append(", storeName=").append(storeName);
        sb.append(", memberId=").append(memberId);
        sb.append(", memberName=").append(memberName);
        sb.append(", memberIdentityCard=").append(memberIdentityCard);
        sb.append(", mobilePhone=").append(mobilePhone);
        sb.append(", refundMoney=").append(refundMoney);
        sb.append(", compensation=").append(compensation);
        sb.append(", state=").append(state);
        sb.append(", inputId=").append(inputId);
        sb.append(", inputBy=").append(inputBy);
        sb.append(", auditDate=").append(auditDate);
        sb.append(", auditId=").append(auditId);
        sb.append(", auditBy=").append(auditBy);
        sb.append(", actualRefundMoney=").append(actualRefundMoney);
        sb.append(", recRefundMoney=").append(recRefundMoney);
        sb.append(", couseRefundMoney=").append(couseRefundMoney);
        sb.append(", sourceDocNum=").append(sourceDocNum);
        sb.append(", refundType=").append(refundType);
        sb.append(", refundAccount=").append(refundAccount);
        sb.append(", payee=").append(payee);
        sb.append(", refundReason=").append(refundReason);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}