package com.brilliance.isc.swift.swifteditor;

import com.brilliance.isc.swift.swifteditor.tag.message.MessageAnalyzer;
import com.brilliance.isc.swift.swifteditor.tag.message.MessageFormat;
import com.brilliance.isc.swift.swifteditor.tag.message.SWFMessage;
import junit.framework.TestCase;

import java.io.IOException;
import java.util.LinkedList;
import java.util.List;

public class ParseSwiftTest extends TestCase {


    public void testLoadSwiftMessage() throws IOException {

        // 这个正则逻辑匹配入值需要修改，直接输入不了值还行
        // 问题，导入形式， 有域匹配不上的情况

//         String path = ParseSwiftTest.class.getClassLoader().getResource("103_SEND.sf2").getPath();

        String path = ParseSwiftTest.class.getClassLoader().getResource("103.sf2").getPath();

//        String path = ParseSwiftTest.class.getClassLoader().getResource("700.sf2").getPath();

//        String path = ParseSwiftTest.class.getClassLoader().getResource("202.sf2").getPath();

//        String path = ParseSwiftTest.class.getClassLoader().getResource("701.sf2").getPath();

//        String path = ParseSwiftTest.class.getClassLoader().getResource("950.sf2").getPath();


        String msg = MessageAnalyzer.readFull(path);
        // swift报文对象已加载
//        SWFMessage swf = MessageAnalyzer.loadSwiftMessage(msg);

         SWFMessage swf = MessageAnalyzer.loadCheckSwiftMessage(msg);


        // 校验逻辑  要校验的msg中的数据，校验逻辑是swf

//        System.out.println("开始生成报文");
//        System.out.println(swf.getMsgCheck("NYCBCNSH","ICBKGB2LAAAA"));
        swf.getMsgCheck("NYCBCNSH","ICBKGB2LAAAA");
//        print(swf.checkAll());
//        System.out.println("结束生成报文");

//        swf.getMsg("NYCBCNSH","ICBKGB2LAAAA");





        // System.out.println(swf.toJSON());
    }

    public void testGetFlatModel() {
        SWFMessage obj = MessageFormat.getSWFMessage("202COV");
        //System.out.println(obj.getFlatModel());
    }

    /**
     * 利用序号获取报文指定域和域块的值
     */
    public void testGetGenericByNo() {
        String path = ParseSwiftTest.class.getClassLoader().getResource("950.sf2").getPath();
        String msg = MessageAnalyzer.readFull(path);
        SWFMessage swf = SWFMessage.loadSwiftMessage(msg);
        System.out.println("获取4域(60F)=" + swf.getGenericByNo("4"));
        System.out.println("获取4域第二部分(60F的<DATE2>部分)=" + swf.getGenericByNo("4.1"));
        System.out.println("获取循环域5(61)=" + swf.getGenericByNo("5"));
        System.out.println("获取循环域5第一域块(61的6!n)=" + swf.getGenericByNo("5.0"));

        path = ParseSwiftTest.class.getClassLoader().getResource("1011.sf2").getPath();
        msg = MessageAnalyzer.readFull(path);
        swf = SWFMessage.loadSwiftMessage(msg);
        System.out.println("获取1域（不可循环的Sequence A的20域）=" + swf.getGenericByNo("1"));
        System.out.println("获取3域第二部分（不可循环的Sequence A的28D域）=" + swf.getGenericByNo("3.1"));
        System.out.println("获取10域（循环的Sequence B的21域）=" + swf.getGenericByNo("10"));
        System.out.println("获取12域（循环的Sequence B下的循环部分的23E域）=" + swf.getGenericByNo("12"));
        System.out.println("获取13域（循环的Sequence B的32B域）=" + swf.getGenericByNo("13"));
    }

    /**
     * 利用域名获取报文指定域和域块的值
     */
    public void testGetGenericByTag() {
        String path = ParseSwiftTest.class.getClassLoader().getResource("950.sf2").getPath();
        String msg = MessageAnalyzer.readFull(path);
        SWFMessage swf = SWFMessage.loadSwiftMessage(msg);
        assertEquals(swf.getGenericByTag("60F"), swf.getGenericByNo("4"));
        assertEquals(swf.getGenericByTag("60F.1"), swf.getGenericByNo("4.1"));
        assertEquals(swf.getGenericByTag("61.0"), swf.getGenericByNo("5.0"));

        path = ParseSwiftTest.class.getClassLoader().getResource("1011.sf2").getPath();
        msg = MessageAnalyzer.readFull(path);
        swf = SWFMessage.loadSwiftMessage(msg);
        assertEquals(swf.getGenericByTag("20"), swf.getGenericByNo("1"));
        assertEquals(swf.getGenericByTag("21"), swf.getGenericByNo("10"));
        assertEquals(swf.getGenericByTag("23E"), swf.getGenericByNo("12"));
        assertEquals(swf.getGenericByTag("59"), swf.getGenericByNo("19"));
        assertEquals(swf.getGenericByTag("32B"), swf.getGenericByNo("13"));
    }

