package com.ssm.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ssm.manage.utils.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * 交易记录(TransactionRecord)实体类
 *
 * @author makejava
 * @since 2022-04-20 10:19:56
 */
@Table(name = "transaction_record_${tab}")
public class TransactionRecord implements Serializable {
    private static final long serialVersionUID = 616470420969355319L;
    /**
     * id
     */
    @Id
    private Long id;
    /**
     * 门店ID
     */
    @Column(name = "store_id")
    private Long storeId;
    /**
     * 门店名称
     */
    @Column(name = "store_name")
    private String storeName;
    /**
     * 会员ID
     */
    @Column(name = "member_id")
    private Long memberId;
    /**
     * 会员名称
     */
    @Column(name = "member_name")
    private String memberName;
    /**
     * 会员身份证号
     */
    @Column(name = "member_identity")
    private String memberIdentity;
    /**
     * 会员手机号
     */
    @Column(name = "member_phone")
    private String memberPhone;
    /**
     * 日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "date")
    private Date date;
    /**
     * 0=收银支付，1=收银作废，2=正常充值开卡，3=正常充值作废，4=升级充值开卡，5=升级充值转出，6=降级充值开卡，7=降级开卡转出，8=升级开卡作废，9=升级作废返回，10=降级开卡作废，11=降级作废返回，12=正常疗程开卡，13=疗程开卡作废，14=加价转入疗程，15=加价转出疗程，16=加价作废，17=加价作废返回，18=疗程转充值转入充值卡，19=疗程转充值转出疗程，20=疗程转充值作废扣卡，21=疗程转充值作废转出返回，22=充值退款，23=充值退款反审核返回，24=疗程退款，25=疗程退款反审核返回，26=消费退款返回，27=消费退款反审核扣除，28=还款添加，29=还款作废扣除，30=促销购买，31=促销赠送，32=促销作废扣除
     */
    @Column(name = "type")
    private Integer type;
    /**
     * 单据ID
     */
    @Column(name = "doc_id")
    private Long docId;
    /**
     * 单据号
     */
    @Column(name = "doc_num")
    private String docNum;
    /**
     * 单据时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "doc_date")
    private Date docDate;
    /**
     * 账户ID
     */
    @Column(name = "account_id")
    private Long accountId;
    /**
     * 账户名称
     */
    @Column(name = "account_name")
    private String accountName;
    /**
     * 账户类型
     */
    @Column(name = "account_type")
    private String accountType;
    /**
     * 卡付金额
     */
    @Column(name = "card_money")
    private BigDecimal cardMoney;
    /**
     * 支付赠送金额
     */
    @Column(name = "account_gift_spend_money")
    private BigDecimal accountGiftSpendMoney;
    /**
     * 支付次数
     */
    @Column(name = "account_spend_count")
    private Integer accountSpendCount;
    /**
     * 剩余金额
     */
    @Column(name = "account_rest_money")
    private BigDecimal accountRestMoney;
    /**
     * 剩余可用金额
     */
    @Column(name = "account_consume_money")
    private BigDecimal accountConsumeMoney;
    /**
     * 剩余次数
     */
    @Column(name = "account_rest_count")
    private Integer accountRestCount;
    /**
     * 剩余可用次数
     */
    @Column(name = "account_consume_count")
    private Integer accountConsumeCount;
    /**
     * 剩余赠送金额
     */
    @Column(name = "account_gift_rest_money")
    private BigDecimal accountGiftRestMoney;
    /**
     * 剩余赠送次数
     */
    @Column(name = "account_gift_rest_count")
    private Integer accountGiftRestCount;
    /**
     * 剩余赠送可用金额
     */
    @Column(name = "account_gift_consume_money")
    private BigDecimal accountGiftConsumeMoney;
    /**
     * 剩余赠送可用次数
     */
    @Column(name = "account_gift_consume_count")
    private Integer accountGiftConsumeCount;
    /**
     * 账户编码（项目/充值类型）编码
     */
    @Column(name = "account_num")
    private String accountNum;
    /**
     * 操作人
     */
    @Column(name = "operation_by")
    private String operationBy;
    /**
     * 单据项目(充值类型)Id
     */
    @Column(name = "doc_project_id")
    private Long docProjectId;
    /**
     * 单据项目(充值类型)编码
     */
    @Column(name = "doc_project_num")
    private String docProjectNum;
    /**
     * 单据项目(充值类型)名称
     */
    @Column(name = "doc_project_name")
    private String docProjectName;
    /**
     * 单据当前状态
     */
    @Column(name = "doc_state")
    private Integer docState;
    /**
     * 单据购买数据
     */
    @Column(name = "quantity")
    private Integer quantity;
    /**
     * 单据购买单价
     */
    @Column(name = "price")
    private BigDecimal price;
    /**
     * 单据购买成交金额
     */
    @Column(name = "trading_money")
    private BigDecimal tradingMoney;
    /**
     * 欠款金额
     */
    @Column(name = "debt_money")
    private BigDecimal debtMoney;
    /**
     * 现付金额
     */
    @Column(name = "cash_money")
    private BigDecimal cashMoney;
    /**
     * 存入金额
     */
    @Column(name = "account_in_money")
    private BigDecimal accountInMoney;
    /**
     * 存入次数
     */
    @Column(name = "account_in_count")
    private Integer accountInCount;

    /**
     * 交易次数
     */
    @Column(name = "trade_count")
    private Integer tradeCount;
    /**
     * 存入赠送金额
     */
    @Column(name = "account_in_gift_money")
    private BigDecimal accountInGiftMoney;

    public BigDecimal getAccountInGiftMoney() {
        return accountInGiftMoney;
    }

    public void setAccountInGiftMoney(BigDecimal accountInGiftMoney) {
        this.accountInGiftMoney = accountInGiftMoney;
    }

