package com.brilliance.isc.convert.mt2xx;

import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.commontag.ActnoBicAdrTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.commontag.DcDateCurAmtTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt2xx.MT205Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.JsonUtil;
import org.junit.Test;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * @Description：205Test
 * @Author：夏猛
 * @CreateTime：2023/2/27 15:50
 **/
public class MT205Test {
    @Test
    public void mt205_Test() {
        //52a
        ActnoBicAdrTagXXX actnoBicAdrTag52a=new ActnoBicAdrTagXXX("52");
        //actnoBicAdrTag52a.setInfo("A");
        //actnoBicAdrTag52a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag52a.setCode("THISIS41A");
        actnoBicAdrTag52a.setBic("GCYXXXXXX52");
        //actnoBicAdrTag52a.setAcctno("01111001759234567890");
        actnoBicAdrTag52a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag52a.setLocation("WHYHCNHBXXX");
        //53a
        ActnoBicAdrTagXXX actnoBicAdrTag53a=new ActnoBicAdrTagXXX("53");
        //actnoBicAdrTag53a.setInfo("/P");
        //actnoBicAdrTag53a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag53a.setCode("THISIS41A");
        actnoBicAdrTag53a.setBic("WERTYU12");
        //actnoBicAdrTag53a.setAcctno("6226TEST0001");
        actnoBicAdrTag53a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag53a.setLocation("WHYHCNHBXXX");
        //56a
        ActnoBicAdrTagXXX actnoBicAdrTag56a=new ActnoBicAdrTagXXX("56");
        //actnoBicAdrTag56a.setInfo("A");
        //actnoBicAdrTag56a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag56a.setCode("THISIS41A");
        actnoBicAdrTag56a.setBic("GCYXXXXXX56");
        //actnoBicAdrTag56a.setAcctno("01111001759234567890");
        actnoBicAdrTag56a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag56a.setLocation("WHYHCNHBXXX");
        //57a
        ActnoBicAdrTagXXX actnoBicAdrTag57a=new ActnoBicAdrTagXXX("57");
        //actnoBicAdrTag57a.setInfo("A");
        //actnoBicAdrTag57a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag57a.setCode("THISIS41A");
        actnoBicAdrTag57a.setBic("GCYXXXXXX57");
        //actnoBicAdrTag57a.setAcctno("01111001759234567890");
        actnoBicAdrTag57a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag57a.setLocation("WHYHCNHBXXX");
        //58a
        ActnoBicAdrTagXXX actnoBicAdrTag58a=new ActnoBicAdrTagXXX("58");
        actnoBicAdrTag58a.setAddress("58001");
        actnoBicAdrTag58a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag58a.setBic("GCYXXXXXX57");
        //32A 6!n3!a15d
        DcDateCurAmtTagXXX dcDateCurAmtTag32A = new DcDateCurAmtTagXXX("32");
        dcDateCurAmtTag32A.setCurrency("CON");//3!a
        dcDateCurAmtTag32A.setAmount(new BigDecimal("200"));//15d
        dcDateCurAmtTag32A.setDate("202302");//6!n

        //构造参数传入MT报文类型
        MT205Creator mt205Creator=new MT205Creator("205");
        mt205Creator.setSendBic("PSBCCNBJXXX");     //接收
        mt205Creator.setRecvBic("CIPSCNSHXXX");     //发送

        mt205Creator.setTransactionReferenceNumber("123456");   //20  16x
        mt205Creator.setRelatedReference("rr111111");           //21  16x

        LinkedList list205 = new LinkedList<>();
        list205.add("/HGF/0352-5621");
        list205.add("/HGF/0352-5622");
        mt205Creator.setTimeIndication(list205);     //13C  /8c/4!n1!x4!n

        mt205Creator.setValueDateCurrencyCodeAmount(dcDateCurAmtTag32A);    //32A 6!n3!a15d
        mt205Creator.setOrderingInstitution(actnoBicAdrTag52a);      //52a
        mt205Creator.setSendersCorrespondent(actnoBicAdrTag53a);      //53a
        mt205Creator.setIntermediary(actnoBicAdrTag56a);      //56a
//        mt205Creator.setAccountWithInstitution(actnoBicAdrTag57a);      //57a
        mt205Creator.setBeneficiaryInstitution(actnoBicAdrTag58a);      //58a
        mt205Creator.setSendertoReceiverInformation("info72");       //72 6*35x

        MtResult mtResult= MtCreatorManager.packMT(mt205Creator);
    }