    /**
     * 利用序号获取报文指定域和域块值得具体部分
     */
    public void testGetGenericByNoWithIndexs() {
        String path = ParseSwiftTest.class.getClassLoader().getResource("950.sf2").getPath();
        String msg = MessageAnalyzer.readFull(path);
        SWFMessage swf = SWFMessage.loadSwiftMessage(msg);
        System.out.println("获取循环域5(61)的第二个成员=" + swf.getGenericByNo("5", 1));
        System.out.println("获取循环域5第一域块(61的6!n)的第二个成员=" + swf.getGenericByNo("5.0", 1));
        path = ParseSwiftTest.class.getClassLoader().getResource("1011.sf2").getPath();
        msg = MessageAnalyzer.readFull(path);
        swf = SWFMessage.loadSwiftMessage(msg);
        System.out.println("获取10域（循环的Sequence B的21域）的第一个Sequence部分=" + swf.getGenericByNo("10", 0));
        System.out.println("获取12域（循环的Sequence B下的循环部分的23E域）的第二个sequence的第三个成员="
                + swf.getGenericByNo("12", 1, 2));
        System.out.println("获取Sequence B下的循环部分的32B域的第一个sequence成员的第一个币种部分="
                + swf.getGenericByTag("32B.0", 0));
    }

    /**
     * 利用域名获取报文指定域和域块值得具体部分
     */
    public void testGetGenericByTagWithIndexs() {
        String path = ParseSwiftTest.class.getClassLoader().getResource("950.sf2").getPath();
        String msg = MessageAnalyzer.readFull(path);
        SWFMessage swf = SWFMessage.loadSwiftMessage(msg);
        assertEquals(swf.getGenericByTag("61",1), swf.getGenericByNo("5",1));
        assertEquals(swf.getGenericByTag("61.0",1), swf.getGenericByNo("5.0",1));
        path = ParseSwiftTest.class.getClassLoader().getResource("1011.sf2").getPath();
        msg = MessageAnalyzer.readFull(path);
        swf = SWFMessage.loadSwiftMessage(msg);
        assertEquals(swf.getGenericByTag("23E",1,2), swf.getGenericByNo("12",1,2));
    }

    /**
     * 利用序号设置域或域模块的值
     */
    public void testSetGenericByNo() {
        SWFMessage swf = SWFMessage.getSWFMessage("950");
        //填充950的20域
        swf.setGenericByNo("1", "STMMDL129058636E");
        assertEquals(swf.getGenericByNo("1"), "STMMDL129058636E");
        //填充950的60a域
        swf.setGenericByNo("4", "C120330GBP94854.84", "60F");
        assertEquals(swf.getGenericByNo("4"), "C120330GBP94854.84");
        //填充950的60a域的第二部分
        swf.setGenericByNo("4.1", "120330", "60F");
        assertEquals(swf.getGenericByNo("4.1"), "120330");
        //填充950的61循环域
        List<String> sixtyone = new LinkedList<String>();
        sixtyone.add("1204120402DP10000.25S103CP23712040100007//GBS020420N8IM0HT\r\n" +
                "FENG XING");
        sixtyone.add("1304220402DP30000.55S103CP23712040100003//GBS02042H98IM0HS\r\n" +
                "FENG ZZWE");
        sixtyone.add("1404320402DP20115S103CP23712040200001//GBS020428Z8IVWJK\r\n" +
                "FENG EFFE");
        swf.setGenericByNo("5", sixtyone);
        assertEquals(swf.getGenericByNo("5"), sixtyone);
        //填充950的61域第5部分，Amount
        swf = SWFMessage.getSWFMessage("950");
        List<String> sixtyone_amount = new LinkedList<String>();
        sixtyone_amount.add("10000.25");
        sixtyone_amount.add("30000.55");
        sixtyone_amount.add("20115");
        swf.setGenericByNo("5.4", sixtyone_amount);
        assertEquals(swf.getGenericByNo("5.4"), sixtyone_amount);
        //填充101的不可循环的Sequence A的20域
        swf = SWFMessage.getSWFMessage("101");
        swf.setGenericByNo("1", "STMMDL129058636E");
        assertEquals(swf.getGenericByNo("1"), "STMMDL129058636E");
        //填充101的循环的Sequence B的21域
        List<Object> comList = new LinkedList<>();
        comList.add("101651ATT000005W");
        comList.add("321651ATT000005Z");
        swf.setGenericByNo("10", comList);
        assertEquals(swf.getGenericByNo("10"), comList);
        //填充101的循环的Sequence B的23E循环域
        comList = new LinkedList<>();
        List<String> one = new LinkedList<>();
        one.add("CHQB/HELLO");
        one.add("CHQB/WORLD");
        comList.add(one);
        one = new LinkedList<>();
        one.add("CHQB/MY");
        one.add("CHQB/NAME");
        one.add("CHQB/IS");
        comList.add(one);
        swf.setGenericByNo("12", comList);
        assertEquals(swf.getGenericByNo("12"), comList);
        comList = new LinkedList<>();
        comList.add("USD80000");
        comList.add("USD12322.11");
        swf.setGenericByNo("13", comList);
        assertEquals(swf.getGenericByNo("13"), comList);
    }