    public Long getId() {
        return id;
    }

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

    public Long getStoreId() {
        return storeId;
    }

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

    public String getStoreName() {
        return storeName;
    }

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

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getMemberIdentity() {
        return memberIdentity;
    }

    public void setMemberIdentity(String memberIdentity) {
        this.memberIdentity = memberIdentity;
    }

    public String getMemberPhone() {
        return memberPhone;
    }

    public void setMemberPhone(String memberPhone) {
        this.memberPhone = memberPhone;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getDocId() {
        return docId;
    }

    public void setDocId(Long docId) {
        this.docId = docId;
    }

    public String getDocNum() {
        return docNum;
    }

    public void setDocNum(String docNum) {
        this.docNum = docNum;
    }

    public Date getDocDate() {
        return docDate;
    }

    public void setDocDate(Date docDate) {
        this.docDate = docDate;
    }

    public Long getAccountId() {
        return accountId;
    }

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

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getAccountType() {
        return accountType;
    }

    public void setAccountType(String accountType) {
        this.accountType = accountType;
    }

    public BigDecimal getCardMoney() {
        return cardMoney;
    }

    public void setCardMoney(BigDecimal cardMoney) {
        this.cardMoney = cardMoney;
    }

    public BigDecimal getAccountGiftSpendMoney() {
        return accountGiftSpendMoney;
    }

    public void setAccountGiftSpendMoney(BigDecimal accountGiftSpendMoney) {
        this.accountGiftSpendMoney = accountGiftSpendMoney;
    }

    public Integer getAccountSpendCount() {
        return accountSpendCount;
    }

    public void setAccountSpendCount(Integer accountSpendCount) {
        this.accountSpendCount = accountSpendCount;
    }

    public BigDecimal getAccountRestMoney() {
        return accountRestMoney;
    }

    public void setAccountRestMoney(BigDecimal accountRestMoney) {
        this.accountRestMoney = accountRestMoney;
    }

    public BigDecimal getAccountConsumeMoney() {
        return accountConsumeMoney;
    }

    public void setAccountConsumeMoney(BigDecimal accountConsumeMoney) {
        this.accountConsumeMoney = accountConsumeMoney;
    }

    public Integer getAccountRestCount() {
        return accountRestCount;
    }

    public void setAccountRestCount(Integer accountRestCount) {
        this.accountRestCount = accountRestCount;
    }

    public Integer getAccountConsumeCount() {
        return accountConsumeCount;
    }

    public void setAccountConsumeCount(Integer accountConsumeCount) {
        this.accountConsumeCount = accountConsumeCount;
    }

    public BigDecimal getAccountGiftRestMoney() {
        return accountGiftRestMoney;
    }

    public void setAccountGiftRestMoney(BigDecimal accountGiftRestMoney) {
        this.accountGiftRestMoney = accountGiftRestMoney;
    }

    public Integer getAccountGiftRestCount() {
        return accountGiftRestCount;
    }

    public void setAccountGiftRestCount(Integer accountGiftRestCount) {
        this.accountGiftRestCount = accountGiftRestCount;
    }

    public BigDecimal getAccountGiftConsumeMoney() {
        return accountGiftConsumeMoney;
    }

    public void setAccountGiftConsumeMoney(BigDecimal accountGiftConsumeMoney) {
        this.accountGiftConsumeMoney = accountGiftConsumeMoney;
    }

    public Integer getAccountGiftConsumeCount() {
        return accountGiftConsumeCount;
    }

    public void setAccountGiftConsumeCount(Integer accountGiftConsumeCount) {
        this.accountGiftConsumeCount = accountGiftConsumeCount;
    }

    public String getAccountNum() {
        return accountNum;
    }

    public void setAccountNum(String accountNum) {
        this.accountNum = accountNum;
    }

    public String getOperationBy() {
        return operationBy;
    }

    public void setOperationBy(String operationBy) {
        this.operationBy = operationBy;
    }

    public Long getDocProjectId() {
        return docProjectId;
    }

    public void setDocProjectId(Long docProjectId) {
        this.docProjectId = docProjectId;
    }

    public String getDocProjectNum() {
        return docProjectNum;
    }

    public void setDocProjectNum(String docProjectNum) {
        this.docProjectNum = docProjectNum;
    }

    public String getDocProjectName() {
        return docProjectName;
    }

    public void setDocProjectName(String docProjectName) {
        this.docProjectName = docProjectName;
    }

    public Integer getDocState() {
        return docState;
    }

    public void setDocState(Integer docState) {
        this.docState = docState;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getTradingMoney() {
        return tradingMoney;
    }

    public void setTradingMoney(BigDecimal tradingMoney) {
        this.tradingMoney = tradingMoney;
    }

    public BigDecimal getDebtMoney() {
        return debtMoney;
    }

    public void setDebtMoney(BigDecimal debtMoney) {
        this.debtMoney = debtMoney;
    }

    public BigDecimal getCashMoney() {
        return cashMoney;
    }

    public void setCashMoney(BigDecimal cashMoney) {
        this.cashMoney = cashMoney;
    }

    public BigDecimal getAccountInMoney() {
        return accountInMoney;
    }

    public void setAccountInMoney(BigDecimal accountInMoney) {
        this.accountInMoney = accountInMoney;
    }

    public Integer getAccountInCount() {
        return accountInCount;
    }

    public void setAccountInCount(Integer accountInCount) {
        this.accountInCount = accountInCount;
    }

    public Integer getTradeCount() {
        return tradeCount;
    }

    public void setTradeCount(Integer tradeCount) {
        this.tradeCount = tradeCount;
    }

    @JsonIgnore
    public String getTab(){
        return DateUtils.YMFormat(date);
    }
}

