Commit 16fa7d77 by zhanghou

修改了mt210,mt192292,mt196296,mt942的异常警告的定义和对判断是转成mt941还是mt942逻辑的修改

parent f3d17e8a
......@@ -24,4 +24,6 @@ public class Mx2MtContextIdentifier {
public static final String MX_TO_MT_ERROR_LOCATION = "mx.to.mt.error.location";
public static final String MX_TO_MT_TYPE = "mx.to.mt.type";
}
......@@ -83,7 +83,7 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_292;
}else {
buildSTErrorInfo(ERROR.T20092,"",bodyParentPath+"Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId");
buildSTErrorInfo(ERROR.T20092,null,null);
}
}
return mtType;
......
......@@ -40,7 +40,7 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
orgnlMsgNmId = mtType.substring(2);
}else {
orgnlMsgNmId = "202";
buildSTErrorInfo(ERROR.T20083,"","");
buildSTErrorInfo(ERROR.T20083,null,null);
}
}
}
......@@ -48,7 +48,7 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
if(dateStr.length()>0){
date = mXToMTDate(dateStr);
}else {
date = mXToMTDate("993112");
date = "993112";
}
}
......
......@@ -83,7 +83,7 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_296;
}else {
buildSTErrorInfo(ERROR.T20092,"",bodyParentPath+"CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId");
buildSTErrorInfo(ERROR.T20092,null,null);
}
}
return mtType;
......
......@@ -51,7 +51,7 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
if(dateStr.length()>0){
date = mXToMTDate(dateStr);
}else {
date = mXToMTDate("993112");
date = "993112";
boolean2 = true;
}
}
......@@ -60,7 +60,7 @@ public class Field11RGenerate extends AbstractMx2MtTagsGenerate {
}else {
tags.add(new Tag(name, orgnlMsgNmId+Mx2MtConstants.NEW_LINE+date));
if(boolean1){
buildSTErrorInfo(ERROR.T20083,"","");
buildSTErrorInfo(ERROR.T20083,null,null);
}
}
......
package com.brilliance.swift.mx2mt.mt210.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
......@@ -24,11 +25,12 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) {
messageId = messageId.substring(0, 15) + "+";
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", messageId);
}
String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:mt210/block3/:20:,errorcode:T20051
buildSTErrorInfo(ERROR.T20051, "BLOCK4/:20:", messageId);
}
tags.add(new Tag(name, value));
}
......
package com.brilliance.swift.mx2mt.mt210.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
......@@ -29,12 +30,13 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
}
if (StringUtil.isNotEmpty(filed21)) {
if (filed21.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", endToEndId);
filed21 = filed21.substring(0, 15) + "+";
}
String value = filed21;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:mt210/block3/:21:,errorcode:T20055
buildSTErrorInfo(ERROR.T20055, "BLOCK4/:21:", endToEndId);
}
tags.add(new Tag(name, value));
}
......
package com.brilliance.swift.mx2mt.mt210.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
......@@ -31,7 +32,7 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate {
mtDate = mXToMTDate(mxDate);
}else {
mtDate = mXToMTDate("991231");
//TODO,填入location:mt210/block3/:30:,errorcode:T00062
buildSTErrorInfo(ERROR.T20062, "BLOCK4/:20:","");
}
tags.add(new Tag(name, mtDate));
}
......
package com.brilliance.swift.mx2mt.mt210.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
......@@ -24,6 +25,7 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/50a");
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int counts1 = getXmlNodeCounts(bodyHdrParentElementName, document, "Ntfctn.Dbtr.Pty");
......@@ -96,7 +98,7 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_F, account + Mx2MtConstants.NEW_LINE + mtNameAddress));
}
}else {
//TODO,填入location:mt210/block3/:50a:,errorcode:T20102
buildSTErrorInfo(ERROR.T20102, "BLOCK4/:50a:","");
}
if(counts3>0||counts4>0) {
if (StringUtil.isNotEmpty(bicCode)) {
......@@ -109,10 +111,10 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_, nameAddress));
} else if (StringUtil.isNotEmpty(clearSystemId)) {
tags.add(new Tag(name_, clearSystemId));
//TODO,填入location:mt210/block3/:50a:,errorcode:T20097
buildSTErrorInfo(ERROR.T20097, "BLOCK4/:50a:","");
}
}else {
//TODO,填入location:mt210/block3/:50a:,errorcode:T20102
buildSTErrorInfo(ERROR.T20102, "BLOCK4/:50a:","");
}
}
}
......@@ -21,6 +21,7 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
context.set(Mx2MtContextIdentifier.MX_TO_MT_ERROR_LOCATION, "Block4/52a");
String s = (String)context.get(Mx2MtContextIdentifier.MT_TYPE_210_50_FLAG);
if(Mx2MtConstants.YES.equals(s)){
return;
......
......@@ -48,14 +48,18 @@ public class Mx2Mt941942Creator extends AbstractMx2MtCreator {
@Override
protected String getMtType() {
/*Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT);
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
int balanceTypeCount = getXmlNodeCounts(bodyParentPath, document, "Rpt.Bal");
if(balanceTypeCount>0){
return Mx2MtConstants.MT_TYPE_941;
}else {
int entryCount = getXmlNodeCounts(bodyParentPath, document, "Rpt.Ntry");
String sumc = getXmlNodeValue(bodyParentPath, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String sumd = getXmlNodeValue(bodyParentPath, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
if(entryCount!=0||StringUtil.isNotEmpty(sumc)||StringUtil.isNotEmpty(sumd)){
context.set(Mx2MtContextIdentifier.MX_TO_MT_TYPE,Mx2MtConstants.MT_TYPE_942);
return Mx2MtConstants.MT_TYPE_942;
}*/
return Mx2MtConstants.MT_TYPE_942;
}else {
context.set(Mx2MtContextIdentifier.MX_TO_MT_TYPE,Mx2MtConstants.MT_TYPE_941);
return Mx2MtConstants.MT_TYPE_941;
}
}
}
......@@ -20,18 +20,16 @@ public class Field28CGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String leSeNum = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.LglSeqNb");
String mt = "";
if(StringUtil.isEmpty(leSeNum)||leSeNum.length()>5){
mt = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.ElctrncSeqNb");
if(StringUtil.isEmpty(mt)||mt.length()>5){
String num = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.LglSeqNb");
if(StringUtil.isEmpty(num)||num.length()>5){
num = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.ElctrncSeqNb");
if(StringUtil.isEmpty(num)||num.length()>5){
buildSTErrorInfo(ERROR.T20103, "BLOCK4/:28:", bodyHdrParentElementName+"Rpt.ElctrncSeqNb");
return;
}
}else {
String pageNum = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.RptPgntn.PgNb");
mt = leSeNum + "/" + pageNum;
}
String pageNum = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.RptPgntn.PgNb");
String mt = num + "/" + pageNum;
tags.add(new Tag(name,mt));
}
}
package com.brilliance.swift.mx2mt.mt941942.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
......@@ -25,7 +27,11 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
/*SwiftMessage swiftMessage = context.get(SwiftMessage.class);
String mtType = (String) context.get(Mx2MtContextIdentifier.MX_TO_MT_TYPE);
if(Mx2MtConstants.MT_TYPE_942.equals(mtType)){
return;
}
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
......@@ -66,6 +72,6 @@ public class Field60FGenerate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}*/
}
}
}
......@@ -30,21 +30,15 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
try {
String mtType = (String) context.get(Mx2MtContextIdentifier.MX_TO_MT_TYPE);
if(Mx2MtConstants.MT_TYPE_941.equals(mtType)){
return;
}
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
/*int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
if(balanceTypeCount>0){
return;
}*/
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry");
if(entryCount>189){
buildSTErrorInfo(ERROR.T20110, "BLOCK4/:61:",bodyHdrParentElementName+"Rpt.Ntry");
return;
}
String sumc = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String sumd = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
if(entryCount<0|| StringUtil.isEmpty(sumc)&&StringUtil.isEmpty(sumd)){
buildSTErrorInfo(ERROR.T20114, "BLOCK4/:61:","");
buildSTErrorInfo(ERROR.T20110, "BLOCK4/:61:",entryCount+"");
return;
}
String ccy2 = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
......@@ -87,28 +81,25 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
}
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry(" + i + ").Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry(" + i + ").Amt@Ccy");
if(amt.length()>14){
buildSTErrorInfo(ERROR.T20113, "BLOCK4/:61:", amt);
return;
}
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
String amount = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
if(amount.length()>15){
buildSTErrorInfo(ERROR.T20113, "BLOCK4/:61:", amt);
return;
}
value += amount;
}
if(StringUtil.isNotEmpty(ccy)&&StringUtil.isNotEmpty(ccy2)){
if(ccy.equals(ccy2)){
if(!ccy.equals(ccy2)){
buildSTErrorInfo(ERROR.T20116, "BLOCK4/:61:", ccy);
return;
}
}
if(amt.length()>14){
buildSTErrorInfo(ERROR.T20113, "BLOCK4/:61:", bodyHdrParentElementName+"Rpt.Ntry(" + i + ").Amt");
return;
}
value += "NTRF";
String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry(" + i + ").NtryDtls.TxDtls.Refs.EndToEndId");
if (StringUtil.isNotEmpty(endToEndId)) {
if (endToEndId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:61:", endToEndId);
endToEndId = endToEndId.substring(0, 15) + "+";
}
value += endToEndId;
......@@ -118,6 +109,7 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
String accountServicerReference = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry("+i+").AcctSvcrRef");
if (StringUtil.isNotEmpty(accountServicerReference)) {
if (accountServicerReference.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:61:", accountServicerReference);
accountServicerReference = accountServicerReference.substring(0, 15) + "+";
}
value += "//" + accountServicerReference;
......@@ -125,6 +117,7 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
String additionalInformation = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry("+i+").NtryDtls.TxDtls.AddtlTxInf");
if (StringUtil.isNotEmpty(additionalInformation)) {
if (additionalInformation.length() > 34) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:61:", additionalInformation);
additionalInformation = additionalInformation.substring(0, 33) + "+";
}
value += Mx2MtConstants.NEW_LINE + additionalInformation;
......@@ -133,6 +126,7 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
String additionalEntryInformation = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry("+i+").AddtlNtryInf");
if (StringUtil.isNotEmpty(additionalEntryInformation)) {
if (additionalEntryInformation.length() > 390) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:61:", additionalEntryInformation);
additionalEntryInformation = additionalEntryInformation.substring(0, 389) + "+";
}
String value86 = StringUtil.getStringByEnter(additionalEntryInformation, 65, 6);
......
package com.brilliance.swift.mx2mt.mt941942.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
......@@ -25,7 +27,11 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
/*SwiftMessage swiftMessage = context.get(SwiftMessage.class);
String mtType = (String) context.get(Mx2MtContextIdentifier.MX_TO_MT_TYPE);
if(Mx2MtConstants.MT_TYPE_942.equals(mtType)){
return;
}
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
......@@ -66,6 +72,6 @@ public class Field62FGenerate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}*/
}
}
}
package com.brilliance.swift.mx2mt.mt941942.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
......@@ -25,7 +27,11 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
/*SwiftMessage swiftMessage = context.get(SwiftMessage.class);
String mtType = (String) context.get(Mx2MtContextIdentifier.MX_TO_MT_TYPE);
if(Mx2MtConstants.MT_TYPE_942.equals(mtType)){
return;
}
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
int index = -1;
......@@ -66,6 +72,6 @@ public class Field64Generate extends AbstractMx2MtTagsGenerate {
} catch (DatatypeConfigurationException e) {
throw new SwiftException("ERROR", e.getMessage());
}
}*/
}
}
}
......@@ -27,7 +27,11 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
@Override
public void tagGenerate() throws SwiftException {
/* SwiftMessage swiftMessage = context.get(SwiftMessage.class);
String mtType = (String) context.get(Mx2MtContextIdentifier.MX_TO_MT_TYPE);
if(Mx2MtConstants.MT_TYPE_942.equals(mtType)){
return;
}
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int balanceTypeCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Bal");
if (balanceTypeCount > 0) {
......@@ -64,6 +68,6 @@ public class Field65Generate extends AbstractMx2MtTagsGenerate {
}
}
}
}*/
}
}
}
......@@ -24,12 +24,6 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags();
String sumc = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String nbOfNtries = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.NbOfNtries");
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry");
String sumd = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
if(entryCount<0|| StringUtil.isEmpty(sumc)&&StringUtil.isEmpty(sumd)){
buildSTErrorInfo(ERROR.T20114, "BLOCK4/:90C:",bodyHdrParentElementName+"Rpt.TxsSummry.TtlCdtNtries.Sum");
return;
}
if(StringUtil.isNotEmpty(sumc)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sumc), currency);
......
......@@ -22,14 +22,8 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate {
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String sumc = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlCdtNtries.Sum");
String sumd = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.Sum");
String nbOfNtries = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.TxsSummry.TtlDbtNtries.NbOfNtries");
int entryCount = getXmlNodeCounts(bodyHdrParentElementName, document, "Rpt.Ntry");
if(entryCount<0|| StringUtil.isEmpty(sumc)&&StringUtil.isEmpty(sumd)){
buildSTErrorInfo(ERROR.T20114, "BLOCK4/:90D:",bodyHdrParentElementName+"Rpt.TxsSummry.TtlDbtNtries.Sum");
return;
}
if(StringUtil.isNotEmpty(sumd)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sumd), currency);
......
......@@ -78,9 +78,9 @@ Change Log
</Sts>
<CxlDtls>
<TxInfAndSts>
<CxlStsId>CNCL-ID001</CxlStsId>
<CxlStsId>CNCL-ID001</CxlStsId>
<RslvdCase>
<Id>CSE-001</Id>
<Id>CSE-001</Id>
<Cretr>
<Agt>
<FinInstnId>
......@@ -90,8 +90,8 @@ Change Log
</Cretr>
</RslvdCase>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
......
......@@ -66,7 +66,7 @@ Change Log
</Cretr>
</Case>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
......
......@@ -38,7 +38,7 @@ Change Log
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.057.001.06">
<NtfctnToRcv>
<GrpHdr>
<MsgId>camt57bizmsgidr1</MsgId>
<MsgId>camt57bizmsgidr1</MsgId>
<CreDtTm>2020-11-30T09:00:00+01:00</CreDtTm>
</GrpHdr>
<Ntfctn>
......@@ -62,21 +62,21 @@ Change Log
<BICFI>KREDBEBB</BICFI>
</FinInstnId>
</AcctSvcr>
<Dbtr>
<Pty>
<Nm>ABC Ltd</Nm>
<PstlAdr>
<StrtNm>10 Broad Street</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Pty>
</Dbtr>
<DbtrAgt>
<FinInstnId>
<Dbtr>
<Pty>
<Nm>ABC Ltd</Nm>
<PstlAdr>
<StrtNm>10 Broad Street</StrtNm>
<TwnNm>London</TwnNm>
<Ctry>GB</Ctry>
</PstlAdr>
</Pty>
</Dbtr>
<DbtrAgt>
<FinInstnId>
<BICFI>BARCGB22</BICFI>
</FinInstnId>
</DbtrAgt>
</FinInstnId>
</DbtrAgt>
<IntrmyAgt>
<FinInstnId>
<BICFI>CBPXBE99</BICFI>
......
package com.brilliance.mx2mt.mt196;
import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
public class TestMx2MtFor196 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt02900108_196.xml");
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt02900108_196.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt196 = SwiftTransfer.mx2Mt(xmlStr, null, null);
System.out.println(mt196);
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
if (str != null) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i=0; i<errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
String location = errorInfo.getLocation();
String errorType = errorInfo.getErrorType();
String description = errorInfo.getDescription();
System.out.println(location + Mx2MtConstants.NEW_LINE + "-" + errorType + ":" + description);
}
}
System.out.println(str.getMessage());
}
}
}
package com.brilliance.mx2mt.mt210;
import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
public class TestMx2MtFor210 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05700106.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt210 = SwiftTransfer.mx2Mt(xmlStr, null, null);
System.out.println(mt210);
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
if (str != null) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i=0; i<errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
String location = errorInfo.getLocation();
String errorType = errorInfo.getErrorType();
String description = errorInfo.getDescription();
System.out.println(location + Mx2MtConstants.NEW_LINE + "-" + errorType + ":" + description);
}
}
System.out.println(str.getMessage());
}
}
}
package com.brilliance.mx2mt.mt942;
import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
public class TestMx2MtFor942 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MXcamt05200108_942.xml");
String xmlStr = FileUtils.readFileToString(file);
String mt942 = SwiftTransfer.mx2Mt(xmlStr, null, null);
System.out.println(mt942);
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
if (str != null) {
List<SwiftTranslationErrorInfo> errorInfos = str.getErrorInfos();
if (errorInfos != null && errorInfos.size() > 0) {
for (int i=0; i<errorInfos.size(); i++) {
SwiftTranslationErrorInfo errorInfo = errorInfos.get(i);
String location = errorInfo.getLocation();
String errorType = errorInfo.getErrorType();
String description = errorInfo.getDescription();
System.out.println(location + Mx2MtConstants.NEW_LINE + "-" + errorType + ":" + description);
}
}
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