Commit 3e32e0af by zhanghou

mt192292的异常警告的定义

parent 8f9dedf7
...@@ -183,7 +183,7 @@ public class SwiftTransfer { ...@@ -183,7 +183,7 @@ public class SwiftTransfer {
} }
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00200110_Pacs009.xml"); File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05700106.xml");
String xmlStr = FileUtils.readFileToString(file); String xmlStr = FileUtils.readFileToString(file);
validateMx(xmlStr); validateMx(xmlStr);
} }
......
package com.brilliance.swift.mx2mt.mt192292; package com.brilliance.swift.mx2mt.mt192292;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator; import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
...@@ -72,6 +73,8 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator { ...@@ -72,6 +73,8 @@ public class Mx2Mtn92Creator extends AbstractMx2MtCreator {
mtType = Mx2MtConstants.MT_TYPE_192; mtType = Mx2MtConstants.MT_TYPE_192;
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) { } else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_292; mtType = Mx2MtConstants.MT_TYPE_292;
}else {
buildSTErrorInfo(ERROR.T20092,null,null);
} }
} }
return mtType; return mtType;
......
package com.brilliance.swift.mx2mt.mt192292.impl; package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
...@@ -25,6 +26,24 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate { ...@@ -25,6 +26,24 @@ public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm"); String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlGrpInf.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(mtType)) { if (StringUtil.isNotEmpty(mtType)) {
orgnlMsgNmId = getMtMsg(mtType); orgnlMsgNmId = getMtMsg(mtType);
if(StringUtil.isNotEmpty(mtType)){
if(mtType.startsWith("pacs.008")){
orgnlMsgNmId = "103";
}else if(mtType.startsWith("pacs.003")){
orgnlMsgNmId = "104";
}else if(mtType.startsWith("pacs.009")){
orgnlMsgNmId = "202";
}else if(mtType.startsWith("pacs.010")){
orgnlMsgNmId = "204";
}else if(mtType.matches("MT10[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
}else if(mtType.matches("MT20[0-9]{1}")){
orgnlMsgNmId = mtType.substring(2);
}else {
orgnlMsgNmId = "202";
buildSTErrorInfo(ERROR.T20083,null,null);
}
}
} }
if(StringUtil.isNotEmpty(dateStr)){ if(StringUtil.isNotEmpty(dateStr)){
date = mXToMTDate(dateStr); date = mXToMTDate(dateStr);
......
package com.brilliance.swift.mx2mt.mt192292.impl; package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil; import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport;
import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag; import com.prowidesoftware.swift.model.Tag;
...@@ -23,11 +28,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -23,11 +28,13 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.Case.Id"); String messageId = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.Case.Id");
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) { if (messageId.length() > 16) {
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:20:", messageId);
messageId = messageId.substring(0, 15) + "+"; messageId = messageId.substring(0, 15) + "+";
} }
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20080, "BLOCK4/:20:", messageId);
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
package com.brilliance.swift.mx2mt.mt192292.impl; package com.brilliance.swift.mx2mt.mt192292.impl;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate; import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.util.StringUtil; import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag; import com.prowidesoftware.swift.model.Tag;
...@@ -24,12 +26,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -24,12 +26,16 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
if (StringUtil.isNotEmpty(orgnlInstrId)) { if (StringUtil.isNotEmpty(orgnlInstrId)) {
if (orgnlInstrId.length() > 16) { if (orgnlInstrId.length() > 16) {
orgnlInstrId = orgnlInstrId.substring(0, 15) + "+"; orgnlInstrId = orgnlInstrId.substring(0, 15) + "+";
buildSTErrorInfo(ERROR.T0000T, "BLOCK4/:21:", orgnlInstrId);
} }
String value = orgnlInstrId; String value = orgnlInstrId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
buildSTErrorInfo(ERROR.T20081, "BLOCK4/:21:", orgnlInstrId);
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
}else {
buildSTErrorInfo(ERROR.T20072, "BLOCK4/:21:", orgnlInstrId);
} }
} }
} }
...@@ -73,6 +73,8 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator { ...@@ -73,6 +73,8 @@ public class Mx2Mtn96Creator extends AbstractMx2MtCreator {
mtType = Mx2MtConstants.MT_TYPE_196; mtType = Mx2MtConstants.MT_TYPE_196;
} else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) { } else if (orgMsgNameIdentification.matches("MT20[0-9]{1}")) {
mtType = Mx2MtConstants.MT_TYPE_296; mtType = Mx2MtConstants.MT_TYPE_296;
}else {
//TODO,填入location:(mt196|mt296)/block3/:11R:,errorcode:T20083
} }
} }
return mtType; return mtType;
......
...@@ -28,6 +28,7 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -28,6 +28,7 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:(mt196|mt296)/block3/:20:,errorcode:T20090
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -28,6 +28,7 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -28,6 +28,7 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
String value = orgnlInstrId; String value = orgnlInstrId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:(mt196|mt296)/block3/:21:,errorcode:T20091
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -28,6 +28,7 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -28,6 +28,7 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:mt210/block3/:20:,errorcode:T20051
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -34,6 +34,7 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate { ...@@ -34,6 +34,7 @@ public class Field21Generate extends AbstractMx2MtTagsGenerate {
String value = filed21; String value = filed21;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:mt210/block3/:21:,errorcode:T20055
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -20,6 +20,7 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate { ...@@ -20,6 +20,7 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate {
SwiftMessage swiftMessage = context.get(SwiftMessage.class); SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
String mxDate = ""; String mxDate = "";
String mtDate = "";
String valDt = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.XpctdValDt"); String valDt = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.XpctdValDt");
if(StringUtil.isNotEmpty(valDt)){ if(StringUtil.isNotEmpty(valDt)){
mxDate = valDt; mxDate = valDt;
...@@ -27,8 +28,11 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate { ...@@ -27,8 +28,11 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate {
mxDate = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Itm("+0+").XpctdValDt"); mxDate = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Itm("+0+").XpctdValDt");
} }
if(StringUtil.isNotEmpty(mxDate)){ if(StringUtil.isNotEmpty(mxDate)){
String mtDate = mXToMTDate(mxDate); mtDate = mXToMTDate(mxDate);
tags.add(new Tag(name, mtDate)); }else {
mtDate = mXToMTDate("991231");
//TODO,填入location:mt210/block3/:30:,errorcode:T00062
} }
tags.add(new Tag(name, mtDate));
} }
} }
...@@ -95,6 +95,8 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -95,6 +95,8 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
String mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath); String mtNameAddress = mx_to_mtFinancialInstitutionNameAndUnstructuredAddress(partyPath);
tags.add(new Tag(name_F, account + Mx2MtConstants.NEW_LINE + mtNameAddress)); tags.add(new Tag(name_F, account + Mx2MtConstants.NEW_LINE + mtNameAddress));
} }
}else {
//TODO,填入location:mt210/block3/:50a:,errorcode:T20102
} }
if(counts3>0||counts4>0) { if(counts3>0||counts4>0) {
if (StringUtil.isNotEmpty(bicCode)) { if (StringUtil.isNotEmpty(bicCode)) {
...@@ -107,7 +109,10 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -107,7 +109,10 @@ public class Field50aGenerate extends AbstractMx2MtTagsGenerate {
tags.add(new Tag(name_, nameAddress)); tags.add(new Tag(name_, nameAddress));
} else if (StringUtil.isNotEmpty(clearSystemId)) { } else if (StringUtil.isNotEmpty(clearSystemId)) {
tags.add(new Tag(name_, clearSystemId)); tags.add(new Tag(name_, clearSystemId));
//TODO,填入location:mt210/block3/:50a:,errorcode:T20097
} }
}else {
//TODO,填入location:mt210/block3/:50a:,errorcode:T20102
} }
} }
} }
...@@ -28,6 +28,7 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -28,6 +28,7 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate {
String value = messageId; String value = messageId;
if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) { if (value.startsWith("/") || value.endsWith("/") || value.contains("//")) {
value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE; value = Mx2MtConstants.MX_TO_MT_DEFAULT_VALUE;
//TODO,填入location:mt942/block3/:20:,errorcode:T20115
} }
tags.add(new Tag(name, value)); tags.add(new Tag(name, value));
} }
......
...@@ -77,6 +77,10 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate { ...@@ -77,6 +77,10 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) { if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
value += NumberUtil.formatAmt(new BigDecimal(amt), ccy); value += NumberUtil.formatAmt(new BigDecimal(amt), ccy);
} }
if(amt.length()>15){
//TODO,填入location:mt942/block3/:61:,errorcode:T20113
return;
}
value += "NTRF"; value += "NTRF";
String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry(" + i + ").NtryDtls.TxDtls.Refs.EndToEndId"); String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Ntry(" + i + ").NtryDtls.TxDtls.Refs.EndToEndId");
if (StringUtil.isNotEmpty(endToEndId)) { if (StringUtil.isNotEmpty(endToEndId)) {
......
...@@ -26,11 +26,15 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate { ...@@ -26,11 +26,15 @@ public class Field90CGenerate extends AbstractMx2MtTagsGenerate {
if(StringUtil.isNotEmpty(sum)&&StringUtil.isNotEmpty(nbOfNtries)) { if(StringUtil.isNotEmpty(sum)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy"); String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sum), currency); String amt = NumberUtil.formatAmt(new BigDecimal(sum), currency);
if(amt.length()>15||nbOfNtries.length()>5){ if(amt.length()>15){
//TODO,填入location:mt942/block3/:90C:,errorcode:T20120
}else if(nbOfNtries.length()>5){
//TODO,填入location:mt942/block3/:90C:,errorcode:T20119
} else { } else {
tags.add(new Tag(name,nbOfNtries+currency+amt)); tags.add(new Tag(name,nbOfNtries+currency+amt));
} }
}else {
//TODO,填入location:mt942/block3/:90C:,errorcode:T20122
} }
} }
} }
...@@ -26,11 +26,15 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate { ...@@ -26,11 +26,15 @@ public class Field90DGenerate extends AbstractMx2MtTagsGenerate {
if(StringUtil.isNotEmpty(sum)&&StringUtil.isNotEmpty(nbOfNtries)) { if(StringUtil.isNotEmpty(sum)&&StringUtil.isNotEmpty(nbOfNtries)) {
String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy"); String currency = getXmlNodeValue(bodyHdrParentElementName, document, "Rpt.Acct.Ccy");
String amt = NumberUtil.formatAmt(new BigDecimal(sum), currency); String amt = NumberUtil.formatAmt(new BigDecimal(sum), currency);
if(amt.length()>15||nbOfNtries.length()>5){ if(amt.length()>15){
//TODO,填入location:mt942/block3/:90D:,errorcode:T20120
} else if(nbOfNtries.length()>5){
//TODO,填入location:mt942/block3/:90D:,errorcode:T20119
} else { } else {
tags.add(new Tag(name,nbOfNtries+currency+amt)); tags.add(new Tag(name,nbOfNtries+currency+amt));
} }
}else {
//TODO,填入location:mt942/block3/:90D:,errorcode:T20121
} }
} }
} }
...@@ -42,16 +42,6 @@ Change Log ...@@ -42,16 +42,6 @@ Change Log
<CreDtTm>2020-12-15T11:00:00-07:00</CreDtTm> <CreDtTm>2020-12-15T11:00:00-07:00</CreDtTm>
</GrpHdr> </GrpHdr>
<Rpt> <Rpt>
<TxsSummry>
<TtlCdtNtries>
<Sum Ccy="EUR">385700</Sum>
<NbOfNtries>87</NbOfNtries>
</TtlCdtNtries>
<TtlDbtNtries>
<Sum Ccy="EUR">210000</Sum>
<NbOfNtries>9</NbOfNtries>
</TtlDbtNtries>
</TxsSummry>
<Id>100-01</Id> <Id>100-01</Id>
<RptPgntn> <RptPgntn>
<PgNb>1</PgNb> <PgNb>1</PgNb>
...@@ -114,6 +104,16 @@ Change Log ...@@ -114,6 +104,16 @@ Change Log
<Dt>2020-12-15</Dt> <Dt>2020-12-15</Dt>
</Dt> </Dt>
</Bal> </Bal>
<TxsSummry>
<TtlCdtNtries>
<NbOfNtries>87</NbOfNtries>
<Sum>385700</Sum>
</TtlCdtNtries>
<TtlDbtNtries>
<NbOfNtries>9</NbOfNtries>
<Sum>210000</Sum>
</TtlDbtNtries>
</TxsSummry>
<Ntry> <Ntry>
<Amt Ccy="EUR">1000000</Amt> <Amt Ccy="EUR">1000000</Amt>
<CdtDbtInd>CRDT</CdtDbtInd> <CdtDbtInd>CRDT</CdtDbtInd>
......
...@@ -42,16 +42,6 @@ Change Log ...@@ -42,16 +42,6 @@ Change Log
<CreDtTm>2020-12-15T11:00:00-07:00</CreDtTm> <CreDtTm>2020-12-15T11:00:00-07:00</CreDtTm>
</GrpHdr> </GrpHdr>
<Rpt> <Rpt>
<TxsSummry>
<TtlCdtNtries>
<Sum Ccy="EUR">385700</Sum>
<NbOfNtries>87</NbOfNtries>
</TtlCdtNtries>
<TtlDbtNtries>
<Sum Ccy="EUR">210000</Sum>
<NbOfNtries>9</NbOfNtries>
</TtlDbtNtries>
</TxsSummry>
<Id>100-01</Id> <Id>100-01</Id>
<RptPgntn> <RptPgntn>
<PgNb>1</PgNb> <PgNb>1</PgNb>
...@@ -66,6 +56,16 @@ Change Log ...@@ -66,6 +56,16 @@ Change Log
</Id> </Id>
<Ccy>EUR</Ccy> <Ccy>EUR</Ccy>
</Acct> </Acct>
<TxsSummry>
<TtlCdtNtries>
<NbOfNtries>87</NbOfNtries>
<Sum>385700</Sum>
</TtlCdtNtries>
<TtlDbtNtries>
<NbOfNtries>9</NbOfNtries>
<Sum>210000</Sum>
</TtlDbtNtries>
</TxsSummry>
<Ntry> <Ntry>
<Amt Ccy="EUR">1000000</Amt> <Amt Ccy="EUR">1000000</Amt>
<CdtDbtInd>CRDT</CdtDbtInd> <CdtDbtInd>CRDT</CdtDbtInd>
......
...@@ -98,8 +98,6 @@ Change Log ...@@ -98,8 +98,6 @@ Change Log
<OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId> <OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId>
<OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR> <OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR>
<CxlStsRsnInf> <CxlStsRsnInf>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf>
<Orgtr> <Orgtr>
<Nm>A Debiter</Nm> <Nm>A Debiter</Nm>
<PstlAdr> <PstlAdr>
...@@ -111,6 +109,8 @@ Change Log ...@@ -111,6 +109,8 @@ Change Log
<Rsn> <Rsn>
<Cd>AGNT</Cd> <Cd>AGNT</Cd>
</Rsn> </Rsn>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,W</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf>
</CxlStsRsnInf> </CxlStsRsnInf>
</TxInfAndSts> </TxInfAndSts>
</CxlDtls> </CxlDtls>
......
...@@ -114,7 +114,7 @@ Change Log ...@@ -114,7 +114,7 @@ Change Log
<Ntry> <Ntry>
<Amt Ccy="EUR">100.23</Amt> <Amt Ccy="EUR">100.23</Amt>
<CdtDbtInd>DBIT</CdtDbtInd> <CdtDbtInd>DBIT</CdtDbtInd>
<RvslInd>True</RvslInd> <RvslInd>true</RvslInd>
<Sts> <Sts>
<Cd>BOOK</Cd> <Cd>BOOK</Cd>
</Sts> </Sts>
......
...@@ -106,15 +106,6 @@ Change Log ...@@ -106,15 +106,6 @@ Change Log
<Purp> <Purp>
<Cd>COMC</Cd> <Cd>COMC</Cd>
</Purp> </Purp>
<RltdRmtInf>
<RmtId>ID-1236654</RmtId>
</RltdRmtInf>
<RmtInf>
<Ustrd>Inv: AEG-69874/958</Ustrd>
</RmtInf>
<RltdDts>
<IntrBkSttlmDt>2020-09-08</IntrBkSttlmDt>
</RltdDts>
</TxDtls> </TxDtls>
</NtryDtls> </NtryDtls>
</Ntry> </Ntry>
......
...@@ -92,9 +92,6 @@ Change Log ...@@ -92,9 +92,6 @@ Change Log
</Agt> </Agt>
</Cdtr> </Cdtr>
</RltdPties> </RltdPties>
<RltdDts>
<IntrBkSttlmDt>2021-02-23</IntrBkSttlmDt>
</RltdDts>
</TxDtls> </TxDtls>
</NtryDtls> </NtryDtls>
</Ntry> </Ntry>
......
...@@ -76,8 +76,6 @@ Change Log ...@@ -76,8 +76,6 @@ Change Log
<OrgnlIntrBkSttlmAmt Ccy="EUR">1500000</OrgnlIntrBkSttlmAmt> <OrgnlIntrBkSttlmAmt Ccy="EUR">1500000</OrgnlIntrBkSttlmAmt>
<OrgnlIntrBkSttlmDt>2021-02-17</OrgnlIntrBkSttlmDt> <OrgnlIntrBkSttlmDt>2021-02-17</OrgnlIntrBkSttlmDt>
<CxlRsnInf> <CxlRsnInf>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf>
<Orgtr> <Orgtr>
<Nm>A Debiter</Nm> <Nm>A Debiter</Nm>
<PstlAdr> <PstlAdr>
...@@ -89,6 +87,8 @@ Change Log ...@@ -89,6 +87,8 @@ Change Log
<Rsn> <Rsn>
<Cd>AM09</Cd> <Cd>AM09</Cd>
</Rsn> </Rsn>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO,</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf>
</CxlRsnInf> </CxlRsnInf>
</TxInf> </TxInf>
</Undrlyg> </Undrlyg>
......
...@@ -13,10 +13,5 @@ public class Test196 { ...@@ -13,10 +13,5 @@ public class Test196 {
String mtStr = FileUtils.readFileToString(file); String mtStr = FileUtils.readFileToString(file);
String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null); String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null);
System.out.println(mxXml); System.out.println(mxXml);
/*AbstractMT abstractMT = AbstractMT.parse(mtStr);
MT103 mt103 = (MT103)abstractMT;
Field53A field53A = mt103.getField53A();
System.out.println(field53A.getComponent(1) + field53A.getComponent2());
System.out.println(field53A.getBIC());*/
} }
} }
...@@ -13,10 +13,5 @@ public class Test296 { ...@@ -13,10 +13,5 @@ public class Test296 {
String mtStr = FileUtils.readFileToString(file); String mtStr = FileUtils.readFileToString(file);
String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null); String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null);
System.out.println(mxXml); System.out.println(mxXml);
/*AbstractMT abstractMT = AbstractMT.parse(mtStr);
MT103 mt103 = (MT103)abstractMT;
Field53A field53A = mt103.getField53A();
System.out.println(field53A.getComponent(1) + field53A.getComponent2());
System.out.println(field53A.getBIC());*/
} }
} }
package com.brilliance.mt2mx.camt05600108; package com.brilliance.mt2mx.camt056001;
import com.brilliance.swift.mt2mx.Mt2MxCreatorManager; import com.brilliance.swift.mt2mx.Mt2MxCreatorManager;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
...@@ -13,10 +13,5 @@ public class Test192 { ...@@ -13,10 +13,5 @@ public class Test192 {
String mtStr = FileUtils.readFileToString(file); String mtStr = FileUtils.readFileToString(file);
String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null); String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null);
System.out.println(mxXml); System.out.println(mxXml);
/*AbstractMT abstractMT = AbstractMT.parse(mtStr);
MT103 mt103 = (MT103)abstractMT;
Field53A field53A = mt103.getField53A();
System.out.println(field53A.getComponent(1) + field53A.getComponent2());
System.out.println(field53A.getBIC());*/
} }
} }
package com.brilliance.mt2mx.camt05600108; package com.brilliance.mt2mx.camt056001;
import com.brilliance.swift.mt2mx.Mt2MxCreatorManager; import com.brilliance.swift.mt2mx.Mt2MxCreatorManager;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
...@@ -13,10 +13,5 @@ public class Test292 { ...@@ -13,10 +13,5 @@ public class Test292 {
String mtStr = FileUtils.readFileToString(file); String mtStr = FileUtils.readFileToString(file);
String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null); String mxXml = new Mt2MxCreatorManager().mt2mx(mtStr, null, null);
System.out.println(mxXml); System.out.println(mxXml);
/*AbstractMT abstractMT = AbstractMT.parse(mtStr);
MT103 mt103 = (MT103)abstractMT;
Field53A field53A = mt103.getField53A();
System.out.println(field53A.getComponent(1) + field53A.getComponent2());
System.out.println(field53A.getBIC());*/
} }
} }
package com.brilliance.mx2mt.mt192; package com.brilliance.mx2mt.mt192;
import com.brilliance.swift.SwiftTransfer; 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 org.apache.commons.io.FileUtils;
import java.io.File; import java.io.File;
import java.util.List;
public class TestMx2MtFor192 { public class TestMx2MtFor192 {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\Mxcamt05600108_192.xml"); File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05600108_192.xml");
String xmlStr = FileUtils.readFileToString(file); String xmlStr = FileUtils.readFileToString(file);
String mt192 = SwiftTransfer.mx2Mt(xmlStr, null, null); SwiftTranslationReport str = SwiftTransfer.mx2MtPlus(xmlStr, null, null);
System.out.println(mt192); 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