package com.ssm.manage.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

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

@Table(name = "recharge_account_give")
@JsonIgnoreProperties(ignoreUnknown = true)
public class RechargeAccountGive implements Serializable {

    @Transient
    @Getter
    @Setter
    private BigDecimal refundGiftMoney;

    @Column(name = "recharge_store_num")
    private String rechargeStoreNum;
    /**
     * 充值账户ID
     */
    @Column(name = "account_id")
    private Long accountId;

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

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



    /**
     * 充值单号
     */
    @Column(name = "recharge_num")
    @ExcelProperty("充值单号")
    private String rechargeNum;

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

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

    /**
     * 赠送卡可用金额
     */
    @Column(name = "gift_consume_money")
    @ExcelProperty("赠送可用金额")
    private BigDecimal giftConsumeMoney;


    /**
     * 账户到期时间
     */
    @Column(name = "end_time")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ExcelProperty("账户到期时间")
    private Date endTime;


    /**
     * 充值类别ID
     */
    @Column(name = "recharge_type_id")
    @ExcelProperty("充值类别ID*")
    private Long rechargeTypeId;

    /**
     * 充值类别名称
     */
    @Column(name = "recharge_type_name")
    @ExcelProperty("充值类别名称*")
    private String rechargeTypeName;

    @Column(name = "recharge_date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date rechargeDate;




    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }

    public Date getRechargeDate() {
        return rechargeDate;
    }

    public void setRechargeDate(Date rechargeDate) {
        this.rechargeDate = rechargeDate;
    }

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

    /**
     * 设置会员ID
     *
     * @param memberId 会员ID
     */
    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 recharge_num - 充值单号
     */
    public String getRechargeNum() {
        return rechargeNum;
    }

    /**
     * 设置充值单号
     *
     * @param rechargeNum 充值单号
     */
    public void setRechargeNum(String rechargeNum) {
        this.rechargeNum = rechargeNum;
    }


    /**
     * 获取充值类别ID
     *
     * @return recharge_type_id - 充值类别ID
     */
    public Long getRechargeTypeId() {
        return rechargeTypeId;
    }

    /**
     * 设置充值类别ID
     *
     * @param rechargeTypeId 充值类别ID
     */
    public void setRechargeTypeId(Long rechargeTypeId) {
        this.rechargeTypeId = rechargeTypeId;
    }

    /**
     * 获取充值类别名称
     *
     * @return recharge_type_name - 充值类别名称
     */
    public String getRechargeTypeName() {
        return rechargeTypeName;
    }

    /**
     * 设置充值类别名称
     *
     * @param rechargeTypeName 充值类别名称
     */
    public void setRechargeTypeName(String rechargeTypeName) {
        this.rechargeTypeName = rechargeTypeName;
    }


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

    /**
     * 设置门店ID
     *
     * @param storeId 门店ID
     */
    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 gift_consume_money - 赠送卡可用金额
     */
    public BigDecimal getGiftConsumeMoney() {
        return giftConsumeMoney;
    }

    /**
     * 设置赠送卡可用金额
     *
     * @param giftConsumeMoney 赠送卡可用金额
     */
    public void setGiftConsumeMoney(BigDecimal giftConsumeMoney) {
        this.giftConsumeMoney = giftConsumeMoney;
    }


    /**
     * 获取账户到期时间
     *
     * @return end_time - 账户到期时间
     */
    public Date getEndTime() {
        return endTime;
    }

    /**
     * 设置账户到期时间
     *
     * @param endTime 账户到期时间
     */
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }



    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RechargeAccountGive other = (RechargeAccountGive) that;
        return (this.getAccountId() == null ? other.getAccountId() == null : this.getAccountId().equals(other.getAccountId()))
            && (this.getMemberId() == null ? other.getMemberId() == null : this.getMemberId().equals(other.getMemberId()))
            && (this.getMemberName() == null ? other.getMemberName() == null : this.getMemberName().equals(other.getMemberName()))
            && (this.getRechargeNum() == null ? other.getRechargeNum() == null : this.getRechargeNum().equals(other.getRechargeNum()))
            && (this.getRechargeTypeId() == null ? other.getRechargeTypeId() == null : this.getRechargeTypeId().equals(other.getRechargeTypeId()))
            && (this.getRechargeTypeName() == null ? other.getRechargeTypeName() == null : this.getRechargeTypeName().equals(other.getRechargeTypeName()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
            && (this.getGiftConsumeMoney() == null ? other.getGiftConsumeMoney() == null : this.getGiftConsumeMoney().equals(other.getGiftConsumeMoney()))
            && (this.getRechargeDate() == null ? other.getRechargeDate() == null : this.getRechargeDate().equals(other.getRechargeDate()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
        result = prime * result + ((getMemberId() == null) ? 0 : getMemberId().hashCode());
        result = prime * result + ((getMemberName() == null) ? 0 : getMemberName().hashCode());
        result = prime * result + ((getRechargeNum() == null) ? 0 : getRechargeNum().hashCode());
        result = prime * result + ((getRechargeTypeId() == null) ? 0 : getRechargeTypeId().hashCode());
        result = prime * result + ((getRechargeTypeName() == null) ? 0 : getRechargeTypeName().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
        result = prime * result + ((getGiftConsumeMoney() == null) ? 0 : getGiftConsumeMoney().hashCode());
        result = prime * result + ((getRechargeDate() == null) ? 0 : getRechargeDate().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", accountId=").append(accountId);
        sb.append(", memberId=").append(memberId);
        sb.append(", memberName=").append(memberName);
        sb.append(", rechargeNum=").append(rechargeNum);
        sb.append(", rechargeTypeId=").append(rechargeTypeId);
        sb.append(", rechargeTypeName=").append(rechargeTypeName);
        sb.append(", storeId=").append(storeId);
        sb.append(", storeName=").append(storeName);
        sb.append(", giftConsumeMoney=").append(giftConsumeMoney);
        sb.append(", rechargeDate=").append(rechargeDate);
        sb.append(", endTime=").append(endTime);
        sb.append("]");
        return sb.toString();
    }

    public String getRechargeStoreNum() {
        return rechargeStoreNum;
    }

    public void setRechargeStoreNum(String rechargeStoreNum) {
        this.rechargeStoreNum = rechargeStoreNum;
    }
}