package cn.hnthyy.thmz.vo;

import cn.hnthyy.thmz.Utils.NumberToCN;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 收款类别统计
 */
@Data
public class ChargeCountVo {
    //现金实收金额
    private BigDecimal xjss;
    //现金收款金额
    private BigDecimal xjsk;
    //银行卡实收金额
    private BigDecimal yhkss;
    //银行卡收款金额
    private BigDecimal yhksk;
    //医保卡实收金额
    private BigDecimal sybkss;
    //医保卡收款金额
    private BigDecimal sybksk;
    //记账绿色通道实收金额
    private BigDecimal zfss;
    //记账绿色通道收款金额
    private BigDecimal zfsk;
    //现金退费金额
    private BigDecimal xjtf;
    //银行卡退费金额
    private BigDecimal yhktf;
    //医保卡退费金额
    private BigDecimal sybtf;
    //记账绿色通道退费金额
    private BigDecimal zftf;
    //总计实收金额
    private BigDecimal zjss;
    //总计收款金额
    private BigDecimal zjsk;
    //总计退款金额
    private BigDecimal zjtk;
    //微信实收金额
    private BigDecimal wxss;
    //微信收款金额
    private BigDecimal wxsk;
    //支付宝实收金额
    private BigDecimal zfbss;
    //支付宝收款金额
    private BigDecimal zfbsk;
    //微信退费金额
    private BigDecimal wxtf;
    //支付宝退费金额
    private BigDecimal zfbtf;
    //现金收款笔数
    private Integer xjbs;
    //银行卡收款次数
    private Integer yhsbs;
    //医保卡收款次数
    private Integer sybbs;
    //绿色记账收款次数
    private Integer zfbs;
    //现金退费笔数
    private Integer xjtfbs;
    //银行卡退费笔数
    private Integer yhktfbs;
    //医保卡退费笔数
    private Integer sybtfbs;
    //绿色记账退费笔数
    private Integer zftfbs;
    //总计笔数
    private Integer zjbs;
    //总退费笔数
    private Integer ztfbs;
    //微信收款笔数
    private Integer wxbs;
    //支付宝收款笔数
    private Integer zfbbs;
    //微信退费笔数
    private Integer wxtfbs;
    //支付宝退费笔数
    private Integer zfbtfbs;
    //医保记账笔数
    private Integer ybjzbs;
    //医保记账收款
    private BigDecimal ybjzsk;
    //医保记账退费笔数
    private Integer ybjztfbs;
    //医保记账收款
    private BigDecimal ybjztf;
    //医保记账实收笔数
    private Integer ybjzssbs;
    //医保记账实收
    private BigDecimal ybjzss;
    //以下次数公式为收款次数--退费次数
    //现金实收笔数
    private Integer xjssbs;
    //银行卡实收笔数
    private Integer yhkssbs;
    //医保卡实收笔数
    private Integer sybssbs;
    //绿色记账实收笔数
    private Integer zfssbs;
    //总计实收笔数
    private Integer zjssbs;
//    //总实收笔数
//    private Integer zssbs;
    //微信实收笔数
    private Integer wxssbs;
    //支付宝实收笔数
    private Integer zfbssbs;
    //微信自助实收
    private BigDecimal wxzzss;
    //微信自助收款
    private BigDecimal wxzzsk;
    //微信自助收款笔数
    private Integer wxzzbs;
    //微信自助退费笔数
    private Integer wxzztfbs;
    //微信自助退费
    private Integer wxzztf;
    //微信自助实收笔数
    private Integer wxzzssbs;
    //支付宝自助实收
    private BigDecimal zfbzzss;
    //支付宝自助收款
    private BigDecimal zfbzzsk;
    //支付宝自助收款笔数
    private Integer zfbzzbs;
    //支付宝自助退费笔数
    private Integer zfbzztfbs;
    //支付宝自助退费
    private Integer zfbzztf;
    //支付宝自助实收笔数
    private Integer zfbzzssbs;
    //以上次数公式为收款次数--退费次数

