Commit 6b2461d0 by lei wang

Merge remote-tracking branch 'origin/psbc' into psbc

parents 15973b01 96b44192
......@@ -561,7 +561,7 @@ public abstract class AbstractMt2MxParseField implements Mt2MxParseField {
insLine = insLine.substring(0, 139) + "+";
}
MapUtil.puts(maps, key+"/finInstnId/nm", insLine);
MapUtil.puts(maps, key+"/finInstnId/pstlAdr/adrLine", Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE);
MapUtil.adds(maps, key+"/finInstnId/pstlAdr/adrLine", Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE);
}
}
}
......
......@@ -40,7 +40,6 @@ public class Camt054001Parse56Field extends AbstractMt2MxCamt054001ParseField {
String account = "";
if(field56A!=null){
String bicCode = field56A.getBIC();
mt_to_mxBICFI(bicCode, intrmyAgt1Maps);
if (StringUtil.isNotEmpty(field56A.getComponent1())) {
account = "/" + field56A.getComponent1();
}
......@@ -52,6 +51,13 @@ public class Camt054001Parse56Field extends AbstractMt2MxCamt054001ParseField {
mt_to_mxClearingIdentifier(account, clrSysMmbIdMaps);
}
}
if(clrSysMmbIdMaps.size()>0){
finInstnIdMaps.put("clrSysMmbId", clrSysMmbIdMaps);
}
if(finInstnIdMaps.size()>0){
intrmyAgt1Maps.put("finInstnId", finInstnIdMaps);
}
mt_to_mxBICFI(bicCode, intrmyAgt1Maps);
}
if (field56D != null) {
if (StringUtil.isNotEmpty(field56D.getComponent1())) {
......@@ -65,15 +71,15 @@ public class Camt054001Parse56Field extends AbstractMt2MxCamt054001ParseField {
mt_to_mxClearingIdentifier(account, clrSysMmbIdMaps);
}
}
if(clrSysMmbIdMaps.size()>0){
finInstnIdMaps.put("clrSysMmbId", clrSysMmbIdMaps);
}
if(finInstnIdMaps.size()>0){
intrmyAgt1Maps.put("finInstnId", finInstnIdMaps);
}
String nameAddress = field56D.getNameAndAddress();
mt_to_mxFinancialInstitutionNameAndUnstructuredAddress(nameAddress, intrmyAgt1Maps);
}
if(clrSysMmbIdMaps.size()>0){
finInstnIdMaps.put("clrSysMmbId", clrSysMmbIdMaps);
}
if(finInstnIdMaps.size()>0){
intrmyAgt1Maps.put("finInstnId", finInstnIdMaps);
}
if(intrmyAgt1Maps.size()>0){
rltdAgtsMaps.put("intrmyAgt1",intrmyAgt1Maps);
}
......
......@@ -990,13 +990,13 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
mtInstruction = "/TEMPREC/" + mtInstruction;
}
//提取 /GenericMax8c/
String mtType = context.get(SwiftMessage.class).getBlock2().getMessageType();
//String mtType = context.get(SwiftMessage.class).getBlock2().getMessageType();
String[] mxInstrInfs = StringUtil.splitAndKeepSeparator(mtInstruction, "/[A-Z0-9]{1,8}/");
for (int i=0; i<mxInstrInfs.length; i++) {
String mxIns = mxInstrInfs[i];
if (mxIns.startsWith("/FIN53/")) {
String bicCode = mxIns.substring(7);
if (Mx2MtConstants.MT_TYPE_103.equals(mtType)) {
//if (Mx2MtConstants.MT_TYPE_103.equals(mtType)) {
String acccount = mx_to_mtAccount(grpHdrParentElementName + ".GrpHdr.SttlmInf.SttlmAcct");
if (StringUtil.isEmpty(acccount)) {
String senderBic = (String)context.get(Mx2MtContextIdentifier.MX_SENDER_BIC, true);
......@@ -1008,9 +1008,9 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
} else {
bicCode53 = bicCode;
}
} else {
/*} else {
bicCode53 = bicCode;
}
}*/
}
}
}
......
......@@ -31,11 +31,12 @@ public class Field53AGenerate extends AbstractMx2MtTagsGenerate {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String settlementMethod = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.SttlmInf.SttlmMtd");
if (SettlementMethodCode.INGA.value().equals(settlementMethod)
|| SettlementMethodCode.INDA.value().equals(settlementMethod)) {
String value = "";
String bicCode = mx_to_mt53A(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt");
String account = mx_to_mtSettlementAccount(settlementMethod, grpHdrParentElementName+".GrpHdr.SttlmInf.SttlmAcct");
String account = mx_to_mtSettlementAccount(settlementMethod, grpHdrParentElementName+".GrpHdr.SttlmInf.SttlmAcct");
if ((SettlementMethodCode.INGA.value().equals(settlementMethod)
|| SettlementMethodCode.INDA.value().equals(settlementMethod))
&& StringUtil.isNotEmpty(account)) {
String value = "";
String bicCode = mx_to_mt53A(bodyHdrParentElementName + ".CdtTrfTxInf.InstrForNxtAgt");
if (StringUtil.isNotEmpty(bicCode)) {
if (StringUtil.isNotEmpty(account)) {
value = account + Mx2MtConstants.NEW_LINE + bicCode;
......
......@@ -6,4 +6,4 @@
:79:/AM09/
/UETR/8a562c67-ca16-48ba-b074-65581be6f001
:32A:210217EUR1500000,
-}
-}
\ No newline at end of file
......@@ -115,7 +115,7 @@
<NtryDtls>
<TxDtls>
<Refs>
<InstrId>chengenyu</InstrId>
<InstrId>abcsdleo</InstrId>
<EndToEndId>S100000189-735</EndToEndId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</Refs>
......@@ -145,7 +145,7 @@
<NtryDtls>
<TxDtls>
<Refs>
<InstrId>chengzhuoshen</InstrId>
<InstrId>hdkdelde</InstrId>
<EndToEndId>S100000189-735</EndToEndId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</Refs>
......
......@@ -87,9 +87,9 @@ Change Log
<Rsn>
<Cd>AM09</Cd>
</Rsn>
<AddtlInf>chengzhuoshen</AddtlInf>
<AddtlInf>dashuaige</AddtlInf>
<AddtlInf>zhendeshuai</AddtlInf>
<AddtlInf>hubei</AddtlInf>
<AddtlInf>wuhan</AddtlInf>
<AddtlInf>huangpi</AddtlInf>
</CxlRsnInf>
</TxInf>
</Undrlyg>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
THE MESSAGE WILL WORK “AS IS” IN THE READINESS PORTAL. IT IS ESSENTIAL THAT USERS REMOVE THE ENVELOPE AND REPLACE IT WITH THEIR OWN TRANSPORT HEADER (FOR EXAMPLE FOR ALLIANCE ACCESS YOU WOULD USE THE XML V2 HEADERS).
=========================================================================================================================================================================================
SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
====================================================================================================================================================================
Use Case p.8.1.2 Agent A RBS plc sends a pacs.008 to Agent B ABN Amro
========================================================================================================================
Change Log
2020-10-16 - Original version
=============================
-->
<Envelope xmlns="urn:swift:xsd:envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:swift:xsd:envelope ../../../../March21Schemas/Translator_envelope.xsd">
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Fr>
<FIId>
<FinInstnId>
<BICFI>RBOSGB2LXXX</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>ABNANL2AXXX</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>pacs8bizmsgidr01</BizMsgIdr>
<MsgDefIdr>pacs.008.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-04-09T09:00:00+01:00</CreDt>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08">
<FIToFICstmrCdtTrf>
<GrpHdr>
<MsgId>pacs8bizmsgidr01</MsgId>
<CreDtTm>2021-04-09T09:00:00+01:00</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<SttlmInf>
<SttlmMtd>INDA</SttlmMtd>
</SttlmInf>
</GrpHdr>
<CdtTrfTxInf>
<PmtId>
<InstrId>pacs8bizmsgidr01</InstrId>
<EndToEndId>pacs008EndToEndId-001</EndToEndId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</PmtId>
<IntrBkSttlmAmt Ccy="EUR">15000000</IntrBkSttlmAmt>
<IntrBkSttlmDt>2021-04-09</IntrBkSttlmDt>
<ChrgBr>DEBT</ChrgBr>
<InstgAgt>
<FinInstnId>
<BICFI>RBOSGB2LXXX</BICFI>
</FinInstnId>
</InstgAgt>
<InstdAgt>
<FinInstnId>
<BICFI>ABNANL2AXXX</BICFI>
</FinInstnId>
</InstdAgt>
<Dbtr>
<Nm>Large Company</Nm>
<PstlAdr>
<StrtNm>High Street</StrtNm>
<TwnNm>Epping</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Dbtr>
<DbtrAgt>
<FinInstnId>
<BICFI>RBOSGB2LXXX</BICFI>
</FinInstnId>
</DbtrAgt>
<CdtrAgt>
<FinInstnId>
<BICFI>KREDBEBB</BICFI>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>Ardent Finance</Nm>
<PstlAdr>
<StrtNm>Rue Saint Exupery</StrtNm>
<TwnNm> 17/13 4460 GRACE-HOLLOGNE</TwnNm>
<Ctry>BG</Ctry>
</PstlAdr>
</Cdtr>
<InstrForNxtAgt>
<InstrInf>123456/FIN53/TDOMUS33</InstrInf>
</InstrForNxtAgt>
<InstrForNxtAgt>
<InstrInf>123456789</InstrInf>
</InstrForNxtAgt>
<RmtInf>
<Ustrd>SWEEP 454-9663</Ustrd>
</RmtInf>
</CdtTrfTxInf>
</FIToFICstmrCdtTrf>
</Document>
</Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<!--
THE MESSAGE WILL WORK “AS IS” IN THE READINESS PORTAL. IT IS ESSENTIAL THAT USERS REMOVE THE ENVELOPE AND REPLACE IT WITH THEIR OWN TRANSPORT HEADER (FOR EXAMPLE FOR ALLIANCE ACCESS YOU WOULD USE THE XML V2 HEADERS).
=========================================================================================================================================================================================
Legal Disclaimer:
=================
SWIFT © 2020. All rights reserved.
This publication contains SWIFT or third-party confidential information. Do not disclose this publication outside your organisation without SWIFT’s prior written consent.
The use of this document is governed by the legal notices appearing at the end of this document. By using this document, you will be deemed to have accepted those legal notices.
=================================================================================================================================================================================
Use Case p.9.1.2 Agent C Toronto Dominion processes the payment on to Agent D Royal Bank of Canada
========================================================================================================================
Change Log
2021-06-30 - Original version
=============================
-->
<Envelope xmlns="urn:swift:xsd:envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:swift:xsd:envelope ../../../../March21Schemas/Translator_envelope.xsd">
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<Fr>
<FIId>
<FinInstnId>
<BICFI>TDOMCATT</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>ROYCCAT2</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>pacs9bizmsgidr03</BizMsgIdr>
<MsgDefIdr>pacs.009.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2021-04-27T10:10:47-04:00</CreDt>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.009.001.08">
<FICdtTrf>
<GrpHdr>
<MsgId>pacs9bizmsgidr03</MsgId>
<CreDtTm>2021-04-27T10:10:47-04:00</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<SttlmInf>
<SttlmMtd>INDA</SttlmMtd>
</SttlmInf>
</GrpHdr>
<CdtTrfTxInf>
<PmtId>
<InstrId>pacs9bizmsgidr03</InstrId>
<EndToEndId>pacs9bizmsgidr01</EndToEndId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
</PmtId>
<IntrBkSttlmAmt Ccy="CAD">2565972</IntrBkSttlmAmt>
<IntrBkSttlmDt>2021-04-27</IntrBkSttlmDt>
<InstgAgt>
<FinInstnId>
<BICFI>TDOMCATT</BICFI>
</FinInstnId>
</InstgAgt>
<InstdAgt>
<FinInstnId>
<BICFI>ROYCCAT2</BICFI>
</FinInstnId>
</InstdAgt>
<Dbtr>
<FinInstnId>
<BICFI>TDOMUS33</BICFI>
</FinInstnId>
</Dbtr>
<DbtrAgt>
<FinInstnId>
<BICFI>TDOMCATT</BICFI>
</FinInstnId>
</DbtrAgt>
<CdtrAgt>
<FinInstnId>
<BICFI>TDOMCATT</BICFI>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<FinInstnId>
<BICFI>NWBKGB2L</BICFI>
</FinInstnId>
</Cdtr>
<InstrForNxtAgt>
<InstrInf>123456/FIN53/TDOMUS33</InstrInf>
</InstrForNxtAgt>
<InstrForNxtAgt>
<InstrInf>123456789</InstrInf>
</InstrForNxtAgt>
</CdtTrfTxInf>
</FICdtTrf>
</Document>
</Envelope>
......@@ -62,8 +62,8 @@ public class Mt2MxTest {
}
@Test
public void testCamt056001_1() {
test("/swiftTxt/MT192.txt", null);
public void testCamt056001() {
test("/swiftTxt/MT292.txt", null);
}
@Test
......
......@@ -18,7 +18,8 @@ public class Mx2ElementTest {
@Test
public void testMx2Map() throws IOException {
File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00800108.xml"));
// File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00800108.xml"));
File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/camt02900109_196.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108_COV.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxCamt05300108_950.xml"));
......
......@@ -50,7 +50,7 @@ public class Mx2MtTest {
@Test
public void test103() {
test("/swiftXml/MxPacs00800108.xml", null);
test("/swiftXml/Pacs00800108.xml", null);
}
@Test
......@@ -60,7 +60,7 @@ public class Mx2MtTest {
@Test
public void test202() {
test("/swiftXml/MxPacs00900108.xml", null);
test("/swiftXml/Pacs00900108.xml", null);
}
@Test
......@@ -134,6 +134,11 @@ public class Mx2MtTest {
}
@Test
public void test920() {
test("/swiftXml/MxCamt06000105.xml", null);
}
@Test
public void testXmlFilePath() {
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus("d:/test/MxPacs00800108.xml", true, null, null);
System.out.println(str.getMessage());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment