package com.ssm.manage.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ssm.manage.page.BasePage;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Setter
@Getter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class RechargeAccountRequest extends BasePage {

    private Long id;

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

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

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

    /**
     * 账户充值金额
     */
    @Column(name = "card_recharge_money")
    private BigDecimal cardRechargeMoney;

    /**
     * 账户剩余金额
     */
    @Column(name = "card_rest_money")
    private BigDecimal cardRestMoney;

    /**
     * 最近消费日期
     */
    @Column(name = "last_consume_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastConsumeTime;

    /**
     * 会员卡
     */
    private String card;

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

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

    /**
     * 类别 1:折扣卡类型/0:赠送卡类型
     */
    private Integer type;

    /**
     * 享受优惠
     */
    private BigDecimal discount;

    /**
     * 赠送卡赠送金额
     */
    @Column(name = "card_gift_money")
    private BigDecimal cardGiftMoney;

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

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

    /**
     * 账户可用金额
     */
    @Column(name = "card_consume_money")
    private BigDecimal cardConsumeMoney;

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

    /*
     * 花费金额
     * */
    private BigDecimal spendMoney;
    private BigDecimal giftSpendMoney;

    /*
    * 卡付金额抵扣金额
    * */
    private BigDecimal discoutMoney;

    private Integer state;

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

    private String staffPhone;
    //多门店使用
    private Long[] storeIds;
    private List<Long> storeIdl;

    /**
     * 赠送金额使用折扣
     */
    private BigDecimal discountFreeAmount;

    /**
     * 促销开始日期
     */
    @Column(name = "start_dates")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startDates;

    /**
     * 促销结束日期
     */
    @Column(name = "stop_dates")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date stopDates;


    /**
     * 充值金额占比
     */
    @Column(name = "recharge_bl")
    private BigDecimal rechargeBl;

    /**
     * 赠送金额占比
     */
    @Column(name = "free_of")
    private BigDecimal freeOf;

    /**
     * 赠送金额享受折扣
     */
    private BigDecimal freePaymentAmount;

    /**
     * 升级前的；类型ID
     */
    private Long ids;
    /**
     * 总店Id
     */
    private Long zDsTOREiD;

    /**
     * 赠送金额占比
     */
    @Column(name = "card_gift_discount")
    private BigDecimal cardGiftDiscount;

    /**
     * 赠送金额占比
     */
    @Column(name = "first_charge")
    private Long firstCharge;

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

    /**
     *当前门店id
     */
    private Long NowStoreId;

    private Integer selectType;

}
