package com.brilliance.isc.common.trnmod.vo;

import com.brilliance.isc.bo.*;
import com.brilliance.isc.common.ordmod.vo.OrdmodVo;
import com.brilliance.isc.common.trnism.vo.TrnismVo;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.vo.model.Ersmod;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import io.swagger.annotations.ApiModel;
import lombok.Data;

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

import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;

@Data
@ApiModel(value = "Trnmod请求信息", description = "Trnmod请求信息")
public class TrnmodVo extends AbstractCommonVo implements Serializable {

    //\BRTP\PRECHKDAT
    //\BCTP\PRECHKDAT
    //\GCTP\PRECHKDAT
    private Date prechkdat;

    //GITODZ交易下的\ERSGIT\ERS\STATXT
    private String statxt;

    //\BPTFFT\ALLINT
    private String allint;

    //\BPTFFT\FFTCCE
    private String fftcce;

    //DITOPN 取\DITP\ELCSCA
    //BFTOPN 取\BFTP\ELCSCA
    private Elcsca elcsca;

    //SYSMOD.SPT
    private Spt spt;

    private OrdmodVo ordmod;

    private BolmodVo bolmodVo;

    private TrnismVo trnism;

    private TrnbimVo trnbim;

    private SwiaddVo swiadd;

    private Trn trn;

    private Smh smh;

    private Spt sptaut;

    private Cbe wrkcbe;

    private Dia diapic;

    //before image stream
    private IStream bimdata = new StreamImpl();

    //stream of reserved contracts
    private IStream trorescon = new StreamImpl();

    private IStream doctxt = new StreamImpl();

    //GLE number of records
    private int glenmb;

    //CMT100 报文
    private String cmtflg = NULLSTR;

    //二代模式
    private String secmod;

    //
    private Ersmod ersmod;

    @Override
    public void reset() {
        if (spt == null) {
            spt = new Spt();
        }
        if (ordmod == null) {
            ordmod = new OrdmodVo();
        }
        ordmod.reset();
        if (bolmodVo == null) {
            bolmodVo = new BolmodVo();
        }
        bolmodVo.reset();
        if (trnism == null) {
            trnism = new TrnismVo();
        }
        trnism.reset();
        if (trnbim == null) {
            trnbim = new TrnbimVo();
        }
        trnbim.reset();
        if (swiadd == null) {
            swiadd = new SwiaddVo();
        }
        swiadd.reset();
        if (trn == null) {
            trn = new Trn();
        }
        if (smh == null) {
            smh = new Smh();
        }
        if (sptaut == null) {
            sptaut = new Spt();
        }
        if (ersmod == null) {
            ersmod = new Ersmod();
        }
        ersmod.reset();
    }
}