package com.brilliance.isc.bo.model;

import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.bo.Cpd;
import com.brilliance.isc.bo.Cpt;
import com.brilliance.isc.common.json.IStreamDeserializer;
import com.brilliance.isc.common.trnmod.bo.SwiaddBo;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.Data;

import java.math.BigDecimal;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Cpdgrp extends AbstractCommonVo {

    private Cpd rec;

    private Cpt blk;

    private Cpacbs cbs;

    private PtsptaVo orc;

    private PtsptaVo ori;

    private PtsptaVo pyb;

    private PtsptaVo pye;

    private PtsptaVo med;

    private PtsptaVo rmt;

    private PtsptaVo snd;

    private PtsptaVo res;

    private String pyebchkey;

    private String pyebchnam;

    // 发票内容（来报存入）
    @JsonDeserialize(using = IStreamDeserializer.class)
    private IStream invdetail = new StreamImpl();
    // 发票张数（来报存入）
    private String invsize;
    // 是否跳过核验（来报存入）
    private String isskip;

    // 标识当前交易的来报报文类型
    private String msgtyp;
    // 购汇金额
    private BigDecimal lcyamt  = Decimals.ZERO_SCALE3;
    //人民币帐号/银行卡号
    private String lcyacc;
    //现汇金额
    private  BigDecimal fcyamt  = Decimals.ZERO_SCALE3;
    //外汇帐号/银行卡号
    private String fcyacc;
    // T22来报中的54-acc
    private String acc54;
    // T22来报中的54-bic
    private String bic54;
    // T22来报中的54-adr
    private String adr54;

    private SwiaddBo swiadd;

    @Override
    public void reset() {
        if (rec == null) {
            rec = new Cpd();
        }
        if (blk == null) {
            blk = new Cpt();
        }
        if (cbs == null) {
            cbs = new Cpacbs();
        }
        cbs.reset();
        if (orc == null) {
            orc = new PtsptaVo();
        }
        orc.reset();
        if (ori == null) {
            ori = new PtsptaVo();
        }
        ori.reset();
        if (pyb == null) {
            pyb = new PtsptaVo();
        }
        pyb.reset();
        if (pye == null) {
            pye = new PtsptaVo();
        }
        pye.reset();
        if (med == null) {
            med = new PtsptaVo();
        }
        med.reset();
        if (rmt == null) {
            rmt = new PtsptaVo();
        }
        rmt.reset();
        if (snd == null) {
            snd = new PtsptaVo();
        }
        snd.reset();
        if (res == null) {
            res = new PtsptaVo();
        }
        res.reset();
    }
}