    /**
     * 利用域名设置域或域模块的值
     */
    public void testSetGenericByTag() {
        SWFMessage swf = SWFMessage.getSWFMessage("950");
        //填充950的20域
        swf.setGenericByTag("20", "STMMDL129058636E");
        assertEquals(swf.getGenericByTag("20"), "STMMDL129058636E");
        //填充950的60a域
        swf.setGenericByTag("60F", "C120330GBP94854.84");
        assertEquals(swf.getGenericByTag("60F"), "C120330GBP94854.84");
        //填充950的60a域的第二部分
        swf.setGenericByTag("60F.1", "120330");
        assertEquals(swf.getGenericByTag("60F.1"), "120330");
        //填充950的61循环域
        List<String> sixtyone = new LinkedList<String>();
        sixtyone.add("1204120402DP10000,25S103CP23712040100007//GBS020420N8IM0HT\r\n" +
                "FENG XING");
        sixtyone.add("1304220402DP30000,55S103CP23712040100003//GBS02042H98IM0HS\n\n" +
                "FENG ZZWE");
        sixtyone.add("1404320402DP20115,S103CP23712040200001//GBS020428Z8IVWJK\n\n" +
                "FENG EFFE");
        swf.setGenericByTag("61", sixtyone);
        sixtyone = new LinkedList<String>();
        sixtyone.add("1204120402DP10000.25S103CP23712040100007//GBS020420N8IM0HT\r\n" +
                "FENG XING");
        sixtyone.add("1304220402DP30000.55S103CP23712040100003//GBS02042H98IM0HS\r\n" +
                "FENG ZZWE");
        sixtyone.add("1404320402DP20115S103CP23712040200001//GBS020428Z8IVWJK\r\n" +
                "FENG EFFE");
        assertEquals(swf.getGenericByTag("61"), sixtyone);
        //填充950的61域第5部分，Amount
        swf = SWFMessage.getSWFMessage("950");
        List<String> sixtyone_amount = new LinkedList<String>();
        sixtyone_amount.add("10000.25");
        sixtyone_amount.add("30000.55");
        sixtyone_amount.add("20115");
        swf.setGenericByTag("61.4", sixtyone_amount);
        assertEquals(swf.getGenericByTag("61.4"), sixtyone_amount);
        //填充101的不可循环的Sequence A的20域
        swf = SWFMessage.getSWFMessage("101");
        swf.setGenericByTag("20", "STMMDL129058636E");
        assertEquals(swf.getGenericByTag("20"), "STMMDL129058636E");
        //填充101的循环的Sequence B的21域
        List<Object> comList = new LinkedList<>();
        comList.add("101651ATT000005W");
        comList.add("321651ATT000005Z");
        swf.setGenericByTag("21", comList);
        assertEquals(swf.getGenericByTag("21"), comList);
        //填充101的循环的Sequence B的23E循环域
        comList = new LinkedList<>();
        List<String> one = new LinkedList<>();
        one.add("CHQB/HELLO");
        one.add("CHQB/WORLD");
        comList.add(one);
        one = new LinkedList<>();
        one.add("CHQB/MY");
        one.add("CHQB/NAME");
        one.add("CHQB/IS");
        comList.add(one);
        swf.setGenericByTag("23E", comList);
        assertEquals(swf.getGenericByTag("23E"), comList);
        comList = new LinkedList<>();
        comList.add("USD80000");
        comList.add("USD12322.11");
        swf.setGenericByTag("32B", comList);
        assertEquals(swf.getGenericByTag("32B"), comList);
    }

