package com.ssm.manage.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ssm.manage.extendEntity.AchiCommEntity;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

@Table(name = "course_account")
public class CourseAccount implements Serializable {
    @Getter
    @Setter
//    @TableField(exist = false)
    @Transient
    private BigDecimal debtMoney;

    @Transient
    @Getter
    @Setter
    private String kaiKaDate;


    @Getter
    @Setter
    private String anotherName;


    @Getter
    @Setter
    private List<AchiCommEntity> entities;

    @Getter
    @Setter
    private List<Salesman> salesmanList;
    /**
     * 主键ID
     */
    @Id
    private Long id;

    /**
     * 会员ID
     */
    @Column(name = "member_id")
    @ExcelProperty("会员ID*")
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(name = "member_name")
    @ExcelProperty("会员名称*")
    private String memberName;

    /**
     * 会员卡
     */
    private String card;

    /**
     * 门店ID
     */
    @Column(name = "store_id")
    private Long storeId;

    /**
     * 门店名称
     */
    @Column(name = "store_name")
    private String storeName;

    /**
     * 开卡单号
     */
    @Column(name = "course_num")
    @ExcelProperty("开卡单号")
    private String courseNum;

    /**
     * 开卡疗程ID
     */
    @Column(name = "course_project_id")
    @ExcelProperty("开卡疗程ID*")
    private Long courseProjectId;

    /**
     * 开卡疗程ID
     */
    @Column(name = "course_project_num")
    @ExcelProperty("开卡疗程编码*")
    private String courseProjectNum;

    /**
     * 开卡疗程名称
     */
    @Column(name = "course_project_name")
    @ExcelProperty("开卡疗程名称*")
    private String courseProjectName;

    /**
     * 开卡疗程金额
     */
    @Column(name = "course_project_money")
    @ExcelProperty("开卡疗程金额*")
    private BigDecimal courseProjectMoney;

    /**
     * 开卡疗程次数
     */
    @Column(name = "course_count")
    @ExcelProperty("开卡疗程次数*")
    private Integer courseCount;

    /**
     * 开卡标准次数
     */
    @Column(name = "course_standard_count")
    @ExcelProperty("开卡标准次数*")
    private Integer courseStandardCount;

    /**
     * 开卡标准金额
     */
    @Column(name = "course_standard_money")
    @ExcelProperty("开卡标准金额*")
    private BigDecimal courseStandardMoney;

