package com.brilliance.isc.bo;

import java.util.*;
import java.math.BigDecimal;


import com.brilliance.mda.runtime.mda.*;
import static com.brilliance.mda.runtime.mda.Constants.*;
import com.brilliance.mda.runtime.mda.util.*;
import com.brilliance.isc.common.json.BigDecimalSerialize;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;



/**
 * TABLE:ecb:国内外汇货款－变动信息
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Ecb extends AbstractCommonVo {

    //Internal Unique ID
    private String inr = NULLSTR;

    //Version
    private String ver = NULLSTR;

    //操作类型
    private String actiontype = NULLSTR;

    //删除原因
    private String actiondesc = NULLSTR;

    //国内外汇贷款编号
    private String dofoexlocode = NULLSTR;

    //银行业务编号
    private String buscode = NULLSTR;

    //变动编号
    private String changeno = NULLSTR;

    //期初余额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal loanopenbalan  = Decimals.ZERO_SCALE2;

    //变动日期
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date changedate = NULLDATE;

    //提款币种
    private String withcurrence = NULLSTR;

    //提款金额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal withamount  = Decimals.ZERO_SCALE2;

    //结汇金额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal settamount  = Decimals.ZERO_SCALE2;

    //资金用途
    private String useofunds = NULLSTR;

    //还本币种
    private String princurr = NULLSTR;

    //还本金额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal repayamount  = Decimals.ZERO_SCALE2;

    //购汇还本金额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal prepayamount  = Decimals.ZERO_SCALE2;

    //付息币种
    private String inpaycurr = NULLSTR;

    //付息金额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal inpayamount  = Decimals.ZERO_SCALE2;

    //购汇付息金额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal pinpayamount  = Decimals.ZERO_SCALE2;

    //期末余额
    @JsonSerialize(using = BigDecimalSerialize.class)
    private  BigDecimal endbalan  = Decimals.ZERO_SCALE2;

    //备注
    private String remark = NULLSTR;

    //接口状态
    private String sta = NULLSTR;

    //INR of EBL
    private String eblinr = NULLSTR;

    //借据号
    private String fincod = NULLSTR;

    //Object Type
    private String objtyp = NULLSTR;

    //Object INR
    private String objinr = NULLSTR;

    //创建日期
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date credat = NULLDATE;

    //acp 确认标识
    private String acp = NULLSTR;

    @Override
    public void reset() {
        if(loanopenbalan == null) {
            loanopenbalan = Decimals.ZERO_SCALE2;
        }

        if(withamount == null) {
            withamount = Decimals.ZERO_SCALE2;
        }

        if(settamount == null) {
            settamount = Decimals.ZERO_SCALE2;
        }

        if(repayamount == null) {
            repayamount = Decimals.ZERO_SCALE2;
        }

        if(prepayamount == null) {
            prepayamount = Decimals.ZERO_SCALE2;
        }

        if(inpayamount == null) {
            inpayamount = Decimals.ZERO_SCALE2;
        }

        if(pinpayamount == null) {
            pinpayamount = Decimals.ZERO_SCALE2;
        }

        if(endbalan == null) {
            endbalan = Decimals.ZERO_SCALE2;
        }

    }

}