    @Test
    public void mt20502_Test() {
        //52a
        ActnoBicAdrTagXXX actnoBicAdrTag52a=new ActnoBicAdrTagXXX("52");
        //actnoBicAdrTag52a.setInfo("A");
        actnoBicAdrTag52a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag52a.setCode("THISIS41A");
        //actnoBicAdrTag52a.setBic("GCYXXXXXX52");
        //actnoBicAdrTag52a.setAcctno("01111001759234567890");
        actnoBicAdrTag52a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag52a.setLocation("WHYHCNHBXXX");
        //53a
        ActnoBicAdrTagXXX actnoBicAdrTag53a=new ActnoBicAdrTagXXX("53");
        //actnoBicAdrTag53a.setInfo("/P");
        actnoBicAdrTag53a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag53a.setCode("THISIS41A");
        //actnoBicAdrTag53a.setBic("WERTYU12");
        //actnoBicAdrTag53a.setAcctno("6226TEST0001");
        actnoBicAdrTag53a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag53a.setLocation("WHYHCNHBXXX");
        //56a
        ActnoBicAdrTagXXX actnoBicAdrTag56a=new ActnoBicAdrTagXXX("56");
        //actnoBicAdrTag56a.setInfo("A");
        actnoBicAdrTag56a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag56a.setCode("THISIS41A");
        //actnoBicAdrTag56a.setBic("GCYXXXXXX56");
        //actnoBicAdrTag56a.setAcctno("01111001759234567890");
        actnoBicAdrTag56a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag56a.setLocation("WHYHCNHBXXX");
        //57a
        ActnoBicAdrTagXXX actnoBicAdrTag57a=new ActnoBicAdrTagXXX("57");
        //actnoBicAdrTag57a.setInfo("A");
        actnoBicAdrTag57a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag57a.setCode("THISIS41A");
        //actnoBicAdrTag57a.setBic("GCYXXXXXX57");
        //actnoBicAdrTag57a.setAcctno("01111001759234567890");
        actnoBicAdrTag57a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag57a.setLocation("WHYHCNHBXXX");
        //58a
        ActnoBicAdrTagXXX actnoBicAdrTag58a=new ActnoBicAdrTagXXX("58");
        //actnoBicAdrTag58a.setAddress("58001");
        actnoBicAdrTag58a.setPartyIdentifier("1234-5678");
        actnoBicAdrTag58a.setBic("GCYXXXXXX57");
        //32A 6!n3!a15d
        DcDateCurAmtTagXXX dcDateCurAmtTag32A = new DcDateCurAmtTagXXX("32");
        dcDateCurAmtTag32A.setCurrency("CON");//3!a
        dcDateCurAmtTag32A.setAmount(new BigDecimal("200"));//15d
        dcDateCurAmtTag32A.setDate("202302");//6!n

        //构造参数传入MT报文类型
        MT205Creator mt205Creator=new MT205Creator("205");
        mt205Creator.setSendBic("PSBCCNBJXXX");     //接收
        mt205Creator.setRecvBic("CIPSCNSHXXX");     //发送

        mt205Creator.setTransactionReferenceNumber("123456");   //20  16x
        mt205Creator.setRelatedReference("rr111111");           //21  16x

        LinkedList list205 = new LinkedList<>();
        list205.add("/HGF/0352-5621");
        list205.add("/HGF/0352-5622");
        mt205Creator.setTimeIndication(list205);     //13C  /8c/4!n1!x4!n

        mt205Creator.setValueDateCurrencyCodeAmount(dcDateCurAmtTag32A);    //32A 6!n3!a15d
        mt205Creator.setOrderingInstitution(actnoBicAdrTag52a);      //52a
        mt205Creator.setSendersCorrespondent(actnoBicAdrTag53a);      //53a
        mt205Creator.setIntermediary(actnoBicAdrTag56a);      //56a
        mt205Creator.setAccountWithInstitution(actnoBicAdrTag57a);      //57a
        mt205Creator.setBeneficiaryInstitution(actnoBicAdrTag58a);      //58a
        mt205Creator.setSendertoReceiverInformation("info72");       //72 6*35x

        MtResult mtResult= MtCreatorManager.packMT(mt205Creator);
    }


}