    /**
     * 最近消费时间
     */
    @Column(name = "last_consume_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelProperty("最近消费时间")
    private Date lastConsumeTime;

    /**
     * 开卡剩余次数
     */
    @Column(name = "course_rest_count")
    @ExcelProperty("开卡剩余次数*")
    private Integer courseRestCount;

    /**
     * 开卡可用次数
     */
    @Column(name = "course_consume_count")
    @ExcelProperty("开卡可用次数*")
    private Integer courseConsumeCount;

    /**
     * 账户类型0:疗程/1:促销/2:促销赠品
     */
    @Column(name = "course_type")
    @ExcelProperty("账户类型*")
    private String courseType;

    /**
     * 状态0:锁定/1:正常
     */
    @ExcelProperty("状态*")
    private Integer state;

    /**
     * 账户到期时间
     */
    @Column(name = "end_time")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ExcelProperty("账户到期时间")
    private Date endTime;

    /**
     * 修改人名称
     */
    @Column(name = "update_by")
    private String updateBy;

    /**
     * 修改人ID
     */
    @Column(name = "update_id")
    private Long updateId;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 修改时间
     */
    @Column(name = "price")
    private BigDecimal price;

    /**
     * 修改时间
     */
    @Column(name = "course_rest_price")
    private BigDecimal courseRestPrice;

    /**
     * 修改时间
     */
    @Column(name = "course_consume_price")
    private BigDecimal courseConsumePrice;

    /**
     * 修改时间
     */
    @Column(name = "store_num")
    private String storeNum;


    /**
     * 开卡疗程金额
     */
    @Column(name = "course_project_moneys")
    @ExcelProperty("开卡疗程金额*")
    private BigDecimal courseProjectMoneys;

    /**
     * 开卡疗程次数
     */
    @Column(name = "course_counts")
    @ExcelProperty("开卡疗程次数*")
    private Integer courseCounts;

    /**
     * 开卡疗程次数
     */
    @Column(name = "unrecorded_number")
    @ExcelProperty("欠款未到账次数*")
    private Integer unrecordedNumber;

    /**
     * 开卡疗程金额
     */
    @Column(name = "unrecorded_amount")
    @ExcelProperty("欠款未到账金额*")
    private BigDecimal unrecordedAmount;

    /**
     * 促销单据ID
     */
    @Column(name = "promotion_doc_id")
    private Long promotionDocId;

    /**
     * 取消欠款金额
     */
    @Column(name = "cancel_money")
    private BigDecimal cancelMoney;

    /**
     * 取消欠款次数
     */
    @Column(name = "cancel_num")
    private Integer cancelNum;
    /**
     * 取消欠款次数
     */
    @Column(name = "expenditure_money")
    private BigDecimal expenditureMoney;

    /**
     * 修改说明
     */
    @Column(name = "explain_modify")
    private String explainModify;

    public String getExplainModify() {
        return explainModify;
    }

    public void setExplainModify(String explainModify) {
        this.explainModify = explainModify;
    }



    public BigDecimal getExpenditureMoney() {
        return expenditureMoney;
    }

    public void setExpenditureMoney(BigDecimal expenditureMoney) {
        this.expenditureMoney = expenditureMoney;
    }

    public BigDecimal getCancelMoney() {
        return cancelMoney;
    }

    public void setCancelMoney(BigDecimal cancelMoney) {
        this.cancelMoney = cancelMoney;
    }

    public Integer getCancelNum() {
        return cancelNum;
    }

    public void setCancelNum(Integer cancelNum) {
        this.cancelNum = cancelNum;
    }

    public Long getPromotionDocId() {
        return promotionDocId;
    }

    public void setPromotionDocId(Long promotionDocId) {
        this.promotionDocId = promotionDocId;
    }

    public BigDecimal getUnrecordedAmount() {
        return unrecordedAmount;
    }

    public void setUnrecordedAmount(BigDecimal unrecordedAmount) {
        this.unrecordedAmount = unrecordedAmount;
    }

    public Integer getUnrecordedNumber() {
        return unrecordedNumber;
    }

    public void setUnrecordedNumber(Integer unrecordedNumber) {
        this.unrecordedNumber = unrecordedNumber;
    }

    public String getStoreNum() {
        return storeNum;
    }

    public void setStoreNum(String storeNum) {
        this.storeNum = storeNum;
    }

    private static final long serialVersionUID = 1L;

    public String getCourseProjectNum() {
        return courseProjectNum;
    }

    public void setCourseProjectNum(String courseProjectNum) {
        this.courseProjectNum = courseProjectNum;
    }

    public BigDecimal getCourseProjectMoneys() {
        return courseProjectMoneys;
    }

    public void setCourseProjectMoneys(BigDecimal courseProjectMoneys) {
        this.courseProjectMoneys = courseProjectMoneys;
    }

    public Integer getCourseCounts() {
        return courseCounts;
    }

    public void setCourseCounts(Integer courseCounts) {
        this.courseCounts = courseCounts;
    }

    /**
     * 获取主键ID
     *
     * @return id - 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置主键ID
     *
     * @param id 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取会员ID
     *
     * @return member_id - 会员ID
     */
    public Long getMemberId() {
        return memberId;
    }

    /**
     * 设置会员ID
     *
     * @param memberId 会员ID
     */
    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    /**
     * 获取会员名称
     *
     * @return member_name - 会员名称
     */
    public String getMemberName() {
        return memberName;
    }

    /**
     * 设置会员名称
     *
     * @param memberName 会员名称
     */
    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    /**
     * 获取会员卡
     *
     * @return card - 会员卡
     */
    public String getCard() {
        return card;
    }

    /**
     * 设置会员卡
     *
     * @param card 会员卡
     */
    public void setCard(String card) {
        this.card = card;
    }

    /**
     * 获取门店ID
     *
     * @return store_id - 门店ID
     */
    public Long getStoreId() {
        return storeId;
    }

    /**
     * 设置门店ID
     *
     * @param storeId 门店ID
     */
    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    /**
     * 获取门店名称
     *
     * @return store_name - 门店名称
     */
    public String getStoreName() {
        return storeName;
    }

    /**
     * 设置门店名称
     *
     * @param storeName 门店名称
     */
    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    /**
     * 获取开卡单号
     *
     * @return course_num - 开卡单号
     */
    public String getCourseNum() {
        return courseNum;
    }

    /**
     * 设置开卡单号
     *
     * @param courseNum 开卡单号
     */
    public void setCourseNum(String courseNum) {
        this.courseNum = courseNum;
    }

    /**
     * 获取开卡疗程ID
     *
     * @return course_project_id - 开卡疗程ID
     */
    public Long getCourseProjectId() {
        return courseProjectId;
    }

    /**
     * 设置开卡疗程ID
     *
     * @param courseProjectId 开卡疗程ID
     */
    public void setCourseProjectId(Long courseProjectId) {
        this.courseProjectId = courseProjectId;
    }

    /**
     * 获取开卡疗程名称
     *
     * @return course_project_name - 开卡疗程名称
     */
    public String getCourseProjectName() {
        return courseProjectName;
    }

    /**
     * 设置开卡疗程名称
     *
     * @param courseProjectName 开卡疗程名称
     */
    public void setCourseProjectName(String courseProjectName) {
        this.courseProjectName = courseProjectName;
    }

    /**
     * 获取开卡疗程金额
     *
     * @return course_project_money - 开卡疗程金额
     */
    public BigDecimal getCourseProjectMoney() {
        return courseProjectMoney;
    }

    /**
     * 设置开卡疗程金额
     *
     * @param courseProjectMoney 开卡疗程金额
     */
    public void setCourseProjectMoney(BigDecimal courseProjectMoney) {
        this.courseProjectMoney = courseProjectMoney;
    }

    /**
     * 获取开卡疗程次数
     *
     * @return course_count - 开卡疗程次数
     */
    public Integer getCourseCount() {
        return courseCount;
    }

    /**
     * 设置开卡疗程次数
     *
     * @param courseCount 开卡疗程次数
     */
    public void setCourseCount(Integer courseCount) {
        this.courseCount = courseCount;
    }

    /**
     * 获取开卡标准次数
     *
     * @return course_standard_count - 开卡标准次数
     */
    public Integer getCourseStandardCount() {
        return courseStandardCount;
    }

    /**
     * 设置开卡标准次数
     *
     * @param courseStandardCount 开卡标准次数
     */
    public void setCourseStandardCount(Integer courseStandardCount) {
        this.courseStandardCount = courseStandardCount;
    }

    /**
     * 获取开卡标准金额
     *
     * @return course_standard_money - 开卡标准金额
     */
    public BigDecimal getCourseStandardMoney() {
        return courseStandardMoney;
    }

    /**
     * 设置开卡标准金额
     *
     * @param courseStandardMoney 开卡标准金额
     */
    public void setCourseStandardMoney(BigDecimal courseStandardMoney) {
        this.courseStandardMoney = courseStandardMoney;
    }

    /**
     * 获取最近消费时间
     *
     * @return last_consume_time - 最近消费时间
     */
    public Date getLastConsumeTime() {
        return lastConsumeTime;
    }

    /**
     * 设置最近消费时间
     *
     * @param lastConsumeTime 最近消费时间
     */
    public void setLastConsumeTime(Date lastConsumeTime) {
        this.lastConsumeTime = lastConsumeTime;
    }

    /**
     * 获取开卡剩余次数
     *
     * @return course_rest_count - 开卡剩余次数
     */
    public Integer getCourseRestCount() {
        return courseRestCount;
    }

    /**
     * 设置开卡剩余次数
     *
     * @param courseRestCount 开卡剩余次数
     */
    public void setCourseRestCount(Integer courseRestCount) {
        this.courseRestCount = courseRestCount;
    }

    /**
     * 获取开卡可用次数
     *
     * @return course_consume_count - 开卡可用次数
     */
    public Integer getCourseConsumeCount() {
        return courseConsumeCount;
    }

    /**
     * 设置开卡可用次数
     *
     * @param courseConsumeCount 开卡可用次数
     */
    public void setCourseConsumeCount(Integer courseConsumeCount) {
        this.courseConsumeCount = courseConsumeCount;
    }

    /**
     * 获取账户类型0:疗程/1:促销/2:促销赠品
     *
     * @return course_type - 账户类型0:疗程/1:促销/2:促销赠品
     */
    public String getCourseType() {
        return courseType;
    }

    /**
     * 设置账户类型0:疗程/1:促销/2:促销赠品
     *
     * @param courseType 账户类型0:疗程/1:促销/2:促销赠品
     */
    public void setCourseType(String courseType) {
        this.courseType = courseType;
    }

    /**
     * 获取0:锁定/1:正常
     *
     * @return state - 0:锁定/1:正常
     */
    public Integer getState() {
        return state;
    }

    /**
     * 设置0:锁定/1:正常
     *
     * @param state 0:锁定/1:正常
     */
    public void setState(Integer state) {
        this.state = state;
    }

    /**
     * 获取账户到期时间
     *
     * @return end_time - 账户到期时间
     */
    public Date getEndTime() {
        return endTime;
    }

    /**
     * 设置账户到期时间
     *
     * @param endTime 账户到期时间
     */
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    /**
     * 获取修改人名称
     *
     * @return update_by - 修改人名称
     */
    public String getUpdateBy() {
        return updateBy;
    }

    /**
     * 设置修改人名称
     *
     * @param updateBy 修改人名称
     */
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    /**
     * 获取修改人ID
     *
     * @return update_id - 修改人ID
     */
    public Long getUpdateId() {
        return updateId;
    }

    /**
     * 设置修改人ID
     *
     * @param updateId 修改人ID
     */
    public void setUpdateId(Long updateId) {
        this.updateId = updateId;
    }

    /**
     * 获取修改时间
     *
     * @return update_time - 修改时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置修改时间
     *
     * @param updateTime 修改时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getCourseRestPrice() {
        return courseRestPrice;
    }

    public void setCourseRestPrice(BigDecimal courseRestPrice) {
        this.courseRestPrice = courseRestPrice;
    }

    public BigDecimal getCourseConsumePrice() {
        return courseConsumePrice;
    }

    public void setCourseConsumePrice(BigDecimal courseConsumePrice) {
        this.courseConsumePrice = courseConsumePrice;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CourseAccount other = (CourseAccount) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getMemberId() == null ? other.getMemberId() == null : this.getMemberId().equals(other.getMemberId()))
            && (this.getMemberName() == null ? other.getMemberName() == null : this.getMemberName().equals(other.getMemberName()))
            && (this.getCard() == null ? other.getCard() == null : this.getCard().equals(other.getCard()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
            && (this.getCourseNum() == null ? other.getCourseNum() == null : this.getCourseNum().equals(other.getCourseNum()))
            && (this.getCourseProjectId() == null ? other.getCourseProjectId() == null : this.getCourseProjectId().equals(other.getCourseProjectId()))
            && (this.getCourseProjectName() == null ? other.getCourseProjectName() == null : this.getCourseProjectName().equals(other.getCourseProjectName()))
            && (this.getCourseProjectMoney() == null ? other.getCourseProjectMoney() == null : this.getCourseProjectMoney().equals(other.getCourseProjectMoney()))
            && (this.getCourseCount() == null ? other.getCourseCount() == null : this.getCourseCount().equals(other.getCourseCount()))
            && (this.getCourseStandardCount() == null ? other.getCourseStandardCount() == null : this.getCourseStandardCount().equals(other.getCourseStandardCount()))
            && (this.getCourseStandardMoney() == null ? other.getCourseStandardMoney() == null : this.getCourseStandardMoney().equals(other.getCourseStandardMoney()))
            && (this.getLastConsumeTime() == null ? other.getLastConsumeTime() == null : this.getLastConsumeTime().equals(other.getLastConsumeTime()))
            && (this.getCourseRestCount() == null ? other.getCourseRestCount() == null : this.getCourseRestCount().equals(other.getCourseRestCount()))
            && (this.getCourseConsumeCount() == null ? other.getCourseConsumeCount() == null : this.getCourseConsumeCount().equals(other.getCourseConsumeCount()))
            && (this.getCourseType() == null ? other.getCourseType() == null : this.getCourseType().equals(other.getCourseType()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateId() == null ? other.getUpdateId() == null : this.getUpdateId().equals(other.getUpdateId()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getCourseConsumePrice() == null ? other.getCourseConsumePrice() == null : this.getCourseConsumePrice().equals(other.getCourseConsumePrice()))
            && (this.getCourseRestPrice() == null ? other.getCourseRestPrice() == null : this.getCourseRestPrice().equals(other.getCourseRestPrice()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
                && (this.getExplainModify() == null ? other.getExplainModify() == null : this.getExplainModify().equals(other.getExplainModify()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getMemberId() == null) ? 0 : getMemberId().hashCode());
        result = prime * result + ((getMemberName() == null) ? 0 : getMemberName().hashCode());
        result = prime * result + ((getCard() == null) ? 0 : getCard().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
        result = prime * result + ((getCourseNum() == null) ? 0 : getCourseNum().hashCode());
        result = prime * result + ((getCourseProjectId() == null) ? 0 : getCourseProjectId().hashCode());
        result = prime * result + ((getCourseProjectName() == null) ? 0 : getCourseProjectName().hashCode());
        result = prime * result + ((getCourseProjectMoney() == null) ? 0 : getCourseProjectMoney().hashCode());
        result = prime * result + ((getCourseCount() == null) ? 0 : getCourseCount().hashCode());
        result = prime * result + ((getCourseStandardCount() == null) ? 0 : getCourseStandardCount().hashCode());
        result = prime * result + ((getCourseStandardMoney() == null) ? 0 : getCourseStandardMoney().hashCode());
        result = prime * result + ((getLastConsumeTime() == null) ? 0 : getLastConsumeTime().hashCode());
        result = prime * result + ((getCourseRestCount() == null) ? 0 : getCourseRestCount().hashCode());
        result = prime * result + ((getCourseConsumeCount() == null) ? 0 : getCourseConsumeCount().hashCode());
        result = prime * result + ((getCourseType() == null) ? 0 : getCourseType().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateId() == null) ? 0 : getUpdateId().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getCourseConsumePrice() == null) ? 0 : getCourseConsumePrice().hashCode());
        result = prime * result + ((getCourseRestPrice() == null) ? 0 : getCourseRestPrice().hashCode());
        result = prime * result + ((getExplainModify() == null) ? 0 : getExplainModify().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", memberId=").append(memberId);
        sb.append(", memberName=").append(memberName);
        sb.append(", card=").append(card);
        sb.append(", storeId=").append(storeId);
        sb.append(", storeName=").append(storeName);
        sb.append(", courseNum=").append(courseNum);
        sb.append(", courseProjectId=").append(courseProjectId);
        sb.append(", courseProjectName=").append(courseProjectName);
        sb.append(", courseProjectMoney=").append(courseProjectMoney);
        sb.append(", courseCount=").append(courseCount);
        sb.append(", courseStandardCount=").append(courseStandardCount);
        sb.append(", courseStandardMoney=").append(courseStandardMoney);
        sb.append(", lastConsumeTime=").append(lastConsumeTime);
        sb.append(", courseRestCount=").append(courseRestCount);
        sb.append(", courseConsumeCount=").append(courseConsumeCount);
        sb.append(", courseType=").append(courseType);
        sb.append(", state=").append(state);
        sb.append(", endTime=").append(endTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateId=").append(updateId);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", price=").append(price);
        sb.append(", courseRestPrice=").append(courseRestPrice);
        sb.append(", courseConsumePrice=").append(courseConsumePrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append(", explainModify=").append(explainModify);
        sb.append("]");
        return sb.toString();
    }
}