    /**
     * 利用域名设置域或域模块的值，最后组成950 swift报文
     */
    public  void testGetMsgBodyFor950() {
        SWFMessage swf = SWFMessage.getSWFMessage("950");
        swf.setGenericByTag("20", "STMMDL129058636E");
        swf.setGenericByTag("25", "68446375");
        swf.setGenericByTag("28C.0", "00066");
        swf.setGenericByTag("28C.1", "00001");
        swf.setGenericByTag("60F.0", "C");
        swf.setGenericByTag("60F.1", "120330");
        swf.setGenericByTag("60F.2", "GBP");
        swf.setGenericByTag("60F.3", "94854.84");
        //填充950的61循环域
        List<String> sixtyone = new LinkedList<String>();
        sixtyone.add("1204120402DP10000.25S103CP23712040100007//GBS020420N8IM0HT\n" +
                "FENG XING");
        sixtyone.add("1304220402DP30000.55S103CP23712040100003//GBS02042H98IM0HS\n" +
                "FENG ZZWE");
        sixtyone.add("1404320402DP20115.S103CP23712040200001//GBS020428Z8IVWJK\n" +
                "FENG EFFE");
        swf.setGenericByTag("61", sixtyone);
        swf.setGenericByTag("62F.0", "C");
        swf.setGenericByTag("62F.1", "120402");
        swf.setGenericByTag("62F.2", "GBP");
        swf.setGenericByTag("62F.3", "14739.84");
        swf.setGenericByTag("64", "C120402GBP14739.84");
        System.out.println("开始生成950报文");
        //设置收发报行
        System.out.println(swf.getMsg("NYCBCNSH","ICBKGB2LAAAA"));
        System.out.println("结束生成950报文");
    }

    /**
     * 利用域名设置域或域模块的值，最后组成101 swift报文
     */
    public  void testGetMsgBodyFor101() {
        SWFMessage swf = SWFMessage.getSWFMessage("101");
        swf.setGenericByTag("20", "STMMDL129058636E");
        swf.setGenericByTag("28D.0", "1");
        swf.setGenericByTag("28D.1", "10");
        swf.setGenericByTag("30", "191111");
        List<Object> comList = new LinkedList<>();
        comList.add("101651ATT000005W");
        comList.add("321651ATT000005Z");
        swf.setGenericByTag("21", comList);
        comList = new LinkedList<>();
        List<String> one = new LinkedList<>();
        one.add("CHQB/HELLO");
        one.add("CHQB/WORLD");
        comList.add(one);
        one = new LinkedList<>();
        one.add("CHQB/MY");
        one.add("CHQB/NAME");
        one.add("CHQB/IS");
        comList.add(one);
        swf.setGenericByTag("23E", comList);
        List<Object> b32 = new LinkedList<>();
        b32.add("USD");
        b32.add("USD");
        swf.setGenericByTag("32B.0", b32);
        b32 = new LinkedList<>();
        b32.add("80000");
        b32.add("12322.11");
        swf.setGenericByTag("32B.1", b32);
        List<Object> b59 = new LinkedList<>();
        b59.add("/22222222222");
        b59.add("/11111111111");
        swf.setGenericByTag("59.0", b59);
        b59 = new LinkedList<>();
        b59.add("STRIX LIMITED\r\nFORREST HOUSE RONALDSWAY BALLASALLA\r\nISLE OF MAN UK");
        b59.add("HOLLW LSHIUHIWA\r\nWZDESSS HOUSE WAWAZDR\r\nDEDFFF OF EE ZK");
        swf.setGenericByTag("59.1", b59);
        List<Object> b71 = new LinkedList<>();
        b71.add("BEN");
        b71.add("OUR");
        swf.setGenericByTag("71A", b71);
        //设置收发报行
        System.out.println("开始生成101报文");
        System.out.println(swf.getMsg("NYCBCNSH","ICBKGB2LAAAA"));
        System.out.println("结束生成101报文");
    }