    //实缴合计
    private BigDecimal sjhj;
    //总计
    private BigDecimal zj;
    //实缴合计大写
    private String sjhjdx;
    //总计大写
    private String zjdx;
    //自费（记账）大写
    private String zfdx;
    //医保卡记账大写
    private String ybkjzhjdx;
    /**
     * 设置实收笔数
     */
    public void fomartChargeCountVo(){
        if(ybjzbs==null){
            ybjzbs=0;
        }
        if(ybjztfbs==null){
            ybjztfbs=0;
        }
        ybjzssbs=ybjzbs-ybjztfbs;

        if(xjbs==null){
            xjbs=0;
        }
        if(xjtfbs==null){
            xjtfbs=0;
        }
        xjssbs=xjbs-xjtfbs;

        if(yhsbs==null){
            yhsbs=0;
        }
        if(yhktfbs==null){
            yhktfbs=0;
        }
        yhkssbs=yhsbs-yhktfbs;

        if(sybbs==null){
            sybbs=0;
        }
        if(sybtfbs==null){
            sybtfbs=0;
        }
        sybssbs=sybbs-sybtfbs;

        if(zfbs==null){
            zfbs=0;
        }
        if(zftfbs==null){
            zftfbs=0;
        }
        zfssbs=zfbs-zftfbs;

        if(wxbs==null){
            wxbs=0;
        }
        if(wxtfbs==null){
            wxtfbs=0;
        }
        wxssbs=wxbs-wxtfbs;

        if(zfbbs==null){
            zfbbs=0;
        }
        if(zfbtfbs==null){
            zfbtfbs=0;
        }
        zfbssbs=zfbbs-zfbtfbs;

        if(zjbs==null){
            zjbs=0;
        }
        if(ztfbs==null){
            ztfbs=0;
        }
        zjssbs=zjbs-ztfbs;

        if(wxzzbs==null){
            wxzzbs=0;
        }
        if(wxzztfbs==null){
            wxzztfbs=0;
        }
        wxzzssbs=wxzzbs-wxzztfbs;

        if(zfbzzbs==null){
            zfbzzbs=0;
        }
        if(zfbzztfbs==null){
            zfbzztfbs=0;
        }
        zfbzzssbs=zfbzzbs-zfbzztfbs;


        if(zfss==null){
            zfss=BigDecimal.ZERO;
        }
        if(zjss==null){
            zjss=BigDecimal.ZERO;
        }
        this.zj=zjss.setScale(2, BigDecimal.ROUND_HALF_UP);
        zjdx=NumberToCN.number2CNMontrayUnit(zj);
        zfdx=NumberToCN.number2CNMontrayUnit(zfss.setScale(2, BigDecimal.ROUND_HALF_UP));
        if(zfsk==null){
            zfsk=BigDecimal.ZERO;
        }
        if(zftf==null){
            zftf=BigDecimal.ZERO;
        }

        if(xjss==null){
            xjss=BigDecimal.ZERO;
        }
        if(yhkss==null){
            yhkss=BigDecimal.ZERO;
        }
        if(zfbss==null){
            zfbss=BigDecimal.ZERO;
        }
        if(wxss==null){
            wxss=BigDecimal.ZERO;
        }
        if(sybkss==null){
            sybkss=BigDecimal.ZERO;
        }
        if(ybjzss==null){
            ybjzss=BigDecimal.ZERO;
        }
        if(zfbzzss==null){
            zfbzzss=BigDecimal.ZERO;
        }
        if(wxzzss==null){
            wxzzss=BigDecimal.ZERO;
        }
        if(ybjzss==null){
            ybjzss=BigDecimal.ZERO;
        }
        sjhj=xjss.add(yhkss).add(zfbss).add(wxss).add(sybkss).add(zfbzzss).add(wxzzss).setScale(2, BigDecimal.ROUND_HALF_UP);
        sjhjdx=NumberToCN.number2CNMontrayUnit(sjhj);
        ybkjzhjdx=NumberToCN.number2CNMontrayUnit(ybjzss);
    }
}
