package com.brilliance.isc.common.transaction.newcheck.bopdec;

import com.brilliance.isc.bo.bopdecbo.Dba;
import com.brilliance.isc.bo.bopdecbo.Dbd;
import com.brilliance.isc.bo.model.CheckItems;
import com.brilliance.isc.common.transaction.newcheck.AbstractModuleValidator;
import com.brilliance.isc.common.transaction.newcheck.ValidResult;
import com.brilliance.isc.common.transaction.newcheck.Validate;
import com.brilliance.isc.config.CustomConfig;
import com.brilliance.isc.mda.dao.*;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.Map;

@Component
public class BopgatValidator extends AbstractModuleValidator<CheckItems> {

    @Autowired
    private DbaMapper dbaMapper;

    @Autowired
    private DbbMapper dbbMapper;

    @Autowired
    private DbcMapper dbcMapper;

    @Autowired
    private DbdMapper dbdMapper;

    @Autowired
    private BopcodMapper bopcodMapper;

    @Autowired
    private DbuMapper dbuMapper;

    @Autowired
    private CustomConfig customConfig;

    @Autowired
    private DblMapper dblMapper;

    @Autowired
    private BopdecCommon bopdecCommon;

    @Autowired
    private BopdecCommonValidator bopdecCommonValidator;

    @Override
    @PostConstruct
    public void register() {
        super.register();
    }

    @Override
    public Map<String, String> validate(CheckItems checkItems) {
        return super.validate(checkItems);
    }

