package com.ruoyi.voluntary.domain;

import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * vip卡对象 b_busi_cards
 *
 * @author voluntary
 * @date 2022-11-20
 */
public class BusiCards extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long cardId;
    private List<Long> cardIds;

    /** 账号 */
    @Excel(name = "卡号", sort = 0)
    private String cardNo;

    /** 密码 */
    @Excel(name = "密码", sort = 1)
    private String password;

    @Excel(name = "卡类型", sort = 2, dictType = "card_type")
    private Integer type;

    /** 学校 */
    private Long schoolId;
    @Excel(name = "学校", sort = 3)
    private String schoolName;

    @Excel(name = "姓名_手机", sort = 4)
    private String nameMobile;

    @Excel(name = "高考年份", sort = 5)
    private Integer endYear;

    /** 班级ID */
    private Long classId;
    @Excel(name = "班级", sort = 6)
    private String className;

    /** 代理商ID */
    private Long agentId;
    @Excel(name = "代理商", sort = 7)
    private String agentName;

    /** 卡状态 0未分配，1已分配，2已激活，9已过期，10已关卡 */
    @Excel(name = "卡状态", sort = 8, readConverterExp = "0=未分配,1=已分配,2=已激活,9=已过期,10=已关卡")
    private Integer status;

    @Excel(name = "缴费状态", sort = 9, readConverterExp = "0=未缴费,1=已缴费,2=已退费")
    private Integer payStatus;

    /** 分配时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开卡时间", sort = 10, width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date distributeTime;

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

    /** 失效时间/到期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "到期时间", sort = 12, width = 30, dateFormat = "yyyy-MM-dd")
    private Date outDate;

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

    /** 用户姓名 */
    private String nickName;

    /** 分配学校ID */
    private Integer distributeType;
    private Integer distributeProvinceId; // 上传的省份id
    private String distributeLocation;
    private Long distributeSchoolId;
    private String distributeSchoolName;
    private String distributeExamType;

    private String customSchoolName;
    private String customClassName;

    /** 年级 */
    private Long gradeId;
    private String gradeName;

    /** 班级/入学年份 */
    private Integer year;
    //增加减少天数
    private Integer days;

    /** 是否付费(0:未缴费,1:已缴费) */
    private Integer isPay;

    /** 是否退费(0:否,1:是) */
    private Integer isRefund;

    /** 是否结算(0:否,1:是) */
    private Integer isSettlement;

    /** 是否使用(电子卡才使用此字段；0:否,1:是) */
    private Integer isUsed;
    private Integer isSend;

    /** 关卡ID */
    private Long closeId;

    /** 开卡ID */
    private Long openId;

    /** 退费时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date refundTime;

    /** 关卡时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date closeTime;

    private Integer cardNum;

    private String startCard;

    private String endCard;

    private String endOutTime;

    // 重新分配卡
    private Integer againDistributionCard;

    /** 省 */
    private Long pro;

    /** 市 */
    private Long city;

    /** 区 */
    private Long area;

    private String name;
    private String mobile;
    private Integer groupId;
    private Integer score;

    public Integer getDays() {
        return days;
    }

    public void setDays(Integer days) {
        this.days = days;
    }

    public Long getPro() {
        return pro;
    }

    public void setPro(Long pro) {
        this.pro = pro;
    }

    public Long getCity() {
        return city;
    }

    public void setCity(Long city) {
        this.city = city;
    }

    public Long getArea() {
        return area;
    }

    public void setArea(Long area) {
        this.area = area;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public Integer getAgainDistributionCard() {
        return againDistributionCard;
    }

    public void setAgainDistributionCard(Integer againDistributionCard) {
        this.againDistributionCard = againDistributionCard;
    }

    public String getEndOutTime() {
        return endOutTime;
    }

    public void setEndOutTime(String endOutTime) {
        this.endOutTime = endOutTime;
    }

    public String getStartCard() {
        return startCard;
    }

    public BusiCards setStartCard(String startCard) {
        this.startCard = startCard;
        return this;
    }

    public String getEndCard() {
        return endCard;
    }

    public BusiCards setEndCard(String endCard) {
        this.endCard = endCard;
        return this;
    }

    public Integer getCardNum() {
        return cardNum;
    }

    public void setCardNum(Integer cardNum) {
        this.cardNum = cardNum;
    }

    public Integer getType() {
        return type;
    }

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

    public void setCardId(Long cardId) {
        this.cardId = cardId;
    }

    public Long getCardId() {
        return cardId;
    }

    public List<Long> getCardIds() {
        return cardIds;
    }

    public BusiCards setCardIds(List<Long> cardIds) {
        this.cardIds = cardIds;
        return this;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getCardNo() {
        return cardNo;
    }

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

    public String getNickName() {
        return nickName;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public Integer getDistributeType() {
        return distributeType;
    }

    public void setDistributeType(Integer distributeType) {
        this.distributeType = distributeType;
    }

    public Integer getDistributeProvinceId() {
        return distributeProvinceId;
    }

    public void setDistributeProvinceId(Integer distributeProvinceId) {
        this.distributeProvinceId = distributeProvinceId;
    }

    public String getDistributeLocation() {
        return distributeLocation;
    }

    public void setDistributeLocation(String distributeLocation) {
        this.distributeLocation = distributeLocation;
    }

    public void setDistributeSchoolId(Long distributeSchoolId) {
        this.distributeSchoolId = distributeSchoolId;
    }

    public Long getDistributeSchoolId() {
        return distributeSchoolId;
    }

    public void setGradeId(Long gradeId) {
        this.gradeId = gradeId;
    }

    public Long getGradeId() {
        return gradeId;
    }

    public void setClassId(Long classId) {
        this.classId = classId;
    }

    public Long getClassId() {
        return classId;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getYear() {
        return year;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public Long getAgentId() {
        return agentId;
    }

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

    public String getPassword() {
        return password;
    }

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

    public Integer getStatus() {
        return status;
    }

    public void setIsPay(Integer isPay) {
        this.isPay = isPay;
    }

    public Integer getIsPay() {
        return isPay;
    }

    public void setIsRefund(Integer isRefund) {
        this.isRefund = isRefund;
    }

    public Integer getIsRefund() {
        return isRefund;
    }

    public void setIsSettlement(Integer isSettlement) {
        this.isSettlement = isSettlement;
    }

    public Integer getIsSettlement() {
        return isSettlement;
    }

    public void setIsUsed(Integer isUsed) {
        this.isUsed = isUsed;
    }

    public Integer getIsUsed() {
        return isUsed;
    }

    public void setCloseId(Long closeId) {
        this.closeId = closeId;
    }

    public Long getCloseId() {
        return closeId;
    }

    public void setOpenId(Long openId) {
        this.openId = openId;
    }

    public Long getOpenId() {
        return openId;
    }

    public void setDistributeTime(Date distributeTime) {
        this.distributeTime = distributeTime;
    }

    public Date getDistributeTime() {
        return distributeTime;
    }

    public void setOutDate(Date outDate) {
        this.outDate = outDate;
    }

    public Date getOutDate() {
        return outDate;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setActiveTime(Date activeTime) {
        this.activeTime = activeTime;
    }

    public Date getActiveTime() {
        return activeTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public void setCloseTime(Date closeTime) {
        this.closeTime = closeTime;
    }

    public Date getCloseTime() {
        return closeTime;
    }

    public Integer getIsSend() {
        return isSend;
    }

    public void setIsSend(Integer isSend) {
        this.isSend = isSend;
    }

    public String getSchoolName() {
        return schoolName;
    }

    public void setSchoolName(String schoolName) {
        this.schoolName = schoolName;
    }

    public String getNameMobile() {
        if (StringUtils.isBlank(nameMobile)) {
            nameMobile = String.format("%s_%s", StringUtils.trimToEmpty(name), StringUtils.trimToEmpty(mobile));
        }
        return nameMobile;
    }

    public void setNameMobile(String nameMobile) {
        this.nameMobile = nameMobile;
    }

    public Integer getEndYear() {
        if(null==this.endYear&&null!=this.year){
            return this.year+3;
        }
        return this.endYear;
    }

    public void setEndYear(Integer endYear) {
        this.endYear = endYear;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public String getDistributeSchoolName() {
        return distributeSchoolName;
    }

    public void setDistributeSchoolName(String distributeSchoolName) {
        this.distributeSchoolName = distributeSchoolName;
    }

    public String getDistributeExamType() {
        return distributeExamType;
    }

    public void setDistributeExamType(String distributeExamType) {
        this.distributeExamType = distributeExamType;
    }

    public String getGradeName() {
        return gradeName;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public String getCustomSchoolName() {
        return customSchoolName;
    }

    public void setCustomSchoolName(String customSchoolName) {
        this.customSchoolName = customSchoolName;
    }

    public String getCustomClassName() {
        return customClassName;
    }

    public void setCustomClassName(String customClassName) {
        this.customClassName = customClassName;
    }

    public Integer getGaokaoYear() {
        return endYear;
    }

    public void setGaokaoYear(Integer gaokaoYear) {
        this.endYear = gaokaoYear;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("cardId", getCardId()).append("cardNo", getCardNo())
            .append("nickName", getNickName()).append("schoolId", getSchoolId()).append("distributeSchoolId", getDistributeSchoolId())
            .append("gradeId", getGradeId()).append("classId", getClassId()).append("year", getYear()).append("agentId", getAgentId())
            .append("password", getPassword()).append("status", getStatus()).append("isPay", getIsPay()).append("isRefund", getIsRefund())
            .append("isSettlement", getIsSettlement()).append("isUsed", getIsUsed()).append("closeId", getCloseId())
            .append("openId", getOpenId()).append("remark", getRemark()).append("distributeTime", getDistributeTime())
            .append("outDate", getOutDate()).append("payTime", getPayTime()).append("activeTime", getActiveTime())
            .append("refundTime", getRefundTime()).append("closeTime", getCloseTime()).append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime()).toString();
    }

}
