package com.willalp.integral.domain;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.willalp.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

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

/**
 * 积分管理对象 pns_integral
 *
 * @author willalp
 * @date 2021-12-02
 */

@TableName("pns_integral")
public class Integral {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId
    private String id;

    /**
     * 金额类型
     */
    @Excel(name = "金额类型", readConverterExp = "1=押金,2=集体充值,3=个人充值,4=退还", type = Excel.Type.EXPORT)
    private Integer moneyType;

    /**
     * 充值设备编码
     */
    @Excel(name = "充值设备编码", type = Excel.Type.EXPORT)
    private String rechargeEquipmentCode;

    /**
     * 充值设备名称
     */
    @Excel(name = "充值设备名称", type = Excel.Type.EXPORT)
    private String rechargeEquipmentName;

    /**
     * 登录名称
     */
    @Excel(name = "用户编码", type = Excel.Type.EXPORT)
    private String loginName;

    /**
     * 账户名称
     */
    @Excel(name = "账户名称")
    private String nickName;

    /**
     * 卡片编号
     */
    @Excel(name = "卡片编号", type = Excel.Type.EXPORT)
    private String cardNumber;

    /**
     * 卡片名称
     */
    @Excel(name = "卡片名称", type = Excel.Type.EXPORT)
    private String cardName;

    /**
     * 充值时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @Excel(name = "充值时间", width = 30, dateFormat = DatePattern.NORM_DATETIME_PATTERN, type = Excel.Type.EXPORT)
    private Date rechargeTime;

    @TableField(exist = false)
    @Excel(name = "手机号")
    private String phonenumber;

    /**
     * 充值积分
     */
    @Excel(name = "充值积分")
    private BigDecimal rechargeIntegral;

    @Excel(name = "订单编号", type = Excel.Type.EXPORT)
    private String orderNumber;

    /**
     * 是否删除(1:是,0:否)
     */
    @TableLogic
    private Integer isDelete;

    /**
     * 机构代码
     */
    @Excel(name = "机构代码", type = Excel.Type.EXPORT)
    private String organizationCode;

    /**
     * 操作账户编号
     */
    private Long rechargeId;

    private Date updateTime;

    @TableField(exist = false)
    private List<String> organizations;

    @TableField(exist = false)
    private String rechargeNickName;

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

    public String getId() {
        return id;
    }

    public void setMoneyType(Integer moneyType) {
        this.moneyType = moneyType;
    }

    public Integer getMoneyType() {
        return moneyType;
    }

    public void setRechargeEquipmentCode(String rechargeEquipmentCode) {
        this.rechargeEquipmentCode = rechargeEquipmentCode;
    }

    public String getRechargeEquipmentCode() {
        return rechargeEquipmentCode;
    }

    public void setRechargeEquipmentName(String rechargeEquipmentName) {
        this.rechargeEquipmentName = rechargeEquipmentName;
    }

    public String getRechargeEquipmentName() {
        return rechargeEquipmentName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardName(String cardName) {
        this.cardName = cardName;
    }

    public String getCardName() {
        return cardName;
    }

    public void setRechargeTime(Date rechargeTime) {
        this.rechargeTime = rechargeTime;
    }

    public Date getRechargeTime() {
        return rechargeTime;
    }

    public void setRechargeIntegral(BigDecimal rechargeIntegral) {
        this.rechargeIntegral = rechargeIntegral;
    }

    public BigDecimal getRechargeIntegral() {
        return rechargeIntegral;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setOrganizationCode(String organizationCode) {
        this.organizationCode = organizationCode;
    }

    public String getOrganizationCode() {
        return organizationCode;
    }

    public void setRechargeId(Long rechargeId) {
        this.rechargeId = rechargeId;
    }

    public Long getRechargeId() {
        return rechargeId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public List<String> getOrganizations() {
        return organizations;
    }

    public void setOrganizations(List<String> organizations) {
        this.organizations = organizations;
    }

    public String getRechargeNickName() {
        return rechargeNickName;
    }

    public void setRechargeNickName(String rechargeNickName) {
        this.rechargeNickName = rechargeNickName;
    }

    public String getPhonenumber() {
        return phonenumber;
    }

    public void setPhonenumber(String phonenumber) {
        this.phonenumber = phonenumber;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("moneyType", getMoneyType())
                .append("rechargeEquipmentCode", getRechargeEquipmentCode())
                .append("rechargeEquipmentName", getRechargeEquipmentName())
                .append("loginName", getLoginName())
                .append("nickName", getNickName())
                .append("cardNumber", getCardNumber())
                .append("cardName", getCardName())
                .append("rechargeTime", getRechargeTime())
                .append("rechargeIntegral", getRechargeIntegral())
                .append("isDelete", getIsDelete())
                .append("organizationCode", getOrganizationCode())
                .append("rechargeId", getRechargeId())
                .append("updateTime", getUpdateTime())
                .append("orderNumber", getOrderNumber())
                .append("phonenumber", getPhonenumber())
                .toString();
    }
}
