package com.brilliance.isc.bo.model;

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.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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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 Boprem <T1 extends BizInfoVo, T2 extends BizAmdInfoVo> extends AbstractCommonVo {
    private static Logger log = LoggerFactory.getLogger(Bopgat.class);

    @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 String typ;

    //地区机构号
    private String ownextkey;

    //申报大类型
    private String boptyp = NULLSTR;

    //申报子类型
    private String bopobjtyp = NULLSTR;

    //收付汇日期
    private Date paydat = NULLDATE;

    //款项去向
    private String acttyp;

    //Customer Type
    private String custyp;

    //基础数据
    private String basflg;

    //申报类型
    private String szflg;

    //申报数据
    private String dclflg;

    //资本项目数字化
    private String zbxmszh;
    //核销数据
    private String vrfflg;

    //申报号码检核标志
    private String sztyp;
    //交易编码
    private String boptxcode;

    // 涉外汇款申请单
    private Dbbgrp dbbgrp;
    // 境内汇款申请单
    private Dbegrp dbegrp;
    // 收支申报控制
    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(dbbgrp == null){
            dbbgrp = new Dbbgrp();
            dbbgrp.reset();
        }
        if(dbegrp == null){
            dbegrp = new Dbegrp();
            dbegrp.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());
    }
}
