package com.brilliance.isc.convert.mt7xx;

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.mt7xx.MT760Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import org.junit.Test;
import java.math.BigDecimal;

/**
 * @author gechengyang
 * @date 2023/2/14
 */
public class MT760Test {

    @Test
    public void mt760_Test() {
        //构造参数传入MT报文类型
        MT760Creator mt760Creator = new MT760Creator("760");//报文类型
        mt760Creator.setSendBic("COBADEFF");//发报行
        mt760Creator.setRecvBic("ROYCCAT2");//收报行
        //Sequence A
        //15A Empty field
        mt760Creator.setNewSequenceOfA("");
        //27 1!n/1!n;
        mt760Creator.setSequenceofTotalOfA("22");
        //22A 4!c
        mt760Creator.setPurposeofMessageOfA("ISCO");
        //Sequence B
        //15B Empty field
        mt760Creator.setNewSequenceOfB("");
        //20 16x
        mt760Creator.setUndertakingNumberOfB("GUA-INDIRC-8");
        //30 6!n
        mt760Creator.setDateofIssueOfB("140603");
        //22D 4!c
        mt760Creator.setFormofUndertakingOfB("DASD");
        //40C 4!a[/35x]
        mt760Creator.setApplicableRulesOfB("NONE");
        //23B 4!c
        mt760Creator.setExpiryTypeOfB("FIXD");
        //52a 52A
        ActnoBicAdrTagXXX issuerOfB = new ActnoBicAdrTagXXX("52");
        issuerOfB.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        //issuerOfB.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        issuerOfB.setAddress("EBAF\nBGDFSdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd");//52D Address 4*35x
        mt760Creator.setIssuerOfB(issuerOfB);
        //59a 59A
        ActnoBicAdrTagXXX beneficiaryOfB = new ActnoBicAdrTagXXX("59");
        beneficiaryOfB.setAcctno("ARNSGBF");//Account [/34x]
        //beneficiaryOfB.setAddress("MJNGHT");//No letter option Address 4*35x
        beneficiaryOfB.setBic("ROYCCATEXXX");//59A BIC 4!a2!a2!c[3!c]
        mt760Creator.setBeneficiaryOfB(beneficiaryOfB);
        //32B 3!a15d
        DcDateCurAmtTagXXX undertakingAmountOfB = new DcDateCurAmtTagXXX("32");
        undertakingAmountOfB.setCurrency("EUR");//3!a
        undertakingAmountOfB.setAmount(new BigDecimal("1830000"));//15d
        mt760Creator.setUndertakingAmountOfB(undertakingAmountOfB);
        //77U 150*65z
        mt760Creator.setUndertakingTermsandConditionsOfB("In consideration of your issuing your\r\nguarantee as requested above,\r\nwe hereby give you our irrevocable\r\nand unconditional counter-guarantee \r\nNo.GUA-INDIRC-8 and undertake to \r\npay to you without reservation \r\nand notwithstanding any contestation from our\r\nprincipal or any third party any sum or\r\nsums not exceeding in total the \r\namount stated in field 32B.");
        //Sequence C
        //15C Empty field
        mt760Creator.setNewSequenceOfC("");
        //22D 4!c
        mt760Creator.setFormofUndertakingOfC("DASD");
        //40C 4!a[/35x]
        mt760Creator.setApplicableRulesOfC("NONE");
        //23B 4!c
        mt760Creator.setExpiryTypeOfC("FIXD");
        //50 4*35x
        mt760Creator.setApplicantOfC("EH Eigert GmbH\r\nHauptstrasse 987\r\nDE/12345 Mannheim");
        //59
        ActnoBicAdrTagXXX beneficiaryOfC = new ActnoBicAdrTagXXX("59");
        beneficiaryOfC.setAcctno("Greenwich Pulp Corp.");//Account [/34x]
        beneficiaryOfC.setAddress("34568 High Water Street\r\nCA/Vancouver, A5G 3T8");//Address 4*35x
        mt760Creator.setBeneficiaryOfC(beneficiaryOfC);
        //32B 3!a15d
        DcDateCurAmtTagXXX undertakingAmountOfC = new DcDateCurAmtTagXXX("32");
        undertakingAmountOfC.setCurrency("EUR");//3!a
        undertakingAmountOfC.setAmount(new BigDecimal("1830000"));//15d
        mt760Creator.setUndertakingAmountOfC(undertakingAmountOfC);
        //45L 50*65z
        mt760Creator.setUnderlyingTransactionDetailsOfC("Whereas EH Eigert GmbH, Hauptstrasse 987, 12345 Mannheim,\r\nGermany have entered into a purchase contract\r\nnumber ABCD/XY-QC/2014/1 dated 3 March 2014 for\r\ndelivery of Iron Ore (the 'Contract').");

        //非必选项
        //Sequence A
        //72Z 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformationOfA = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformationOfA.setNarrative("OIRVNSDLK");
        mt760Creator.setSendertoReceiverInformationOfA(sendertoReceiverInformationOfA);
        //23X 4!c/65x
        //mt760Creator.setFileIdentificationOfA("ICOC/FERT");
        //Sequence B
        //31E 6!n
        mt760Creator.setDateofExpiryOfB("170630");
        //35G 12*65x
        //mt760Creator.setExpiryConditionEventOfB("qweqwe");
        //50 4*35x
        mt760Creator.setApplicantOfB("EH Eigert GmbH\r\nHauptstrasse 987\r\nDE/12345 Mannheim");
        //51 4*35x
        mt760Creator.setObligorInstructingPartyOfB("qweq");
        //56a 56A
        ActnoBicAdrTagXXX advisingBankOfB = new ActnoBicAdrTagXXX("56");
        advisingBankOfB.setPartyIdentifier("A");//Party Identifier [/1!a][/34x]
        advisingBankOfB.setBic("EWRWTE12");//56A BIC 4!a2!a2!c[3!c]
        //advisingBankOfB.setAddress("ETYRGBF\r\nTNBDFB");//56D Address 4*35x
        mt760Creator.setAdvisingBankOfB(advisingBankOfB);
        //23 16x
        mt760Creator.setAdvisingBankReferenceOfB("REFDSREFBD");
        //57a 57A
        ActnoBicAdrTagXXX adviseThroughBankOfB = new ActnoBicAdrTagXXX("57");
        adviseThroughBankOfB.setPartyIdentifier("A");//Party Identifier [/1!a][/34x]
        adviseThroughBankOfB.setBic("IDSVDFBJXXX");//57A BIC 4!a2!a2!c[3!c]
        //adviseThroughBankOfB.setAddress("TRBFD\r\nBGFDS");//57D Address 4*35x
        mt760Creator.setAdviseThroughBankOfB(adviseThroughBankOfB);
        //39D 12*65z
        mt760Creator.setSupplementaryInformationAboutAmountOfB("qweq");
        //41a 41F
        ActnoBicAdrTagXXX availableWithOfB = new ActnoBicAdrTagXXX("41");
        availableWithOfB.setBic("IDSVDFBJXXX");//41F BIC 4!a2!a2!c[3!c]
        //availableWithOfB.setAddress("RTBGDF");//41G Address 4*35x
        mt760Creator.setAvailableWithOfB(availableWithOfB);
        //71D 6*35z
        ActnoBicAdrTagXXX chargesOfB = new ActnoBicAdrTagXXX("71");
        chargesOfB.setNarrative("MTSRGBDF");
        mt760Creator.setChargesOfB(chargesOfB);
        //45C 100*65z
        mt760Creator.setDocumentandPresentationInstructionsOfB("Upon receipt by us of your first demand in writing or\r\nby authenticated SWIFT-message\r\nwherein you notify us that you have been called\r\nupon to effect payment under your\r\nguarantee in accordance with its terms and in the amount\r\nyou are demanding from us.");
        //49 7!x
        mt760Creator.setConfirmationInstructionsOfB("MAY ADD");
        //58a 58A
        ActnoBicAdrTagXXX requestedConfirmationPartyOfB = new ActnoBicAdrTagXXX("58");
        requestedConfirmationPartyOfB.setPartyIdentifier("A");//Party Identifier [/1!a][/34x]
        requestedConfirmationPartyOfB.setBic("EWRWTEBJXXX");//58A BIC 4!a2!a2!c[3!c]
        //requestedConfirmationPartyOfB.setAddress("RETBNGDFS");//58D Address 4*35x
        mt760Creator.setRequestedConfirmationPartyOfB(requestedConfirmationPartyOfB);
        //44H 2!a[/35x]
        mt760Creator.setGoverningLawJurisdictionOfB("AZ");
        //23F 4!a[/65x]
        mt760Creator.setAutomaticExtensionPeriodOfB("DCAD/RTBRE");
        //78 12*65x
        mt760Creator.setAutomaticExtensionNonExtensionNotificationOfB("JERGFRNEDT");
        //26E 3n
        mt760Creator.setAutomaticExtensionNotificationPeriodOfB("455");
        //31S 6!n
        mt760Creator.setAutomaticExtensionFinalExpiryDateOfB("230313");
        //48B 4!c
        mt760Creator.setDemandIndicatorOfB("ICCO");
        //48D 4!c
        //mt760Creator.setTransferIndicatorOfB("ICOC");
        //39E 12*65z
        mt760Creator.setTransferConditionsOfB("RETBRG");
        //45L 50*65z
        mt760Creator.setUnderlyingTransactionDetailsOfB("ERGBRG");
        //24E 4!c[/35x]
        //mt760Creator.setDeliveryofOriginalUndertakingOfB("COUR/DHL");
        //24G
        ActnoBicAdrTagXXX deliveryToCollectionByOfB = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfB.setCode("BENE");//Code 4!c
        deliveryToCollectionByOfB.setAddress("RETBG");//Address [6*35x]
        //mt760Creator.setDeliveryToCollectionByOfB(deliveryToCollectionByOfB);
        //Sequence C
        //31C 6!n
        mt760Creator.setRequestedDateofIssueOfC("230313");
        //22K 4!c[/35x]
        mt760Creator.setTypeofUndertakingOfC("VOCI/RVEMWS");
        //31E 6!n
        mt760Creator.setDateofExpiryOfC("230313");
        //35G 12*65x
        //mt760Creator.setExpiryConditionEventOfC("EBFGF");
        //51 4*35x
        mt760Creator.setObligorInstructingPartyOfC("BETFD");
        //52a 52A
        //ActnoBicAdrTagXXX issuerOfC = new ActnoBicAdrTagXXX("52");
        //issuerOfC.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        //issuerOfC.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        //issuerOfC.setAddress("BTQREFD");//52D Address 4*35x
        //mt760Creator.setIssuerOfC(issuerOfC);
        //39D 12*65z
        mt760Creator.setSupplementaryInformationAboutAmountOfC("RTRBEF\r\nTBDFS");
        //41a 41F
        ActnoBicAdrTagXXX availableWithOfC = new ActnoBicAdrTagXXX("41");
        availableWithOfC.setBic("TERHTRBJXXX");//41F BIC 4!a2!a2!c[3!c]
        //availableWithOfC.setAddress("RTHHRT");//41G Address 4*35x
        mt760Creator.setAvailableWithOfC(availableWithOfC);
        //71D 6*35z
        ActnoBicAdrTagXXX chargesOfC = new ActnoBicAdrTagXXX("71");
        chargesOfC.setNarrative("BSRGFR");
        mt760Creator.setChargesOfC(chargesOfC);
        //45C 100*65z
        mt760Creator.setDocumentandPresentationInstructionsOfC("We undersigned --- (bank)\r\nfax no. ---,\r\nor telex no. ---");
        //77L 150*65z
        mt760Creator.setRequestedLocalUndertakingTermsandConditionsOfC("We undersigned --- (bank) hereby irrevocably and unconditionally\r\nundertake to pay to yourselves or\r\nyour order immediately and\r\nwithin 3 calendar days from receipt\r\nof documents stated in field 45C.");
        //22Y 4!c
        mt760Creator.setStandardWordingRequiredOfC("DCAC");
        //40D 2!a
        mt760Creator.setStandardWordingRequestedLanguageOfC("TD");
        //44H 2!a[/65x]
        mt760Creator.setGoverningLawJurisdictionOfC("TR/REBFDS");
        //23F 4!a[/35x]
        mt760Creator.setAutomaticExtensionPeriodOfC("RCDE/RFWE");
        //78 12*65x
        mt760Creator.setAutomaticExtensionNonExtensionNotificationOfC("WREVFD");
        //26E 3n
        mt760Creator.setAutomaticExtensionNotificationPeriodOfC("462");
        //31S 6!n
        mt760Creator.setAutomaticExtensionFinalExpiryDateOfC("230313");
        //48B 4!c
        mt760Creator.setDemandIndicatorOfC("ICBC");
        //48D 4!c
        mt760Creator.setTransferIndicatorOfC("ACIS");
        //39E 12*65z
        mt760Creator.setTransferConditionsOfC("RETBD");
        //24E 4!c[/35x]
        mt760Creator.setDeliveryofLocalUndertakingOfC("COUR/DHL");
        //24G
        ActnoBicAdrTagXXX deliveryToCollectionByOfC = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfC.setCode("BENE");//Code 4!c
        deliveryToCollectionByOfC.setAddress("NGRTHNFG");//Address [6*35x]
        mt760Creator.setDeliveryToCollectionByOfC(deliveryToCollectionByOfC);

        MtResult mtResult = MtCreatorManager.packMT(mt760Creator);
        if (mtResult.isSuccess()) {
            System.out.println(mtResult.getMessage());
        } else {
            System.out.println(String.format("mtResut boolean:%s ,Description===\r\n%s",mtResult.isSuccess(),mtResult.getDescription()));
        }
    }