    public  void testSetGenericByTagAdv() {
        SWFMessage swf = SWFMessage.getSWFMessage("101");
        swf.setGenericByTag("20", "STMMDL129058636E");
        swf.setGenericByTag("28D.0", "1");
        swf.setGenericByTag("28D.1", "10");
        swf.setGenericByTag("30", "191111");
        swf.setGenericByTag("21", "101651ATT000005W",0);
        swf.setGenericByTag("21", "321651ATT000005Z",1);
        swf.setGenericByTag("23E", "CHQB/HELLO",0,0);
        swf.setGenericByTag("23E", "CHQB/WORLD",0,1);
        swf.setGenericByTag("23E", "CHQB/MY",1,0);
        swf.setGenericByTag("23E", "CHQB/NAME",1,1);
        swf.setGenericByTag("23E", "CHQB/IS",1,2);
        swf.setGenericByTag("32B.0", "USD",0);
        swf.setGenericByTag("32B.0", "USD",1);
        swf.setGenericByTag("32B.1", "80000",0);
        swf.setGenericByTag("32B.1", "12322.11",1);
        swf.setGenericByTag("59.0", "/22222222222",0);
        swf.setGenericByTag("59.0", "/11111111111",1);
        swf.setGenericByTag("59.1", "STRIX LIMITED\r\nFORREST HOUSE RONALDSWAY BALLASALLA\r\nISLE OF MAN UK",0);
        swf.setGenericByTag("59.1", "HOLLW LSHIUHIWA\r\nWZDESSS HOUSE WAWAZDR\r\nDEDFFF OF EE ZK",1);
        swf.setGenericByTag("71A", "BEN",0);
        swf.setGenericByTag("71A", "OUR",1);
        //设置收发报行
        System.out.println("开始生成101报文");
        System.out.println(swf.getMsg("NYCBCNSH","ICBKGB2LAAAA"));
        System.out.println("结束生成101报文");
    }

    /**
     * 利用域名设置域或域模块的值，最后组成101 swift报文
     */
    public  void testGetMsgBodyFor103() {

        SWFMessage swf = SWFMessage.getSWFMessage("103");


        //20
        swf.setGenericByTag("20", "SendersReference");
//        //13C
//        swf.setGenericByTag("13C", "TimeIndication");
        //23B
        swf.setGenericByTag("23B", "BankOperationCode");
        //23E
        swf.setGenericByTag("23E", "InstructionCode");
        List<Object> b71 = new LinkedList<>();
        b71.add("BEN");
        b71.add("OUR");
        swf.setGenericByTag("71A", b71);


//        //26T
//        swf.setGenericByTag("26T", "TransactionTypeCode");
//        //32A
//        swf.setGenericByTag("32A", "ValueDateCurrencyInterbankSettledAmount");
//        //33B
//        swf.setGenericByTag("33B", "CurrencyInstructedAmount");
//        //36
//        swf.setGenericByTag("36", "ExchangeRate");
//        //50a
//        swf.setGenericByTag("50a", "OrderingCustomer");
//        //51A
//        swf.setGenericByTag("51A", "SendingInstitution");
//        //52a
//        swf.setGenericByTag("52a", "OrderingInstitution");
//        //53a
//        swf.setGenericByTag("53a", "SendersCorrespondent");
//        //54a
//        swf.setGenericByTag("54a", "ReceiversCorrespondent");
//        //55a
//        swf.setGenericByTag("55a", "ThirdReimbursementInstitution");
//        //56a
//        swf.setGenericByTag("56a", "IntermediaryInstitution");
//        //57a
//        swf.setGenericByTag("57a", "AccountWithInstitution");
//        //59a
//        swf.setGenericByTag("59a", "BeneficiaryCustomer");
//        //70
//        swf.setGenericByTag("70", "RemittanceInformation");
//        //71A
//        swf.setGenericByTag("71A", "DetailsofCharges");
//        //71F
//        swf.setGenericByTag("71F", "SendersCharges");
//        //71G
//        swf.setGenericByTag("71G", "ReceiversCharges");
//        //72
//        swf.setGenericByTag("72", "SendertoReceiverInformation");
//        //77B
//        swf.setGenericByTag("77B", "RegulatoryReporting");


//
//        List<Object> b71 = new LinkedList<>();
//        b71.add("BEN");
//        b71.add("OUR");
//        swf.setGenericByTag("71A", b71);


        //设置收发报行
        System.out.println("开始生成103报文");
        System.out.println(swf.getMsg("NYCBCNSH","ICBKGB2LAAAA"));
        System.out.println("结束生成103报文");
    }

