package com.ssm.manage.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ssm.manage.entity.PayList;
import com.ssm.manage.entity.RepayTradeList;
import com.ssm.manage.entity.Salesman;
import com.ssm.manage.page.BasePage;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.FieldNameConstants;
import org.springframework.format.annotation.DateTimeFormat;

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

@Setter
@Getter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
@FieldNameConstants
public class RepayListRequest extends BasePage {
    private int isSendSms;
    private Integer accountType;
    private Long roleId;
    private List<Long> storeIds;
    private String strDate;
    private Integer isGift;
//    private String twoDocType;
    /**
     * 主键ID
     */
    @Id
    private Long id;

    /**
     * 还款单据号
     */
    @Column(name = "repay_num")
    private String repayNum;

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

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

    /**
     * 门店名称
     */
    @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 = "repay_date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date repayDate;

    /**
     * 还款金额
     */
    @Column(name = "repay_money")
    private BigDecimal repayMoney;

    /**
     * 欠款金额
     */
    @Column(name = "debt_money")
    private BigDecimal debtMoney;

    /**
     * 支付金额
     */
    @Column(name = "pay_money")
    private BigDecimal payMoney;

    /**
     * 状态（0:正常/1：作废）
     */
    @Column(name = "is_cancel")
    private Integer isCancel;
    /**
     * 作废时间
     */
    @Column(name = "cancel_date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date cancelDate;

    /**
     * 作废人ID
     */
    @Column(name = "cancel_id")
    private Long cancelId;

    /**
     * 作废人名称
     */
    @Column(name = "cancel_by")
    private String cancelBy;

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

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

    /*
    * 员工登录手机号
    * */
    private String staffPhone;

    //还款明细list
    private List<RepayTradeRequest> repayTradeLists;

    //现付支付列表
    private List<PayList> payLists;
    private List<Salesman> salesmens;

    //子表还款源单据类型 查询使用
    private String docType;
    private String dateStr;

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

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

    /**
     * 补单时间
     */
    @Column(name = "addition_date")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date additionDate;

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

    private List<RepayAccountListRequest> repayAccountListRequests;


    private List<Long> storeList;

    /**
     * 查询方式，0=指定查询，1=自动查询
     */
    private Integer selectType;
}
