package com.brilliance.isc.bo.model;

import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.common.setfeg.vo.SetfelVo;
import com.brilliance.isc.common.setfog.vo.SetfolVo;
import com.brilliance.isc.common.setgll.vo.SetgllVo;
import com.brilliance.isc.common.setmod.vo.PtsFeeDetailVo;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

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

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Boppay <T1 extends BizInfoVo, T2 extends BizAmdInfoVo> extends AbstractCommonVo {
    @ApiModelProperty(value = "当前交易码", name = "transName", required = true)
    private String transName = NULLSTR;

    @ApiModelProperty(value = "当前经办人员ID", name = "userId", required = true)
    private String userId = NULLSTR;

    @ApiModelProperty(value = "业务摘要信息", name = "rec", required = true)
    private T1 rec;

    @ApiModelProperty(value = "业务摘要修改信息", name = "rec", required = true)
    private T2 amdRec;

    @ApiModelProperty(value = "CBB列表", name = "cbsMap", required = true)
    private Map<String, Cbb> cbsMap;

    @ApiModelProperty(value = "交易角色参与方列表", name = "ptsList", required = true)
    private List<PtsptaVo> ptsList;

    @ApiModelProperty(value = "我行收费信息列表", name = "setfel", required = true)
    private List<SetfelVo> setFelList;

    @ApiModelProperty(value = "他行收费信息列表", name = "setfol", required = true)
    private List<SetfolVo> setFolList;

    @ApiModelProperty(value = "结算分录列表", name = "setgll", required = true)
    private List<SetgllVo> setgll;

    //费用角色详情集合
    private List<PtsFeeDetailVo> ptydet;

    //申报类型
    private String szflg = NULLSTR;
    //基础数据
    private String basflg = NULLSTR;
    //申报数据
    private String dclflg = NULLSTR;
    //管理数据
    private String vrfflg = NULLSTR;
    //款项来源
    private String acttyp = NULLSTR;
    //地区机构号
    private String ownextkey = NULLSTR;
    //资本项目数字化
    private String zbxmszh = NULLSTR;
    //交易编码
    private String boptxcode = NULLSTR;
    //国外银行扣费币种
    private String outchargeccy = NULLSTR;
    //国外银行扣费金额
    private BigDecimal outchargeamt = Decimals.ZERO_SCALE0;
    //收支申报格式控制标记
    private String typ = NULLSTR;
    //特殊经济区域企业
    private String custyp = NULLSTR;
    //new datafield
    private String for1 = NULLSTR;
    //申报号码检核标志
    private String sztyp = NULLSTR;
    //申报大类型
    private String boptyp = NULLSTR;
    //申报子类型
    private String bopobjtyp = NULLSTR;
    //收付汇日期
    private Date paydat = NULLDATE;
    // 涉外承兑通知书
    private Dbcgrp dbcgrp;
    // 境内承兑通知书
    private Dbfgrp dbfgrp;
    // 收支申报控制
    private Ctlmod ctlmod;
    // 校验字段
    private CheckItems checkItems;
    // 附言字段集合
    private CommetItems commetItems;

    //是否随业务申报  1-随业务申报  2-不随业务申报 3-客户自行申报
    private String aloneflg;

    //试点行标志  N-非试点  Y-试点
    private String enableflg;

    @Override
    public void reset() {
        if (rec == null) {
            rec = (T1) new BizInfoVo();
        }
        rec.reset();
        if (amdRec == null) {
            amdRec = (T2) new BizAmdInfoVo();
        }
        amdRec.reset();
        if (cbsMap == null) {
            cbsMap = new HashMap<>();
        }
        if (ptsList == null) {
            ptsList = new ArrayList<>();
        }
        ptsList.forEach(p -> p.reset());

        if(dbcgrp == null){
            dbcgrp = new Dbcgrp();
            dbcgrp.reset();
        }
        if(dbfgrp == null){
            dbfgrp = new Dbfgrp();
            dbfgrp.reset();
        }
        if(ctlmod == null){
            ctlmod = new Ctlmod();
            ctlmod.reset();
        }
        if(setFelList == null){
            setFelList = new ArrayList<>();
        }
        setFelList.forEach(p-> p.reset());
        if(setFolList == null){
            setFolList = new ArrayList<>();
        }
        setFolList.forEach(p-> p.reset());
        if(setgll == null){
            setgll = new ArrayList<>();
        }
        setgll.forEach(p-> p.reset());
        if(ptydet == null){
            ptydet = new ArrayList<>();
        }
        ptydet.forEach(p-> p.reset());
        if(checkItems == null){
            checkItems = new CheckItems();
        }
    }
}
