
package com.tmerclub.cloud.flow.bo;

import com.tmerclub.cloud.common.model.BaseModel;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;


/**
 * 商城用户操作行为统计
 *
 * @author YXF
 * @date 2020-07-13 13:18:33
 */
@CompoundIndexes({
        @CompoundIndex(name = "date_type_type_idx", def = "{'dateType':1, 'type':1}")
})
@Document("flow_user")
public class FlowUserBO extends BaseModel implements Serializable {

    public static final Integer ID_LENGTH = 16;

    /**
     * id: 日期（yyMMdd）+ 时间类型 + 编号
     * 长度：16位
     */
    @Id
    private Long id;

    /**
     * 日、周、月
     */
    private Integer dateType;

    /**
     * 数据类型  0: 所有用户 1：免费用户  2 付费用户
     */
    private Integer type;

    /**
     * 用户数
     */
    private Integer userNum;

    /**
     * 领券用户数
     */
    private Integer receiveCouponUser;

    /**
     * 新增用户数
     */
    private Integer newUserNum;

    /**
     * 支付用户数
     */
    private Integer payUser;

    /**
     * 支付订单数
     */
    private Integer payOrder;

    /**
     * 支付金额
     */
    private Long payAmount;

    public FlowUserBO() {
        this.userNum = 0;
        this.receiveCouponUser = 0;
        this.newUserNum = 0;
        this.payUser = 0;
        this.payOrder = 0;
        this.payAmount = 0L;
    }

    public Long getId() {
        return id;
    }

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

    public Integer getDateType() {
        return dateType;
    }

    public void setDateType(Integer dateType) {
        this.dateType = dateType;
    }

    public Integer getType() {
        return type;
    }

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

    public Integer getUserNum() {
        return userNum;
    }

    public void setUserNum(Integer userNum) {
        this.userNum = userNum;
    }

    public Integer getReceiveCouponUser() {
        return receiveCouponUser;
    }

    public void setReceiveCouponUser(Integer receiveCouponUser) {
        this.receiveCouponUser = receiveCouponUser;
    }

    public Integer getNewUserNum() {
        return newUserNum;
    }

    public void setNewUserNum(Integer newUserNum) {
        this.newUserNum = newUserNum;
    }

    public Integer getPayUser() {
        return payUser;
    }

    public void setPayUser(Integer payUser) {
        this.payUser = payUser;
    }

    public Integer getPayOrder() {
        return payOrder;
    }

    public void setPayOrder(Integer payOrder) {
        this.payOrder = payOrder;
    }

    public Long getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Long payAmount) {
        this.payAmount = payAmount;
    }

    @Override
    public String toString() {
        return "UserStatisticsBO{" +
                "id=" + id +
                ", dateType=" + dateType +
                ", type=" + type +
                ", userNum=" + userNum +
                ", receiveCouponUser=" + receiveCouponUser +
                ", newUserNum=" + newUserNum +
                ", payUser=" + payUser +
                ", payOrder=" + payOrder +
                ", payAmount=" + payAmount +
                '}';
    }
}