    /**
     * 利用域名设置域或域模块的值，最后组成101 swift报文
     */
    public  void testGetMsgBodyFor202() {
        SWFMessage swf = SWFMessage.getSWFMessage("101");
        swf.setGenericByTag("20", "STMMDL129058636E11");
        swf.setGenericByTag("28D.0", "1");
        swf.setGenericByTag("28D.1", "10");
        swf.setGenericByTag("30", "191111");
        List<Object> comList = new LinkedList<>();
        comList.add("101651ATT000005W");
        comList.add("321651ATT000005Z");
        swf.setGenericByTag("21", comList);
        comList = new LinkedList<>();
        List<String> one = new LinkedList<>();
        one.add("CHQB/HELLO");
        one.add("CHQB/WORLD");
        comList.add(one);
        one = new LinkedList<>();
        one.add("CHQB/MY");
        one.add("CHQB/NAME");
        one.add("CHQB/IS");
        comList.add(one);
        swf.setGenericByTag("23E", comList);
        List<Object> b32 = new LinkedList<>();
        b32.add("USD");
        b32.add("USD");
        swf.setGenericByTag("32B.0", b32);
        b32 = new LinkedList<>();
        b32.add("80000");
        b32.add("12322.11");
        swf.setGenericByTag("32B.1", b32);
        List<Object> b59 = new LinkedList<>();
        b59.add("/22222222222");
        b59.add("/11111111111");
        swf.setGenericByTag("59.0", b59);
        b59 = new LinkedList<>();
        b59.add("STRIX LIMITED\r\nFORREST HOUSE RONALDSWAY BALLASALLA\r\nISLE OF MAN UK");
        b59.add("HOLLW LSHIUHIWA\r\nWZDESSS HOUSE WAWAZDR\r\nDEDFFF OF EE ZK");
        swf.setGenericByTag("59.1", b59);
        List<Object> b71 = new LinkedList<>();
        b71.add("BEN");
        b71.add("OUR");
        swf.setGenericByTag("71A", b71);
        //设置收发报行
        System.out.println("开始生成101报文");
        System.out.println(swf.getMsg("NYCBCNSH","ICBKGB2LAAAA"));
        System.out.println("结束生成101报文");
    }

    /**
     * 利用域名设置域或域模块的值，最后组成101 swift报文
     */
    public  void testGetMsgBodyFor700() throws IOException {
        SWFMessage swf = SWFMessage.getSWFMessage("101");

        swf.setGenericByTag("20", "STMMDL129058636E");
        swf.setGenericByTag("28D.0", "1");
        swf.setGenericByTag("28D.1", "10");
        swf.setGenericByTag("30", "191111");
        List<Object> comList = new LinkedList<>();
        comList.add("101651ATT000005W");
        comList.add("321651ATT000005Z");
        swf.setGenericByTag("21", comList);
        comList = new LinkedList<>();
        List<String> one = new LinkedList<>();
        one.add("CHQB/HELLO");
        one.add("CHQB/WORLD");
        comList.add(one);
        one = new LinkedList<>();
        one.add("CHQB/MY");
        one.add("CHQB/NAME");
        one.add("CHQB/IS");
        comList.add(one);
        swf.setGenericByTag("23E", comList);
        List<Object> b32 = new LinkedList<>();
        b32.add("USD");
        b32.add("USD");
        swf.setGenericByTag("32B.0", b32);
        b32 = new LinkedList<>();
        b32.add("80000");
        b32.add("12322.11");
        swf.setGenericByTag("32B.1", b32);
        List<Object> b59 = new LinkedList<>();
        b59.add("/22222222222");
        b59.add("/11111111111");
        swf.setGenericByTag("59.0", b59);
        b59 = new LinkedList<>();
        b59.add("STRIX LIMITED\r\nFORREST HOUSE RONALDSWAY BALLASALLA\r\nISLE OF MAN UK");
        b59.add("HOLLW LSHIUHIWA\r\nWZDESSS HOUSE WAWAZDR\r\nDEDFFF OF EE ZK");
        swf.setGenericByTag("59.1", b59);
        List<Object> b71 = new LinkedList<>();
        b71.add("BEN");
        b71.add("OUR");
        // TODO 校验方法有问题？
        // 1.校验的tags.properties 需要改成最新的
        // 2.可以将报文转对象，然后将对象校验一遍，

        b71.add("OUR");
        swf.setGenericByTag("71A", b71);
        //设置收发报行
        System.out.println("开始生成101报文");
        System.out.println(swf.getMsg("NYCBCNSH","ICBKGB2LAAAA"));
        System.out.println("结束生成101报文");
    }
}
