package com.goafanti.common.model;

import com.goafanti.common.constant.AFTConstants;
import com.goafanti.common.utils.DateUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * finance_count
 * @author
 */
public class FinanceCount implements Serializable {
    private Integer id;

    /**
     * 管理员编号
     */
    private String aid;

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

    /**
     * 订单未审核数
     */
    private Integer orderUnauditedCount;

    /**
     * 报销数
     */
    private Integer expenseCount;

    /**
     * 报销未审核数
     */
    private Integer expenseUnauditedCount;

    /**
     * 开票数
     */
    private Integer invoiceCount;

    /**
     * 开票未审核数
     */
    private Integer invoiceUnauditedCount;

    /**
     * 会员审核数
     */
    private Integer memberCount;

    /**
     * 会员未审核数
     */
    private Integer memberUnauditedCount;

    /**
     * 成本审核数
     */
    private Integer paymentCount;

    /**
     * 成本未审核数
     */
    private Integer paymentUnauditedCount;

    /**
     * 日期
     */
    private Date dateTime;

    /**
     * 创建时间
     */
    private Date createTime;

    private static final long serialVersionUID = 1L;

    public FinanceCount(){

    }
    public static FinanceCount  initialization(String aid,Date date){
        FinanceCount financeCount=new FinanceCount();
        financeCount.aid=aid;
        financeCount.orderCount=0;
        financeCount.orderUnauditedCount=0;
        financeCount.expenseCount=0;
        financeCount.expenseUnauditedCount=0;
        financeCount.invoiceCount=0;
        financeCount.invoiceUnauditedCount=0;
        financeCount.memberCount=0;
        financeCount.memberUnauditedCount=0;
        financeCount.paymentCount=0;
        financeCount.paymentUnauditedCount=0;
        if (date!=null)financeCount.dateTime= date;
        return financeCount;
    }

    public static FinanceCount initialization(String aid, String date) {
        Date toDate = DateUtils.StringToDate(date, AFTConstants.YYYYMMDD);
        return initialization(aid, toDate);
    }

    public static FinanceCount initialization(FinanceCount in) {
        if (in.getOrderCount()==null)in.setOrderCount(0);
        if (in.getOrderUnauditedCount()==null)in.setOrderUnauditedCount(0);
        if (in.getExpenseCount()==null)in.setExpenseCount(0);
        if (in.getExpenseUnauditedCount()==null)in.setExpenseUnauditedCount(0);
        if (in.getInvoiceCount()==null)in.setInvoiceCount(0);
        if (in.getInvoiceUnauditedCount()==null)in.setInvoiceUnauditedCount(0);
        if (in.getMemberCount()==null)in.setMemberCount(0);
        if (in.getMemberUnauditedCount()==null)in.setMemberUnauditedCount(0);
        if (in.getPaymentCount()==null)in.setPaymentCount(0);
        if (in.getPaymentUnauditedCount()==null)in.setPaymentUnauditedCount(0);
        return in;
    }

    public Integer getId() {
        return id;
    }

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

    public String getAid() {
        return aid;
    }

    public void setAid(String aid) {
        this.aid = aid;
    }

    public Integer getOrderCount() {
        return orderCount;
    }

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

    public Integer getOrderUnauditedCount() {
        return orderUnauditedCount;
    }

    public void setOrderUnauditedCount(Integer orderUnauditedCount) {
        this.orderUnauditedCount = orderUnauditedCount;
    }

    public Integer getExpenseCount() {
        return expenseCount;
    }

    public void setExpenseCount(Integer expenseCount) {
        this.expenseCount = expenseCount;
    }

    public Integer getExpenseUnauditedCount() {
        return expenseUnauditedCount;
    }

    public void setExpenseUnauditedCount(Integer expenseUnauditedCount) {
        this.expenseUnauditedCount = expenseUnauditedCount;
    }

    public Integer getInvoiceCount() {
        return invoiceCount;
    }

    public void setInvoiceCount(Integer invoiceCount) {
        this.invoiceCount = invoiceCount;
    }

    public Integer getInvoiceUnauditedCount() {
        return invoiceUnauditedCount;
    }

    public void setInvoiceUnauditedCount(Integer invoiceUnauditedCount) {
        this.invoiceUnauditedCount = invoiceUnauditedCount;
    }

    public Integer getMemberCount() {
        return memberCount;
    }

    public void setMemberCount(Integer memberCount) {
        this.memberCount = memberCount;
    }

    public Integer getMemberUnauditedCount() {
        return memberUnauditedCount;
    }

    public void setMemberUnauditedCount(Integer memberUnauditedCount) {
        this.memberUnauditedCount = memberUnauditedCount;
    }

    public Integer getPaymentCount() {
        return paymentCount;
    }

    public void setPaymentCount(Integer paymentCount) {
        this.paymentCount = paymentCount;
    }

    public Integer getPaymentUnauditedCount() {
        return paymentUnauditedCount;
    }

    public void setPaymentUnauditedCount(Integer paymentUnauditedCount) {
        this.paymentUnauditedCount = paymentUnauditedCount;
    }

    public Date getDateTime() {
        return dateTime;
    }

    public void setDateTime(Date dateTime) {
        this.dateTime = dateTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "FinanceCount{" +
                "id=" + id +
                ", aid='" + aid + '\'' +
                ", orderCount=" + orderCount +
                ", orderUnauditedCount=" + orderUnauditedCount +
                ", expenseCount=" + expenseCount +
                ", expenseUnauditedCount=" + expenseUnauditedCount +
                ", invoiceCount=" + invoiceCount +
                ", invoiceUnauditedCount=" + invoiceUnauditedCount +
                ", memberCount=" + memberCount +
                ", memberUnauditedCount=" + memberUnauditedCount +
                ", paymentCount=" + paymentCount +
                ", paymentUnauditedCount=" + paymentUnauditedCount +
                ", dateTime=" + dateTime +
                ", createTime=" + createTime +
                '}';
    }
}
