package com.ruoyi.system.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.GeneratedValue;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * Billing对象 user_billing
 *
 * @author ruoyi
 * @date 2023-09-06
 */
@Data
@TableName(value = "user_billing")
@EqualsAndHashCode(callSuper = false)
public class UserBilling
{
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @GeneratedValue
    /** id */
    private Long id;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 类型 ：0 分成 1 充值 2 提现 3 消费  4 金额冻结 5 金额解冻 */
    @Excel(name = "类型")
    private String type;

    /** 订单id */
    @Excel(name = "订单id")
    private String ddId;

    /** 金额 */
    @Excel(name = "金额")
    private Double amount;

    /** 抽成 */
    @Excel(name = "平台抽成")
    private Double divvy;

    /** 状态 */
    @Excel(name = "状态")
    private String state;

    /** 门店id */
    @Excel(name = "门店id")
    private Long mdId;

    /** 关联摊位ID，非摊位账单为NULL */
    private Long storeId;

    /** 门店名称 */
    @TableField(exist = false)
    private String mdName;

    /** 说明 */
    @Excel(name = "说明")
    private String illustrate;

    /** 支付或收款方式 */
    @Excel(name = "支付或收款方式")
    private String paymentMethod;

    /** 收支账号 */
    @Excel(name = "收支账号")
    private String accountNumber;

    /** 支付地址 */
    @Excel(name = "支付地址")
    private String url;

    /** 时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date cretim;

    /** 使用余额付款 0否，1是 */
    @Excel(name = "使用余额付款")
    private String balancePay;

    /** 代付人id */
    @Excel(name = "代付人id")
    private String paymentId;

    @TableField(exist = false)
    private  Long activity;
    /** 门店促销活动id */
    @TableField(exist = false)
    private  Long mdActivity;
    /** 使用优惠券id */
    @TableField(exist = false)
    private Long yhId;
    /** 平台优惠券名称 */
    @TableField(exist = false)
    private String yhName;
    /** 平台优惠券优惠金额 */
    @TableField(exist = false)
    private Integer discountAmount;
    /** 门店优惠券id */
    @TableField(exist = false)
    private Long mdYhId;
    /** 门店优惠券名称 */
    @TableField(exist = false)
    private String mdYhName;

    /** 门店优惠券优惠金额 */
    @TableField(exist = false)
    private Integer mdDiscountAmount;
    /** 平台促銷活動名稱 */
    @TableField(exist = false)
    private  String salesName;

    /** 门店促銷活動名稱 */
    @TableField(exist = false)
    private  String mdSalesName;


    /** 平台促销減免值 */
    @TableField(exist = false)
    private Integer salesReduction;

    /** 门店促销減免值 */
    @TableField(exist = false)
    private Integer mdSalesReduction;

    /** 积分 */
    @TableField(exist = false)
    private Integer points;

    /** 积分抵扣值 */
    @TableField(exist = false)
    private Integer pointsReduction;


    /** 用户类型 : 1 商家用户 2 骑手 */
    @Excel(name = "用户类型")
    private String userType;
    /**
     * 抽成比例
     */
    @Excel(name = "抽成比例")
    private Double divvyRate;

    /** 代收金额，货到付款使用 */
    @Excel(name = "代收金额")
    private Double behalfAmount;

    /**
     * 钱包余额
     */
    private BigDecimal walletBalance;
    /**
     * 扣税
     */
    private BigDecimal tax;
    /**
     * 扣税比例
     */
    private String taxRate;
    @TableField(exist = false)
    private String userName;
    //支付类型
    @TableField(exist = false)
    private String payType;

    @TableField(exist = false)
    private transient String[] dateRange;
    @TableField(exist = false)
    private transient String cretimStart;
    @TableField(exist = false)
    private transient String cretimEnd;


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

    public Long getId()
    {
        return id;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setType(String type)
    {
        this.type = type;
    }

    public String getType()
    {
        return type;
    }
    public void setDdId(String ddId)
    {
        this.ddId = ddId;
    }

    public String getDdId()
    {
        return ddId;
    }
    public void setAmount(Double amount)
    {
        this.amount = amount;
    }

    public Double getAmount()
    {
        return amount;
    }
    public void setState(String state)
    {
        this.state = state;
    }

    public String getState()
    {
        return state;
    }
    public void setIllustrate(String illustrate)
    {
        this.illustrate = illustrate;
    }

    public String getIllustrate()
    {
        return illustrate;
    }
    public void setPaymentMethod(String paymentMethod)
    {
        this.paymentMethod = paymentMethod;
    }

    public String getPaymentMethod()
    {
        return paymentMethod;
    }
    public void setAccountNumber(String accountNumber)
    {
        this.accountNumber = accountNumber;
    }

    public String getAccountNumber()
    {
        return accountNumber;
    }

    public Long getMdId() {
        return mdId;
    }

    public void setMdId(Long mdId) {
        this.mdId = mdId;
    }

    public Double getDivvy() {
        return divvy;
    }

    public void setDivvy(Double divvy) {
        this.divvy = divvy;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Date getCretim() {
        return cretim;
    }

    public void setCretim(Date cretim) {
        this.cretim = cretim;
    }

    public String getBalancePay() {
        return balancePay;
    }

    public void setBalancePay(String balancePay) {
        this.balancePay = balancePay;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("type", getType())
                .append("ddId", getDdId())
                .append("amount", getAmount())
                .append("state", getState())
                .append("mdId", getMdId())
                .append("illustrate", getIllustrate())
                .append("paymentMethod", getPaymentMethod())
                .append("accountNumber", getAccountNumber())
                .append("divvy", getDivvy())
                .append("url", getUrl())
                .append("cretim", getCretim())
                .append("balancePay", getBalancePay())
                .append("userType", getUserType())
                .append("divvyRate", getDivvyRate())
                .append("behalfAmount", getBehalfAmount())
                .append("walletBalance", getWalletBalance())
                .append("tax", getTax())
                .append("taxRate", getTaxRate())
                .toString();
    }
}
