package com.fs.hisStore.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fs.common.annotation.Excel;
import com.fs.common.core.domain.BaseEntity;
import com.vdurmont.emoji.EmojiParser;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

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

/**
 * 用户对象 fs_user
 *
 * @author fs
 * @date 2022-03-15
 */
@Data
@TableName("fs_user")
public class FsUserScrm extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户id */
    private Long userId;
    private String username;
    /** 用户密码（跟pwd） */
    private String password;

    /** 真实姓名 */
    private String realName;

    /** 生日 */
    private Long birthday;

    /** 身份证号码 */
    private String idCard;

    @Excel(name = "会员头像",sort = 2)
    private String avatar;

    /** 用户昵称 */
    @Excel(name = "会员昵称", sort = 1)
    private String nickname;
    private String nickName;

    /** 用户备注 */
    @Excel(name = "用户备注", sort = 12)
    private String remark;


    /** 手机号码 */
    @Excel(name = "手机号码")
    private String phone;

    /** 最后一次登录ip */
    private String lastIp;

    /** 用户余额 */
    @Excel(name = "用户余额", sort = 4)
    private BigDecimal nowMoney;

    /** 佣金金额 */
    private BigDecimal brokeragePrice;

    /** 用户积分 */
    @Excel(name = "用户积分")
    private Long integral;

    /** 1为正常，0为禁止 */
    @Excel(name = "1为正常，0为禁止")
    private Integer status;
    private String statusText;

    /** 等级 */
    private Integer level;

    /** 推广上级用户ID */
    private Long spreadUserId;
    /** 推广上级用户ID */
    @Excel(name = "推广上级用户ID")
    private String tuiUserId;
    private Date spreadTime;

    /** 推广员关联时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "推广员关联时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date tuiTime;
    private String userType;
    private Integer isPromoter;
    private Long payCount;
    private Long spreadCount;
    private String addres;

    /** 下级人数 */
    @Excel(name = "下级人数")
    private Long tuiUserCount;

    /** 微信小程序OPENID */
    @Excel(name = "微信小程序OPENID")
    private String maOpenId;

    /** 微信公众号OPENID */
    @Excel(name = "微信公众号OPENID")
    private String mpOpenId;

    /** 关联ID */
    @Excel(name = "关联ID")
    private String unionId;

    /** $column.columnComment */
    @Excel(name = "关联ID")
    private Integer isDel;

    /** 邀请码 */
    @Excel(name = "邀请码")
    private String userCode;

    private Long companyId;
    private Long companyUserId;
    private String companyUserName;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "推线日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date registerDate;
    @Excel(name = "推线编码")
    private String registerCode;

    /** 余额 */
    @Excel(name = "余额")
    private BigDecimal balance;

    /** 连续签到天数 */
    @Excel(name = "连续签到天数")
    private Long signNum;

    /** 订单数 */
    private Integer orderCount;

    private Integer integralStatus;

    private Integer isBuy;

    private String jpushId;
    private Integer isVip;
    private Date  vipStartDate;
    private Date  vipEndDate;
    private Integer vipLevel;
    private Integer vipStatus;

    private Integer sex;
    private String storeOpenId;

    //是否关注公众号
    private Integer isOfficialAccountAuth;
    private Integer isPush; //是否消息通知

    private Integer isIndividuationPush;//是否个性化推送

    private Integer isWeixinAuth;

    private String loginDevice;//当前登录设备

    private String source;//app来源

    private Integer isAddQw;//是否添加企微客服
    private Integer isShow;//是否展示购买以及订单状态

    private Long parentId; //邀请人id

    private String courseMaOpenId; //看课小程序openid



    private String historyApp; //app登录后不为null(表示是否下载app)

    private Long qwExtId;

    /**
     * 企微销售ID
     * **/
    private Long qwUserId;

    /**
     * 小程序appId，多个用逗号分隔
     */
    private String appId;
    /**
     * 储值金额
     */
    @Excel(name = "储值金额")
    private BigDecimal rechargeBalance;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public void setNickName(String nickname)
    {
        if(StringUtils.isNotEmpty(nickname)){
            this.nickName= EmojiParser.parseToHtmlDecimal(nickname);
        }
        else{
            this.nickName= nickname;
        }
        this.nickname = this.nickName;
    }

    public String getNickName()
    {
        if(StringUtils.isNotEmpty(nickName)){
            return EmojiParser.parseToUnicode(nickName);
        }
        else{
            return nickName;
        }
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date startCreateTime;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endCreateTime;

    @TableField(exist = false)
    private String companyUserNickName;

    @ApiModelProperty(value = "所属公司")
    @Excel(name = "所属公司", sort = 9)
    private String companyName;
    private String rank;
    private String react;
    /** 绑定的公司用户ID */
    private Long bindCompanyUserId;

    public Long getBindCompanyUserId() {
        return bindCompanyUserId;
    }

    public void setBindCompanyUserId(Long bindCompanyUserId) {
        this.bindCompanyUserId = bindCompanyUserId;
    }

    /**
     * 项目ID
     */
    private Long projectId;

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    // 是否已购0 否 1程序内下单 2程序外下单
    private Integer payOrder;

    @ApiModelProperty(value = "是否点过注册链接 0:否 1:是")
    @Excel(name = "是否点过注册链接 0:否 1:是")
    private Integer isBecomeMember;

    public String getRank() {
        return rank;
    }

    public FsUserScrm setRank(String rank) {
        this.rank = rank;
        return this;
    }

    public String getReact() {
        return react;
    }

    public FsUserScrm setReact(String react) {
        this.react = react;
        return this;
    }

    public Integer getPayOrder() {
        return payOrder;
    }

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

    public Long getQwExtId() {
        return qwExtId;
    }

    public void setQwExtId(Long qwExtId) {
        this.qwExtId = qwExtId;
    }

    public String getCourseMaOpenId() {
        return courseMaOpenId;
    }

    public void setCourseMaOpenId(String courseMaOpenId) {
        this.courseMaOpenId = courseMaOpenId;
    }
    public String getStatusText() {
        return statusText;
    }

    public void setStatusText(String statusText) {
        this.statusText = statusText;
    }

    public String getCompanyUserName() {
        return companyUserName;
    }

    public void setCompanyUserName(String companyUserName) {
        this.companyUserName = companyUserName;
    }
    public Integer getIsAddQw() {
        return isAddQw;
    }

    public void setIsAddQw(Integer isAddQw) {
        this.isAddQw = isAddQw;
    }

    public Integer getIsShow() {
        return isShow;
    }

    public void setIsShow(Integer isShow) {
        this.isShow = isShow;
    }

    public String getPassword() {
        return password;
    }

    public Long getBirthday() {
        return birthday;
    }

    public FsUserScrm setBirthday(Long birthday) {
        this.birthday = birthday;
        return this;
    }

    public String getIdCard() {
        return idCard;
    }

    public FsUserScrm setIdCard(String idCard) {
        this.idCard = idCard;
        return this;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    public String getTuiUserId() {
        return tuiUserId;
    }

    public FsUserScrm setTuiUserId(String tuiUserId) {
        this.tuiUserId = tuiUserId;
        return this;
    }

    public Date getSpreadTime() {
        return spreadTime;
    }

    public FsUserScrm setSpreadTime(Date spreadTime) {
        this.spreadTime = spreadTime;
        return this;
    }

    public Date getTuiTime() {
        return tuiTime;
    }

    public FsUserScrm setTuiTime(Date tuiTime) {
        this.tuiTime = tuiTime;
        return this;
    }

    public String getUserType() {
        return userType;
    }

    public FsUserScrm setUserType(String userType) {
        this.userType = userType;
        return this;
    }

    public Long getPayCount() {
        return payCount;
    }

    public FsUserScrm setPayCount(Long payCount) {
        this.payCount = payCount;
        return this;
    }

    public Long getSpreadCount() {
        return spreadCount;
    }

    public FsUserScrm setSpreadCount(Long spreadCount) {
        this.spreadCount = spreadCount;
        return this;
    }

    public String getAddres() {
        return addres;
    }

    public FsUserScrm setAddres(String addres) {
        this.addres = addres;
        return this;
    }

    public Long getTuiUserCount() {
        return tuiUserCount;
    }

    public FsUserScrm setTuiUserCount(Long tuiUserCount) {
        this.tuiUserCount = tuiUserCount;
        return this;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public FsUserScrm setIsDel(Integer isDel) {
        this.isDel = isDel;
        return this;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public FsUserScrm setBalance(BigDecimal balance) {
        this.balance = balance;
        return this;
    }

    public Integer getIntegralStatus() {
        return integralStatus;
    }

    public FsUserScrm setIntegralStatus(Integer integralStatus) {
        this.integralStatus = integralStatus;
        return this;
    }

    public Integer getIsBuy() {
        return isBuy;
    }

    public FsUserScrm setIsBuy(Integer isBuy) {
        this.isBuy = isBuy;
        return this;
    }

    public String getStoreOpenId() {
        return storeOpenId;
    }

    public FsUserScrm setStoreOpenId(String storeOpenId) {
        this.storeOpenId = storeOpenId;
        return this;
    }

    public Integer getIsOfficialAccountAuth() {
        return isOfficialAccountAuth;
    }

    public FsUserScrm setIsOfficialAccountAuth(Integer isOfficialAccountAuth) {
        this.isOfficialAccountAuth = isOfficialAccountAuth;
        return this;
    }

    public Integer getIsPush() {
        return isPush;
    }

    public FsUserScrm setIsPush(Integer isPush) {
        this.isPush = isPush;
        return this;
    }

    public Integer getIsIndividuationPush() {
        return isIndividuationPush;
    }

    public FsUserScrm setIsIndividuationPush(Integer isIndividuationPush) {
        this.isIndividuationPush = isIndividuationPush;
        return this;
    }

    public String getLoginDevice() {
        return loginDevice;
    }

    public FsUserScrm setLoginDevice(String loginDevice) {
        this.loginDevice = loginDevice;
        return this;
    }

    public Long getParentId() {
        return parentId;
    }

    public FsUserScrm setParentId(Long parentId) {
        this.parentId = parentId;
        return this;
    }

    public Long getQwUserId() {
        return qwUserId;
    }

    public FsUserScrm setQwUserId(Long qwUserId) {
        this.qwUserId = qwUserId;
        return this;
    }

    public Integer getOrderCount() {
        return orderCount;
    }

    public FsUserScrm setOrderCount(Integer orderCount) {
        this.orderCount = orderCount;
        return this;
    }

    public Date getStartCreateTime() {
        return startCreateTime;
    }

    public FsUserScrm setStartCreateTime(Date startCreateTime) {
        this.startCreateTime = startCreateTime;
        return this;
    }

    public Date getEndCreateTime() {
        return endCreateTime;
    }

    public FsUserScrm setEndCreateTime(Date endCreateTime) {
        this.endCreateTime = endCreateTime;
        return this;
    }

    public Integer getIsBecomeMember() {
        return isBecomeMember;
    }

    public FsUserScrm setIsBecomeMember(Integer isBecomeMember) {
        this.isBecomeMember = isBecomeMember;
        return this;
    }

    public String getUsername() {
        return username;
    }

    public FsUserScrm setPassword(String password) {
        this.password = password;
        return this;
    }

    public String getJpushId() {
        return jpushId;
    }

    public void setJpushId(String jpushId) {
        this.jpushId = jpushId;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getIsVip() {
        return isVip;
    }

    public void setIsVip(Integer isVip) {
        this.isVip = isVip;
    }

    public Date getVipEndDate() {
        return vipEndDate;
    }

    public void setVipEndDate(Date vipEndDate) {
        this.vipEndDate = vipEndDate;
    }

    public BigDecimal getNowMoney() {
        return nowMoney;
    }

    public String getRealName() {
        return realName;
    }

    public FsUserScrm setRealName(String realName) {
        this.realName = realName;
        return this;
    }

    public String getLastIp() {
        return lastIp;
    }

    public FsUserScrm setLastIp(String lastIp) {
        this.lastIp = lastIp;
        return this;
    }

    public String getAvatar() {
        return avatar;
    }

    public FsUserScrm setAvatar(String avatar) {
        this.avatar = avatar;
        return this;
    }

    public Long getSignNum() {
        return signNum;
    }

    public FsUserScrm setSignNum(Long signNum) {
        this.signNum = signNum;
        return this;
    }

    public String getPhone() {
        return phone;
    }

    public FsUserScrm setPhone(String phone) {
        this.phone = phone;
        return this;
    }

    public Long getIntegral() {
        return integral;
    }

    public FsUserScrm setIntegral(Long integral) {
        this.integral = integral;
        return this;
    }

    public FsUserScrm setNowMoney(BigDecimal nowMoney) {
        this.nowMoney = nowMoney;
        return this;
    }

    public Long getSpreadUserId() {
        return spreadUserId;
    }

    public FsUserScrm setSpreadUserId(Long spreadUserId) {
        this.spreadUserId = spreadUserId;
        return this;
    }

    public Integer getIsPromoter() {
        return isPromoter;
    }

    public FsUserScrm setIsPromoter(Integer isPromoter) {
        this.isPromoter = isPromoter;
        return this;
    }

    public Date getVipStartDate() {
        return vipStartDate;
    }

    public void setVipStartDate(Date vipStartDate) {
        this.vipStartDate = vipStartDate;
    }

    public Integer getVipLevel() {
        return vipLevel;
    }

    public void setVipLevel(Integer vipLevel) {
        this.vipLevel = vipLevel;
    }

    public Integer getVipStatus() {
        return vipStatus;
    }

    public void setVipStatus(Integer vipStatus) {
        this.vipStatus = vipStatus;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getMaOpenId() {
        return maOpenId;
    }

    public void setMaOpenId(String maOpenId) {
        this.maOpenId = maOpenId;
    }

    public String getMpOpenId() {
        return mpOpenId;
    }

    public void setMpOpenId(String mpOpenId) {
        this.mpOpenId = mpOpenId;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public String getRegisterCode() {
        return registerCode;
    }

    public void setRegisterCode(String registerCode) {
        this.registerCode = registerCode;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Long getCompanyUserId() {
        return companyUserId;
    }

    public void setCompanyUserId(Long companyUserId) {
        this.companyUserId = companyUserId;
    }

    public Integer getIsWeixinAuth() {
        return isWeixinAuth;
    }

    public void setIsWeixinAuth(Integer isWeixinAuth) {
        this.isWeixinAuth = isWeixinAuth;
    }

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

    public Long getUserId()
    {
        return userId;
    }
    public void setUsername(String username)
    {
        this.username = username;
    }


    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getLevel() {
        return level;
    }

    public FsUserScrm setLevel(Integer level) {
        this.level = level;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public FsUserScrm setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public BigDecimal getBrokeragePrice() {
        return brokeragePrice;
    }

    public FsUserScrm setBrokeragePrice(BigDecimal brokeragePrice) {
        this.brokeragePrice = brokeragePrice;
        return this;
    }

    public String getHistoryApp() {
        return historyApp;
    }

    public void setHistoryApp(String historyApp) {
        this.historyApp = historyApp;
    }
}