    @Validate(path = "bopgat.dbagrp.bas.buscode")
    public ValidResult checkDbaBuscodeN1000(CheckItems checkItems) {
        String szflg = checkItems.getSzflg();
        String buscode = checkItems.getBuscode();
        String dectyp = checkItems.getDectyp();
        if("1".equals(szflg)) {
            if (MdaUtils.isEmpty(buscode)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
            if (!"V".equals(dectyp)) {
                if (MdaUtils.isEmpty(buscode)) {
                    return ValidResult.build(false, "此字段为必输项！");
                } else {
                    if ("A".equals(dectyp)) {
                        Dba dba = dbaMapper.selectByBuscode(buscode);
                        if(!MdaUtils.isEmpty(dba)){
                            return ValidResult.build(false, "系统已存在该业务编号，请重新指定！");
                        }
                    }
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.buscode")
    public ValidResult checkDbdBuscodeN1000(CheckItems checkItems) {
        String szflg = checkItems.getSzflg();
        String buscode = checkItems.getBuscode();
        String dectyp = checkItems.getDectyp();
        if("2".equals(szflg)){
            if (MdaUtils.isEmpty(buscode)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
            if (!"V".equals(dectyp)) {
                if (MdaUtils.isEmpty(buscode)) {
                    return ValidResult.build(false, "此字段为必输项！");
                } else {
                    if ("A".equals(buscode)) {
                        Dbd dbd = dbdMapper.selectByBuscode(buscode);
                        if(!MdaUtils.isEmpty(dbd)){
                            return ValidResult.build(false, "系统已存在该业务编号，请重新指定！");
                        }
                    }
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.acttyp")
    public ValidResult checkActtypN1000(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String acttyp = checkItems.getActtyp();
        if("1".equals(szflg)){
            if (MdaUtils.isEmpty(acttyp)){
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.actiontype")
    public ValidResult checkDbaBasActiontypeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String actiontype = checkItems.getBasactiontype();
        if("1".equals(szflg)){
            if (MdaUtils.isEmpty(actiontype)){
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.actiontype")
    public ValidResult checkDbaDclActiontypeN1000(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            String actiontype = checkItems.getDclactiontype();
            if (MdaUtils.isEmpty(actiontype)){
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.actiontype")
    public ValidResult checkDbdBasActiontypeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String actiontype = checkItems.getBasactiontype();
        if("2".equals(szflg)){
            if (MdaUtils.isEmpty(actiontype)){
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.actiontype")
    public ValidResult checkDbdVrfActiontypeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String actiontype = checkItems.getVrfactiontype();
            if (MdaUtils.isEmpty(actiontype)){
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.custcod")
    public ValidResult checkDbaCustcodN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkCustcod(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.custcod")
    public ValidResult checkDbdCustcodN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkCustcod(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.exrate")
    public ValidResult checkDbaExrateN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkExrate(checkItems);
        }
        return null;
    }
    @Validate(path = "bopgat.dbdgrp.bas.exrate")
    public ValidResult checkDbdExrateN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkExrate(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.fcyacc")
    public ValidResult checkDbaFcyaccN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkFcyacc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.fcyacc")
    public ValidResult checkDbdFcyaccN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkFcyacc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.fcyamt")
    public ValidResult checkDbaFcyamtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkFcyamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.fcyamt")
    public ValidResult checkDbdFcyamtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkFcyamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.idcode")
    public ValidResult checkDbaIdcodeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkIdcode(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.idcode")
    public ValidResult checkDbdIdcodeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkIdcode(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.lcyacc")
    public ValidResult checkDbaLcyaccN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkLcyacc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.lcyacc")
    public ValidResult checkDbdLcyaccN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkLcyacc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.lcyamt")
    public ValidResult checkDbaLcyamtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkLcyamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.lcyamt")
    public ValidResult checkDbdLcyamtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkLcyamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.oppuser")
    public ValidResult checkDbaOppuserN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkOppuser(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.oppuser")
    public ValidResult checkDbdOppuserN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkOppuser(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.othacc")
    public ValidResult checkDbaOthaccN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkOthacc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.othacc")
    public ValidResult checkDbdOthaccN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkOthacc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.othamt")
    public ValidResult checkDbaOthamtN900(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkOthamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.othamt")
    public ValidResult checkDbdOthamtN900(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkOthamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.txamt")
    public ValidResult checkDbaTxamtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkTxamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.txamt")
    public ValidResult checkDbdTxamtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkTxamt(checkItems);
        }
        return null;
    }

    /**
     *   source:baspp.@0052.script
     */

    @Validate(path = "bopgat.dbagrp.bas.ownextkey")
    public ValidResult checkDbaOwnextkeyN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            String ownextkey = checkItems.getOwnextkey();
            if (MdaUtils.isEmpty(ownextkey)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.ownextkey")
    public ValidResult checkDbdOwnextkeyN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            String ownextkey = checkItems.getOwnextkey();
            if (MdaUtils.isEmpty(ownextkey)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }


    @Validate(path = "bopgat.dbagrp.bas.actiondesc")
    public ValidResult checkDbaBasActiondescN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkBasActiondesc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.actiondesc")
    public ValidResult checkDbaDclActiondescN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkDclActiondesc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.actiondesc")
    public ValidResult checkDbdBasActiondescN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkBasActiondesc(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.actiondesc")
    public ValidResult checkDbdVrfActiondescN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            return bopdecCommonValidator.checkVrfActiondesc(checkItems);
        }
        return null;
    }


    @Validate(path = "bopgat.dbagrp.bas.method")
    public ValidResult checkDbaMethodsN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            String method = checkItems.getMethod();
            if (MdaUtils.isEmpty(method)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.method")
    public ValidResult checkDbdMethodsN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            String method = checkItems.getMethod();
            if (MdaUtils.isEmpty(method)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    /**
     *   source:baspp.@0065.script
     */

    @Validate(path = "bopgat.dbagrp.bas.custnm")
    public ValidResult checkDbaCustnmN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkCustnm(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.custnm")
    public ValidResult checkDbdCustnmN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkCustnm(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.custype")
    public ValidResult checkDbaCustypeN80(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            bopdecCommonValidator.checkCustype(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.custype")
    public ValidResult checkDbdCustypeN80(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            bopdecCommonValidator.checkCustype(checkItems);
        }
        return null;
    }



    /**
     *   source:dclpp.@0002.script
     */

    @Validate(path = "bopgat.dbagrp.dcl.country")
    public ValidResult checkCountryN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            String country = checkItems.getCountry();
            String txcode = checkItems.getTxcode();
            String txcode2 = checkItems.getTxcode2();
            if (MdaUtils.isEmpty(country)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
            if (!MdaUtils.isEmpty(country) &&  "CHN".equals(country) && (!bopdecCommon.indexGt(txcode,"-999998-") && !bopdecCommon.indexGt(txcode2,"-999998-"))) {
                return ValidResult.build(false, "不能选择CHN(中国)! ");
            }
            //交易对方国别或地区为“ZZZ”
            if(!MdaUtils.isEmpty(country) && "ZZZ".equals(country)) {
                return ValidResult.build(false, "第4.2.5.1项检核:交易对方国别或地区为“ZZZ”");
            }
            return bopdecCommonValidator.checkCommonCountry(checkItems);
        }
        return null;
    }

    /**
     *   source:dclpp.@0003.script
     */

    @Validate(path = "bopgat.dbagrp.dcl.crtuser")
    public ValidResult checkDbaCrtuserN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        String crtuser = checkItems.getDclcrtuser();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkCrtuser(crtuser);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.crtuser")
    public ValidResult checkDbdCrtuserN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        String crtuser = checkItems.getVrfcrtuser();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            return bopdecCommonValidator.checkCrtuser(crtuser);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.inptelc")
    public ValidResult checkDbaInptelcN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            String inptelc = checkItems.getDclinptelc();
            if (MdaUtils.isEmpty(inptelc)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.inptelc")
    public ValidResult checkDbdInptelcN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String inptelc = checkItems.getVrfinptelc();
            if (MdaUtils.isEmpty(inptelc)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    /**
     *   source:dclpp.@0005.script
     */

    @Validate(path = "bopgat.dbagrp.dcl.isref")
    public ValidResult checkIsrefN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            String isref = checkItems.getDclisref();
            if (MdaUtils.isEmpty(isref)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    /**
     *   source:dclpp.@0006.script
     */

    @Validate(path = "bopgat.dbagrp.dcl.paytype")
    public ValidResult checkPaytypeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkPaytype(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.rptdate")
    public ValidResult checkDbaRptdateN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkDclRptdate0007(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.rptdate")
    public ValidResult checkDbdRptdateN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            return bopdecCommonValidator.checkVrfRptdate0013(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.tc1amt")
    public ValidResult checkTc1amtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkTc1amt(checkItems);
        }
        return null;
    }

    /**
     *   source:dclpp.@0010.script
     */

    @Validate(path = "bopgat.dbagrp.dcl.tc2amt")
    public ValidResult checkTc2amtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            String txcode2 = checkItems.getTxcode2();
            String tx2rem = checkItems.getTx2rem();
            BigDecimal tc2amt = checkItems.getTc2amt();
            if(MdaUtils.isEmpty(tc2amt)){
                tc2amt = BigDecimal.ZERO;
            }
            if ((!MdaUtils.isEmpty(txcode2) || !MdaUtils.isEmpty(tx2rem)) && !bopdecCommon.indexGt(txcode2, "-999998-")) {
                if(MdaUtils.isEmpty(tc2amt) || MdaUtils.isBigDecimalEmpty(tc2amt)) {
                    return ValidResult.build(false, "此字段为必输项！");
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.tx2rem")
    public ValidResult checkTx2remN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkTx2rem(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.txcode")
    public ValidResult checkTxcodeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkTxcode(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.txcode2")
    public ValidResult checkTxcode2N100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkTxcode2(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.txrem")
    public ValidResult checkTxremN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            return bopdecCommonValidator.checkTxrem(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.rptno")
    public ValidResult checkDbaBasRptnoN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            String rptno = checkItems.getRptno();
            if (MdaUtils.isEmpty(rptno)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.rptno")
    public ValidResult checkDbaDclRptnoN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            String rptno = checkItems.getRptno();
            if (MdaUtils.isEmpty(rptno)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.rptno")
    public ValidResult checkDbdBasRptnoN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            String rptno = checkItems.getRptno();
            if (MdaUtils.isEmpty(rptno)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.rptno")
    public ValidResult checkDbdVrfRptnoN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String rptno = checkItems.getRptno();
            if (MdaUtils.isEmpty(rptno)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.outchargeccy")
    public ValidResult checkRecgrpBasOutchargeccyN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            BigDecimal outchargeamt = checkItems.getOutchargeamt();
            if(MdaUtils.isEmpty(outchargeamt)){
                outchargeamt = BigDecimal.ZERO;
            }
            String outchargeccy = checkItems.getOutchargeccy();
            if(!MdaUtils.isBigDecimalEmpty(outchargeamt)){
                if(MdaUtils.isEmpty(outchargeccy)) {
                    return ValidResult.build(false, "此字段为必输项！");
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.outchargeamt")
    public ValidResult checkRecgrpBasOutchargeamtN950(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            BigDecimal outchargeamtB = checkItems.getOutchargeamt();
            if(MdaUtils.isEmpty(outchargeamtB)){
                outchargeamtB = BigDecimal.ZERO;
            }
            String outchargeccy = checkItems.getOutchargeccy();
            BigDecimal zero = new BigDecimal(0);
            if (outchargeamtB.compareTo(zero) == 0 && !MdaUtils.isEmpty(outchargeccy)) {
                return ValidResult.build(false, "此金额必须大于零! ");
            }
            if (outchargeamtB.compareTo(zero) < 0) {
                return ValidResult.build(false, "此金额不能小于零!");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.dcl.billno")
    public ValidResult checkRecgrpDclBillnoN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String dclflg = checkItems.getDclflg();
        if("1".equals(szflg) && "X".equals(dclflg)){
            //境内付款/承兑通知书-管理信息REGNO，无此编号时，N/A不强制，
            //外汇局批件号/备案表号/业务编号信息不填或必填（20位）或填写为N/A
            String billno = checkItems.getBillno();
            String txcode = checkItems.getTxcode();
            String txcode2 = checkItems.getTxcode2();
            if (!MdaUtils.isEmpty(billno)) {
                String str = billno;
                byte[] buff = null;
                try {
                    buff = str.getBytes("GB18030");
                }catch(Exception e) {
                    return ValidResult.build(false, "getBytes fail...");
                }
                int len = buff.length;
                if(len > 50) {
                    return ValidResult.build(false, "该字段只能输入50个字符！");
                }
//                if (!"N/A".equals(billno)) {
//                    if (!(billno.length() == 20)) {
//                        return ValidResult.build(false, "提示:外汇局批件号/备案表号/业务编号信息不填或必填（20位）或填写为N/A");
//                    }
//                }
            }
            boolean required = false;
            if(!MdaUtils.isEmpty(txcode) && bopdecCommon.isZb(txcode)) {
                required = true;
            }
            if(!MdaUtils.isEmpty(txcode2) && bopdecCommon.isZb(txcode2)) {
                required = true;
            }
            if(!required) {
                return null;
            }
            if(!MdaUtils.isEmpty(billno)) {
                if("n/a".equals(billno) || "N/a".equals(billno) || "n/A".equals(billno)) {
                    return ValidResult.build(false, "请填写填写N/A或正确的外汇局批件号/备案表号/业务编号`");
                }
            } else {
                return ValidResult.build(false, "资本项目项下交易此字段必填，没有请填写N/A");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.inchargeamt")
    public ValidResult checkDbaBasInchargeamtN950(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            return bopdecCommonValidator.checkInchargeamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.inchargeamt")
    public ValidResult checkDbdBasInchargeamtN950(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            return bopdecCommonValidator.checkInchargeamt(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbagrp.bas.inchargeccy")
    public ValidResult checkDbaBasInchargeccyN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("1".equals(szflg)){
            BigDecimal inchargeamt = checkItems.getInchargeamt();
            String inchargeccy = checkItems.getInchargeccy();
            if(MdaUtils.isEmpty(inchargeamt)){
                inchargeamt = BigDecimal.ZERO;
            }
            BigDecimal zero = BigDecimal.ZERO;
            if (inchargeamt.compareTo(zero) != 0) {
                if(MdaUtils.isEmpty(inchargeccy)) {
                    return ValidResult.build(false, "此字段为必输项！");
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.inchargeccy")
    public ValidResult checkDbdBasInchargeccyN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        if("2".equals(szflg)){
            BigDecimal inchargeamt = checkItems.getInchargeamt();
            String inchargeccy = checkItems.getInchargeccy();
            if(MdaUtils.isEmpty(inchargeamt)){
                inchargeamt = BigDecimal.ZERO;
            }
            BigDecimal zero = BigDecimal.ZERO;
            if (inchargeamt.compareTo(zero) != 0) {
                if(MdaUtils.isEmpty(inchargeccy)) {
                    return ValidResult.build(false, "此字段为必输项！");
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.bas.txccy")
    public ValidResult checkRecgrpBasTxccyN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String txccy = checkItems.getTxccy();
        if("2".equals(szflg)){
            if (MdaUtils.isEmpty(txccy)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.isref")
    public ValidResult checkRecgrpVrfIsrefN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        String isref = checkItems.getVrfisref();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            if (MdaUtils.isEmpty(isref)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.payattr")
    public ValidResult checkRecgrpVrfPayattrN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        String payattr = checkItems.getPayattr();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            if (MdaUtils.isEmpty(payattr)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.paytype")
    public ValidResult checkRecgrpVrfPaytypeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String paytype = checkItems.getPaytype();
            if (MdaUtils.isEmpty(paytype)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.regno")
    public ValidResult checkRecgrpVrfRegnoN950(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            return bopdecCommonValidator.checkRegno(checkItems);
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.tc1amt")
    public ValidResult checkRecgrpVrfTc1amtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            BigDecimal tc1amt = checkItems.getTc1amt();
            if(MdaUtils.isEmpty(tc1amt)){
                tc1amt = BigDecimal.ZERO;
            }
            BigDecimal tc2amt = checkItems.getTc2amt();
            if(MdaUtils.isEmpty(tc2amt)){
                tc2amt = BigDecimal.ZERO;
            }
            BigDecimal basamt = checkItems.getTxamt();
            if (MdaUtils.isBigDecimalEmpty(tc1amt) || MdaUtils.isEmpty(tc1amt)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
            if (tc1amt.compareTo(tc2amt) < 0) {
                return bopdecCommon.checkErrorText("M");
            }
            BigDecimal dclamt = tc1amt.add(tc2amt);
            if (basamt.compareTo(dclamt) != 0) {
                return bopdecCommon.checkErrorText("D");
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.tc2amt")
    public ValidResult checkRecgrpVrfTc2amtN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String txcode2 = checkItems.getTxcode2();
            String tx2rem = checkItems.getTx2rem();
            BigDecimal tc2amt = checkItems.getTc2amt();
            if(MdaUtils.isEmpty(tc2amt)){
                tc2amt = BigDecimal.ZERO;
            }
            if ( !MdaUtils.isEmpty(txcode2)|| !MdaUtils.isEmpty(tx2rem) ){
                if(MdaUtils.isEmpty(tc2amt) || MdaUtils.isBigDecimalEmpty(tc2amt)) {
                    return ValidResult.build(false, "此字段为必输项！");
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.tx2rem")
    public ValidResult checkRecgrpVrfTx2remN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        String zbxmszh = checkItems.getZbxmszh();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String txcode2 = checkItems.getTxcode2();
            String tx2rem = checkItems.getTx2rem();
            String txrem = checkItems.getTxrem();
            if (!MdaUtils.isEmpty(txcode2) || !MdaUtils.isEmpty(tx2rem)) {
                if(MdaUtils.isEmpty(tx2rem)) {
                    return ValidResult.build(false, "此字段为必输项！");
                }
            }
            if (!MdaUtils.isEmpty(tx2rem) && tx2rem.equals(txrem)) {
                return ValidResult.build(false, "交易附言2不能与交易附言1相同!");
            }
            //校验字节数50-》256
            if (!MdaUtils.isEmpty(tx2rem)) {
                String str = tx2rem;
                byte[] buff = null;
                try {
                    buff = str.getBytes("GB18030");
                } catch (Exception e) {
                    return ValidResult.build(false, "getBytes fail...");
                }
                int len = buff.length;
                if (len > 256) {
                    return ValidResult.build(false, "该字段只能输入256个字符！");
                }
            }
            if("Y".equals( zbxmszh )) {
                if (!MdaUtils.isEmpty(txcode2)) {
                    if (bopdecCommon.isZbxm(txcode2, "I")) {
                        if (!tx2rem.contains("CADS")) {
                            return ValidResult.build(false, "无资本项目数字化标识，请添加CADS前缀");
                        }
                    }
                }
            }else {
                if (tx2rem.contains("CADS")) {
                    return ValidResult.build(false, "非资本项目数字化请删除CADS字样");
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.txcode")
    public ValidResult checkRecgrpVrfTxcodeN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String txcode = checkItems.getTxcode();
            String custype = checkItems.getCustype();
            String lcyacc = checkItems.getLcyacc();
            String fcyacc = checkItems.getFcyacc();
            String othacc = checkItems.getOthacc();
            if (MdaUtils.isEmpty(txcode)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
//            if (!MdaUtils.isEmpty(txcode)) {
//                String str = txcode;
//                if (bopdecCommon.indexGt(custype, "-C-") && (bopdecCommon.startsWithValueUpper(lcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(fcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(othacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-"))) {
//                    if (!"929090".equals(str)) {
//                        return ValidResult.build(false, "交易编码1:请确认是否为非居民机构账户间境内划转资金，如“是”则“交易编码1”栏位填写交易编码“929090”。");
//                    }
//                }
//            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.txcode2")
    public ValidResult checkRecgrpVrfTxcode2N100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            BigDecimal tc2amt = checkItems.getTc2amt();
            if(MdaUtils.isEmpty(tc2amt)){
                tc2amt = BigDecimal.ZERO;
            }
            String tx2rem = checkItems.getTx2rem();
            String txcode = checkItems.getTxcode();
            String txcode2 = checkItems.getTxcode2();
            if (!MdaUtils.isBigDecimalEmpty(tc2amt) || !MdaUtils.isEmpty(tx2rem)) {
                if(MdaUtils.isEmpty(txcode2)) {
                    return ValidResult.build(false, "此字段为必输项！");
                }
            }
            if (!MdaUtils.isEmpty(txcode)) {
                if (txcode.equals(txcode2) && !MdaUtils.isEmpty(txcode2)) {
                    return bopdecCommon.checkErrorText("C");
                }
            }
        }
        return null;
    }

    @Validate(path = "bopgat.dbdgrp.vrf.txrem")
    public ValidResult checkRecgrpVrfTxremN100(CheckItems checkItems){
        String szflg = checkItems.getSzflg();
        String vrfflg = checkItems.getVrfflg();
        if("2".equals(szflg) && "X".equals(vrfflg)){
            String txrem = checkItems.getTxrem();
            String custype = checkItems.getCustype();
            String lcyacc = checkItems.getLcyacc();
            String fcyacc = checkItems.getFcyacc();
            String othacc = checkItems.getOthacc();
            String zbxmszh = checkItems.getZbxmszh();
            String txcode = checkItems.getTxcode();
            if (MdaUtils.isEmpty(txrem)) {
                return ValidResult.build(false, "此字段为必输项！");
            }
            //校验字节数50-》256
            if (!MdaUtils.isEmpty(txrem)) {
                String str = txrem;
                byte[] buff = null;
                try {
                    buff = str.getBytes("GB18030");
                } catch (Exception e) {
                    return ValidResult.build(false, "getBytes fail...");
                }
                int len = buff.length;
                if (len > 256) {
                    return ValidResult.build(false, "该字段只能输入256个字符！");
                }
//                if (bopdecCommon.indexGt(custype, "-C-") && (bopdecCommon.startsWithValueUpper(lcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(fcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(othacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-"))) {
//                    if (!"非居民机构账户间划转".equals(str)) {
//                        return ValidResult.build(false, "交易附言1:请确认是否为非居民机构账户间境内划转资金，如“是”则“交易附言1”栏位填写“非居民机构账户间划转”。");
//                    }
//                }
            }
            if("Y".equals( zbxmszh )) {
                if (!MdaUtils.isEmpty(txcode)) {
                    if (bopdecCommon.isZbxm(txcode, "I")) {
                        if (!txrem.contains("CADS")) {
                            return ValidResult.build(false, "无资本项目数字化标识，请添加CADS前缀");
                        }
                    }
                }
            }else {
                if (txrem.contains("CADS")) {
                    return ValidResult.build(false, "非资本项目数字化请删除CADS字样");
                }
            }
        }
        return null;
    }

    //剥离 检核中的 message 改为 warning 提醒
    // bassp 公共检核
//    @Warning(path = "bopgat.dbagrp.bas.custcod")
//    public WarningResult warncheckDbaCustcodN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBABASCUSTCOD";
//        if("1".equals(szflg)){
//            return bopdecCommonValidator.warncheckCustcod(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.bas.custcod")
//    public WarningResult warncheckDbdCustcodN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBDBASCUSTCOD";
//        if("2".equals(szflg)){
//            return bopdecCommonValidator.warncheckCustcod(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.bas.custype")
//    public WarningResult warncheckDbaCustypeN80(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBABASCUSTYPE";
//        if("1".equals(szflg)){
//            bopdecCommonValidator.warncheckCustype(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.bas.custype")
//    public WarningResult warncheckDbdCustypeN80(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBDBASCUSTYPE";
//        if("2".equals(szflg)){
//            bopdecCommonValidator.warncheckCustype(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.bas.fcyacc")
//    public WarningResult warncheckDbaFcyaccN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBABASFCYACC";
//        if("1".equals(szflg)){
//            return bopdecCommonValidator.warncheckFcyacc(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.bas.fcyacc")
//    public WarningResult warncheckDbdFcyaccN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBDBASFCYACC";
//        if("2".equals(szflg)){
//            return bopdecCommonValidator.warncheckFcyacc(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.bas.idcode")
//    public WarningResult warncheckDbaIdcodeN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBABASIDCODE";
//        if("1".equals(szflg)){
//            return bopdecCommonValidator.warncheckIdcode(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.bas.idcode")
//    public WarningResult warncheckDbdIdcodeN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBDBASIDCODE";
//        if("2".equals(szflg)){
//            return bopdecCommonValidator.warncheckIdcode(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.bas.lcyacc")
//    public WarningResult warncheckDbaLcyaccN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBABASLCYACC";
//        if("1".equals(szflg)){
//            return bopdecCommonValidator.warncheckLcyacc(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.bas.lcyacc")
//    public WarningResult warncheckDbdLcyaccN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBDBASLCYACC";
//        if("2".equals(szflg)){
//            return bopdecCommonValidator.warncheckLcyacc(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.bas.oppuser")
//    public WarningResult warncheckDbaOppuserN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBABASOPPUSER";
//        if("1".equals(szflg)){
//            return bopdecCommonValidator.warncheckOppuser(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.bas.oppuser")
//    public WarningResult warncheckDbdOppuserN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBDBASOPPUSER";
//        if("2".equals(szflg)){
//            return bopdecCommonValidator.warncheckOppuser(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.bas.othacc")
//    public WarningResult warncheckDbaOthaccN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBABASOTHACC";
//        if("1".equals(szflg)){
//            return bopdecCommonValidator.warncheckOthacc(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.bas.othacc")
//    public WarningResult warncheckDbdOthaccN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String subid = "BOPDBDBASOTHACC";
//        if("2".equals(szflg)){
//            return bopdecCommonValidator.warncheckOthacc(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

    //dclpp
//    @Warning(path = "bopgat.dbagrp.dcl.paytype")
//    public WarningResult warncheckPaytypeN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String dclflg = checkItems.getDclflg();
//        String subid = "BOPDBADCLPAYTYPE";
//        if("1".equals(szflg) && "X".equals(dclflg)){
//            return bopdecCommonValidator.warncheckPaytype(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.dcl.tx2rem")
//    public WarningResult warncheckTx2remN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String dclflg = checkItems.getDclflg();
//        String subid = "BOPDBADCLTX2REM";
//        if("1".equals(szflg) && "X".equals(dclflg)){
//            return bopdecCommonValidator.warncheckTx2rem(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.dcl.txcode")
//    public WarningResult warncheckTxcodeN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String dclflg = checkItems.getDclflg();
//        String subid = "BOPDBADCLTXCODE";
//        if("1".equals(szflg) && "X".equals(dclflg)){
//            return bopdecCommonValidator.warncheckTxcode(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.dcl.txcode2")
//    public WarningResult warncheckTxcode2N100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String dclflg = checkItems.getDclflg();
//        String subid = "BOPDBADCLTXCODE2";
//        if("1".equals(szflg) && "X".equals(dclflg)){
//            return bopdecCommonValidator.warncheckTxcode2(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.dcl.txrem")
//    public WarningResult warncheckTxremN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String dclflg = checkItems.getDclflg();
//        String subid = "BOPDBADCLTXREM";
//        if("1".equals(szflg) && "X".equals(dclflg)){
//            return bopdecCommonValidator.warncheckTxrem(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbagrp.dcl.country")
//    public WarningResult warncheckCountryN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String dclflg = checkItems.getDclflg();
//        String subid = "BOPDBADCLCOUNTRY";
//        if("1".equals(szflg) && "X".equals(dclflg)){
//            String country = checkItems.getCountry();
//            String txcode = checkItems.getTxcode();
//            String txcode2 = checkItems.getTxcode2();
//            if (MdaUtils.isEmpty(country)) {
//                return WarningResult.buildEmpty(subid);
//            }
//            if (!MdaUtils.isEmpty(country) &&  "CHN".equals(country) && (!bopdecCommon.indexGt(txcode,"-999998-") && !bopdecCommon.indexGt(txcode2,"-999998-"))) {
//                return WarningResult.buildEmpty(subid);
//            }
//            //交易对方国别或地区为“ZZZ”
//            if(!MdaUtils.isEmpty(country) && "ZZZ".equals(country)) {
//                return WarningResult.build(subid,"第4.2.5.1项检核:交易对方国别或地区为“ZZZ”");
//            }
//        }
//        return WarningResult.buildEmpty(subid);
//    }

    //vrfpp 无

    //交易下定制化
    //bas

    //dcl
//    @Warning(path = "bopgat.dbagrp.dcl.billno")
//    public WarningResult warncheckRecgrpDclBillnoN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String dclflg = checkItems.getDclflg();
//        String subid = "BOPDBADCLBILLNO";
//        if("1".equals(szflg) && "X".equals(dclflg)){
//            //境内付款/承兑通知书-管理信息REGNO，无此编号时，N/A不强制，
//            //外汇局批件号/备案表号/业务编号信息不填或必填（20位）或填写为N/A
//            String billno = checkItems.getBillno();
//            String txcode = checkItems.getTxcode();
//            String txcode2 = checkItems.getTxcode2();
//            if (!MdaUtils.isEmpty(billno)) {
//                String str = billno;
//                byte[] buff = null;
//                try {
//                    buff = str.getBytes("GB18030");
//                }catch(Exception e) {
//                    return WarningResult.buildEmpty(subid);
//                }
//                int len = buff.length;
//                if(len > 50) {
//                    return WarningResult.buildEmpty(subid);
//                }
//                if (!"N/A".equals(billno)) {
//                    if (!(billno.length() == 20)) {
//                        return WarningResult.build(subid, "提示:外汇局批件号/备案表号/业务编号信息不填或必填（20位）或填写为N/A");
//                    }
//                }
//            }
//            boolean required = false;
//            if(!MdaUtils.isEmpty(txcode) && bopdecCommon.isZb(txcode)) {
//                required = true;
//            }
//            if(!MdaUtils.isEmpty(txcode2) && bopdecCommon.isZb(txcode2)) {
//                required = true;
//            }
//            if(!required) {
//                return WarningResult.buildEmpty(subid);
//            }
//            if(!MdaUtils.isEmpty(billno)) {
//                if("n/a".equals(billno) || "N/a".equals(billno) || "n/A".equals(billno)) {
//                    return WarningResult.buildEmpty(subid);
//                }
//            } else {
//                return WarningResult.buildEmpty(subid);
//            }
//        }
//        return WarningResult.buildEmpty(subid);
//    }

    //vrf
//    @Warning(path = "bopgat.dbdgrp.vrf.regno")
//    public WarningResult warncheckRecgrpVrfRegnoN950(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String vrfflg = checkItems.getVrfflg();
//        String subid = "BOPDBDVRFREGNO";
//        if("2".equals(szflg) && "X".equals(vrfflg)){
//            return bopdecCommonValidator.warncheckRegno(checkItems,subid);
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.vrf.txcode")
//    public WarningResult warncheckRecgrpVrfTxcodeN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String vrfflg = checkItems.getVrfflg();
//        String subid = "BOPDBDVRFTXCODE";
//        if("2".equals(szflg) && "X".equals(vrfflg)){
//            String txcode = checkItems.getTxcode();
//            String custype = checkItems.getCustype();
//            String lcyacc = checkItems.getLcyacc();
//            String fcyacc = checkItems.getFcyacc();
//            String othacc = checkItems.getOthacc();
//            if (MdaUtils.isEmpty(txcode)) {
//                return WarningResult.buildEmpty(subid);
//            }
//            if (!MdaUtils.isEmpty(txcode)) {
//                String str = txcode;
//                if (bopdecCommon.indexGt(custype, "-C-") && (bopdecCommon.startsWithValueUpper(lcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(fcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(othacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-"))) {
//                    if (!"929090".equals(str)) {
//                        return WarningResult.build(subid, "交易编码1:请确认是否为非居民机构账户间境内划转资金，如“是”则“交易编码1”栏位填写交易编码“929090”。");
//                    }
//                }
//            }
//        }
//        return WarningResult.buildEmpty(subid);
//    }

//    @Warning(path = "bopgat.dbdgrp.vrf.txrem")
//    public WarningResult warncheckRecgrpVrfTxremN100(CheckItems checkItems){
//        String szflg = checkItems.getSzflg();
//        String vrfflg = checkItems.getVrfflg();
//        String subid = "BOPDBDVRFTXREM";
//        if("2".equals(szflg) && "X".equals(vrfflg)){
//            String txrem = checkItems.getTxrem();
//            String custype = checkItems.getCustype();
//            String lcyacc = checkItems.getLcyacc();
//            String fcyacc = checkItems.getFcyacc();
//            String othacc = checkItems.getOthacc();
//            if (MdaUtils.isEmpty(txrem)) {
//                return WarningResult.buildEmpty(subid);
//            }
//            //校验字节数50-》256
//            if (!MdaUtils.isEmpty(txrem)) {
//                String str = txrem;
//                byte[] buff = null;
//                try {
//                    buff = str.getBytes("GB18030");
//                } catch (Exception e) {
//                    return WarningResult.buildEmpty(subid);
//                }
//                int len = buff.length;
//                if (len > 256) {
//                    return WarningResult.buildEmpty(subid);
//                }
//                if (bopdecCommon.indexGt(custype, "-C-") && (bopdecCommon.startsWithValueUpper(lcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(fcyacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-") || bopdecCommon.startsWithValueUpper(othacc, "-NRA-FTN-FTF-FTU-EFN-EFF-EFU-"))) {
//                    if (!"非居民机构账户间划转".equals(str)) {
//                        return WarningResult.build(subid, "交易附言1:请确认是否为非居民机构账户间境内划转资金，如“是”则“交易附言1”栏位填写“非居民机构账户间划转”。");
//                    }
//                }
//            }
//        }
//        return WarningResult.buildEmpty(subid);
//    }


}