    @Test
    public void mt760_Test2() {
        //构造参数传入MT报文类型
        MT760Creator mt760Creator = new MT760Creator("760");//报文类型
        mt760Creator.setSendBic("COBADEFF");//发报行
        mt760Creator.setRecvBic("ROYCCAT2");//收报行
        //Sequence A
        //15A Empty field
        mt760Creator.setNewSequenceOfA("");
        //27 1!n/1!n;
        mt760Creator.setSequenceofTotalOfA("1/1");
        //22A 4!c
        mt760Creator.setPurposeofMessageOfA("ICCO");
        //Sequence B
        //15B Empty field
        mt760Creator.setNewSequenceOfB("");
        //20 16x
        mt760Creator.setUndertakingNumberOfB("GUA-INDIRC-8");
        //30 6!n
        mt760Creator.setDateofIssueOfB("140603");
        //22D 4!c
        mt760Creator.setFormofUndertakingOfB("DGDG");
        //40C 4!a[/35x]
        mt760Creator.setApplicableRulesOfB("NONE");
        //23B 4!c
        mt760Creator.setExpiryTypeOfB("FIXD");
        //52a 52D
        ActnoBicAdrTagXXX issuerOfB = new ActnoBicAdrTagXXX("52");
        issuerOfB.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        //issuerOfB.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        issuerOfB.setAddress("EBAF\r\nBGDFSdddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeffffffffggg");//52D Address 4*35x
        mt760Creator.setIssuerOfB(issuerOfB);
        //59a 59
        ActnoBicAdrTagXXX beneficiaryOfB = new ActnoBicAdrTagXXX("59");
        beneficiaryOfB.setAcctno("ARNSGBF");//Account [/34x]
        beneficiaryOfB.setAddress("MJNGHT");//No letter option Address 4*35x
        //beneficiaryOfB.setBic("ROYCCATEXXX");//59A BIC 4!a2!a2!c[3!c]
        mt760Creator.setBeneficiaryOfB(beneficiaryOfB);
        //32B 3!a15d
        DcDateCurAmtTagXXX undertakingAmountOfB = new DcDateCurAmtTagXXX("32");
        undertakingAmountOfB.setCurrency("EUR");//3!a
        undertakingAmountOfB.setAmount(new BigDecimal("1830000"));//15d
        mt760Creator.setUndertakingAmountOfB(undertakingAmountOfB);
        //77U 150*65z
        mt760Creator.setUndertakingTermsandConditionsOfB("In consideration of your issuing your\r\nguarantee as requested above,\r\nwe hereby give you our irrevocable\r\nand unconditional counter-guarantee \r\nNo.GUA-INDIRC-8 and undertake to \r\npay to you without reservation \r\nand notwithstanding any contestation from our\r\nprincipal or any third party any sum or\r\nsums not exceeding in total the \r\namount stated in field 32B.");
        //Sequence C
        //15C Empty field
        mt760Creator.setNewSequenceOfC("");
        //22D 4!c
        mt760Creator.setFormofUndertakingOfC("DGAR");
        //40C 4!a[/35x]
        mt760Creator.setApplicableRulesOfC("NONE");
        //23B 4!c
        mt760Creator.setExpiryTypeOfC("FIXD");
        //50 4*35x
        mt760Creator.setApplicantOfC("EH Eigert GmbH\r\nHauptstrasse 987\r\nDE/12345 Mannheim");
        //59
        ActnoBicAdrTagXXX beneficiaryOfC = new ActnoBicAdrTagXXX("59");
        beneficiaryOfC.setAcctno("Greenwich Pulp Corp.");//Account [/34x]
        beneficiaryOfC.setAddress("34568 High Water Street\r\nCA/Vancouver, A5G 3T8");//Address 4*35x
        mt760Creator.setBeneficiaryOfC(beneficiaryOfC);
        //32B 3!a15d
        DcDateCurAmtTagXXX undertakingAmountOfC = new DcDateCurAmtTagXXX("32");
        undertakingAmountOfC.setCurrency("EUR");//3!a
        undertakingAmountOfC.setAmount(new BigDecimal("1830000"));//15d
        mt760Creator.setUndertakingAmountOfC(undertakingAmountOfC);
        //45L 50*65z
        mt760Creator.setUnderlyingTransactionDetailsOfC("Whereas EH Eigert GmbH, Hauptstrasse 987, 12345 Mannheim,\r\nGermany have entered into a purchase contract\r\nnumber ABCD/XY-QC/2014/1 dated 3 March 2014 for\r\ndelivery of Iron Ore (the 'Contract').");

        //非必选项
        //Sequence A
        //72Z 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformationOfA = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformationOfA.setNarrative("Please advise us execution\r\nand provide us with a copy\r\nof your guarantee for our files.");
        mt760Creator.setSendertoReceiverInformationOfA(sendertoReceiverInformationOfA);
        //23X 4!c/65x
        mt760Creator.setFileIdentificationOfA("ICOC/FERT");
        //Sequence B
        //31E 6!n
        mt760Creator.setDateofExpiryOfB("170630");
        //35G 12*65x
        mt760Creator.setExpiryConditionEventOfB("qweqwe");
        //50 4*35x
        mt760Creator.setApplicantOfB("EH Eigert GmbH\r\nHauptstrasse 987\r\nDE/12345 Mannheim");
        //51 4*35x
        mt760Creator.setObligorInstructingPartyOfB("qweq");
        //56a 56D
        ActnoBicAdrTagXXX advisingBankOfB = new ActnoBicAdrTagXXX("56");
        advisingBankOfB.setPartyIdentifier("D");//Party Identifier [/1!a][/34x]
        //advisingBankOfB.setBic("EWRWTE12");//56A BIC 4!a2!a2!c[3!c]
        advisingBankOfB.setAddress("ETYRGBF\r\nTNBDFB");//56D Address 4*35x
        mt760Creator.setAdvisingBankOfB(advisingBankOfB);
        //23 16x
        mt760Creator.setAdvisingBankReferenceOfB("REFDSREFBD");
        //57a 57D
        ActnoBicAdrTagXXX adviseThroughBankOfB = new ActnoBicAdrTagXXX("57");
        adviseThroughBankOfB.setPartyIdentifier("D");//Party Identifier [/1!a][/34x]
        //adviseThroughBankOfB.setBic("IDSVDFBJXXX");//57A BIC 4!a2!a2!c[3!c]
        adviseThroughBankOfB.setAddress("TRBFD\r\nBGFDS");//57D Address 4*35x
        mt760Creator.setAdviseThroughBankOfB(adviseThroughBankOfB);
        //39D 12*65z
        mt760Creator.setSupplementaryInformationAboutAmountOfB("qweq");
        //41a 41G
        ActnoBicAdrTagXXX availableWithOfB = new ActnoBicAdrTagXXX("41");
        //availableWithOfB.setBic("IDSVDFBJXXX");//41F BIC 4!a2!a2!c[3!c]
        availableWithOfB.setAddress("RTBGDF");//41G Address 4*35x
        mt760Creator.setAvailableWithOfB(availableWithOfB);
        //71D 6*35z
        ActnoBicAdrTagXXX chargesOfB = new ActnoBicAdrTagXXX("71");
        chargesOfB.setNarrative("YTNRBFVSDCAS");
        mt760Creator.setChargesOfB(chargesOfB);
        //45C 100*65z
        mt760Creator.setDocumentandPresentationInstructionsOfB("Upon receipt by us of your first demand in writing or\r\nby authenticated SWIFT-message\r\nwherein you notify us that you have been called\r\nupon to effect payment under your\r\nguarantee in accordance with its terms and in the amount\r\nyou are demanding from us.");
        //49 7!x
        mt760Creator.setConfirmationInstructionsOfB("MAY ADD");
        //58a 58D
        ActnoBicAdrTagXXX requestedConfirmationPartyOfB = new ActnoBicAdrTagXXX("58");
        requestedConfirmationPartyOfB.setPartyIdentifier("A");//Party Identifier [/1!a][/34x]
        //requestedConfirmationPartyOfB.setBic("EWRWTEBJXXX");//58A BIC 4!a2!a2!c[3!c]
        requestedConfirmationPartyOfB.setAddress("RETBNGDFS");//58D Address 4*35x
        mt760Creator.setRequestedConfirmationPartyOfB(requestedConfirmationPartyOfB);
        //44H 2!a[/35x]
        mt760Creator.setGoverningLawJurisdictionOfB("AZ");
        //23F 4!a[/65x]
        mt760Creator.setAutomaticExtensionPeriodOfB("DCAD/RTBRE");
        //78 12*65x
        mt760Creator.setAutomaticExtensionNonExtensionNotificationOfB("JERGFRNEDT");
        //26E 3n
        mt760Creator.setAutomaticExtensionNotificationPeriodOfB("455");
        //31S 6!n
        mt760Creator.setAutomaticExtensionFinalExpiryDateOfB("230313");
        //48B 4!c
        mt760Creator.setDemandIndicatorOfB("ICCO");
        //48D 4!c
        mt760Creator.setTransferIndicatorOfB("ICOC");
        //39E 12*65z
        mt760Creator.setTransferConditionsOfB("RETBRG");
        //45L 50*65z
        mt760Creator.setUnderlyingTransactionDetailsOfB("ERGBRG");
        //24E 4!c[/35x]
        mt760Creator.setDeliveryofOriginalUndertakingOfB("COUR/DHL");
        //24G
        ActnoBicAdrTagXXX deliveryToCollectionByOfB = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfB.setCode("BENE");//Code 4!c
        deliveryToCollectionByOfB.setAddress("RETBG");//Address [6*35x]
        mt760Creator.setDeliveryToCollectionByOfB(deliveryToCollectionByOfB);
        //Sequence C
        //31C 6!n
        mt760Creator.setRequestedDateofIssueOfC("230313");
        //22K 4!c[/35x]
        mt760Creator.setTypeofUndertakingOfC("VOCI/RVEMWS");
        //31E 6!n
        mt760Creator.setDateofExpiryOfC("230313");
        //35G 12*65x
        mt760Creator.setExpiryConditionEventOfC("EBFGF");
        //51 4*35x
        mt760Creator.setObligorInstructingPartyOfC("BETFD");
        //52a 52D
        ActnoBicAdrTagXXX issuerOfC = new ActnoBicAdrTagXXX("52");
        issuerOfC.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        //issuerOfC.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        issuerOfC.setAddress("BTQREFD");//52D Address 4*35x
        mt760Creator.setIssuerOfC(issuerOfC);
        //39D 12*65z
        mt760Creator.setSupplementaryInformationAboutAmountOfC("RTRBEF\r\nTBDFS");
        //41a 41G
        ActnoBicAdrTagXXX availableWithOfC = new ActnoBicAdrTagXXX("41");
        //availableWithOfC.setBic("TERHTRBJXXX");//41F BIC 4!a2!a2!c[3!c]
        availableWithOfC.setAddress("RTHHRT");//41G Address 4*35x
        mt760Creator.setAvailableWithOfC(availableWithOfC);
        //71D 6*35z
        ActnoBicAdrTagXXX chargesOfC = new ActnoBicAdrTagXXX("71");
        chargesOfC.setNarrative("BSRGFR");
        mt760Creator.setChargesOfC(chargesOfC);
        //45C 100*65z
        mt760Creator.setDocumentandPresentationInstructionsOfC("We undersigned --- (bank)\r\nfax no. ---,\r\nor telex no. ---");
        //77L 150*65z
        mt760Creator.setRequestedLocalUndertakingTermsandConditionsOfC("We undersigned --- (bank) hereby irrevocably and unconditionally\r\nundertake to pay to yourselves or\r\nyour order immediately and\r\nwithin 3 calendar days from receipt\r\nof documents stated in field 45C.");
        //22Y 4!c
        mt760Creator.setStandardWordingRequiredOfC("DCAC");
        //40D 2!a
        mt760Creator.setStandardWordingRequestedLanguageOfC("TD");
        //44H 2!a[/65x]
        mt760Creator.setGoverningLawJurisdictionOfC("TR/REBFDS");
        //23F 4!a[/35x]
        mt760Creator.setAutomaticExtensionPeriodOfC("RCDE/RFWE");
        //78 12*65x
        mt760Creator.setAutomaticExtensionNonExtensionNotificationOfC("WREVFD");
        //26E 3n
        mt760Creator.setAutomaticExtensionNotificationPeriodOfC("462");
        //31S 6!n
        mt760Creator.setAutomaticExtensionFinalExpiryDateOfC("230313");
        //48B 4!c
        mt760Creator.setDemandIndicatorOfC("ICBC");
        //48D 4!c
        mt760Creator.setTransferIndicatorOfC("ACIS");
        //39E 12*65z
        mt760Creator.setTransferConditionsOfC("RETBD");
        //24E 4!c[/35x]
        mt760Creator.setDeliveryofLocalUndertakingOfC("COUR/DHL");
        //24G
        ActnoBicAdrTagXXX deliveryToCollectionByOfC = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfC.setCode("BENE");//Code 4!c
        deliveryToCollectionByOfC.setAddress("NGRTHNFG");//Address [6*35x]
        mt760Creator.setDeliveryToCollectionByOfC(deliveryToCollectionByOfC);

        MtResult mtResult = MtCreatorManager.packMT(mt760Creator);
        if (mtResult.isSuccess()) {
            System.out.println(mtResult.getMessage());
        } else {
            System.out.println(String.format("mtResut boolean:%s ,Description===\r\n%s",mtResult.isSuccess(),mtResult.getDescription()));
        }
    }
    /*@Test
    public void test() {
        String str = "love234csdnjava";
        String regEx = "[^0-9]";
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(str);
        String result = m.replaceAll("").trim();
        System.out.println(result);
        System.out.println(str);

        MT760Creator mt760Creator=new MT760Creator();
        mt760Creator.setSendBic("PSBCCNBJXXX");
        mt760Creator.setRecvBic("CIPSCNSHXXX");
        mt760Creator.setAdditionalAmountInformation("ABC");

        ActnoBicAdrTagXXX actnoBicAdrTagC52a = new ActnoBicAdrTagXXX("52");
        actnoBicAdrTagC52a.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        actnoBicAdrTagC52a.setBic("TESTTEST");//52A BIC 4!a2!a2!c[3!c]
        //actnoBicAdrTagC52a.setAddress("egrgrgr");//52D Address 4*35x
        mt760Creator.setActnoBicAdrTagC52a(actnoBicAdrTagC52a);
        //对象设置完成后，遍历Field,校验报文栏位值是否正常.
       // System.out.println(new Gson().toJson(mt760Creator));
       // System.out.println(JsonUtil.toJson(mt760Creator));
        TagResult tagResult=mt760Creator.getActnoBicAdrTagC52a().getTagResult();
        //获取value
        System.out.println(tagResult.getValue());
        //获取Tag
        System.out.println(tagResult.getTagBefore()+tagResult.getTagEnd());
    }*/

}

