Commit b9ca124a by zhanghou

修改了mt210的异常警告的定义,并且修改了swiftXml文件

parent 6ac276fa
......@@ -25,6 +25,7 @@ public class Field79Generate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags();
String uetr = getXmlNodeValue(bodyHdrParentElementName, document, "Undrlyg.TxInf.OrgnlUETR");
String filed79 = mXToMT79CANC(uetr, "Undrlyg.TxInf.CxlRsnInf");
filed79 = mx_to_mtStartingLineCharacter(filed79, "Block4/:79:");
if (StringUtil.isNotEmpty(filed79)) {
tags.add(new Tag(name_79, filed79));
String dt = "";
......
package com.brilliance.swift.mx2mt.mt210;
import com.brilliance.swift.constants.ERROR;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
......@@ -58,6 +59,12 @@ public class Mx2Mt210Creator extends AbstractMx2MtCreator {
@Override
protected String getMtType() {
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
int count = getXmlNodeCounts(bodyParentPath, document, "Ntfctn.Itm");
if(count>1){
buildSTErrorInfo(ERROR.T20061, null, null);
}
return Mx2MtConstants.MT_TYPE_210;
}
}
......@@ -32,7 +32,7 @@ public class Field30Generate extends AbstractMx2MtTagsGenerate {
mtDate = mXToMTDate(mxDate);
}else {
mtDate = mXToMTDate("991231");
buildSTErrorInfo(ERROR.T20062, "BLOCK4/:20:","");
buildSTErrorInfo(ERROR.T20062, "BLOCK4/:30:","");
}
tags.add(new Tag(name, mtDate));
}
......
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.NumberUtil;
......@@ -25,6 +26,13 @@ public class Field32BGenerate extends AbstractMx2MtTagsGenerate {
String ccy = "";
String amtStr = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Itm("+0+").Amt");
String ccyStr = getXmlNodeValue(bodyHdrParentElementName, document, "Ntfctn.Itm("+0+").Amt@Ccy");
if(amtStr.length()>14){
buildSTErrorInfo(ERROR.T20066, "BLOCK4/:32B:", amtStr);
}
String str = " {XAU, XAG, XPD,XPT}";
if(str.contains(ccyStr)){
buildSTErrorInfo(ERROR.T20054, "BLOCK4/:32B:", amtStr);
}
if (StringUtil.isNotEmpty(amtStr)&&StringUtil.isNotEmpty(ccyStr)) {
amt = NumberUtil.formatAmt(new BigDecimal(amtStr), ccyStr);
ccy = ccyStr;
......
......@@ -42,7 +42,7 @@ Change Log
<CreDtTm>2020-12-15T11:00:00-07:00</CreDtTm>
</GrpHdr>
<Rpt>
<Id>100-01</Id>
<Id>//100-0111111111111111111111111111</Id>
<RptPgntn>
<PgNb>1</PgNb>
<LastPgInd>true</LastPgInd>
......@@ -58,12 +58,12 @@ Change Log
</Acct>
<TxsSummry>
<TtlCdtNtries>
<NbOfNtries>87</NbOfNtries>
<Sum>385700</Sum>
<NbOfNtries>871111111</NbOfNtries>
<!--<Sum>385700</Sum>-->
</TtlCdtNtries>
<TtlDbtNtries>
<NbOfNtries>9</NbOfNtries>
<Sum>210000</Sum>
<NbOfNtries>9111111111</NbOfNtries>
<!--<Sum>210000</Sum>-->
</TtlDbtNtries>
</TxsSummry>
<Ntry>
......@@ -75,7 +75,7 @@ Change Log
<ValDt>
<Dt>2020-12-15</Dt>
</ValDt>
<AcctSvcrRef>ABKREF-125646</AcctSvcrRef>
<AcctSvcrRef>ABKREF-125646111111111111111111111111</AcctSvcrRef>
<BkTxCd>
<Domn>
<Cd>PMNT</Cd>
......
......@@ -78,9 +78,9 @@ Change Log
</Sts>
<CxlDtls>
<TxInfAndSts>
<CxlStsId>CNCL-ID001</CxlStsId>
<CxlStsId>//CNCL-ID00111111111111111</CxlStsId>
<RslvdCase>
<Id>CSE-001</Id>
<Id>//CSE-0011111111111111111111111</Id>
<Cretr>
<Agt>
<FinInstnId>
......@@ -91,7 +91,7 @@ Change Log
</RslvdCase>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlMsgNmId>//pacs.008.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
......
......@@ -56,7 +56,7 @@ Change Log
<Undrlyg>
<TxInf>
<Case>
<Id>CSE-001</Id>
<Id>//CSE-00111111111111111111111111</Id>
<Cretr>
<Agt>
<FinInstnId>
......@@ -67,10 +67,10 @@ Change Log
</Case>
<OrgnlGrpInf>
<OrgnlMsgId>pacs8bizmsgidr01</OrgnlMsgId>
<OrgnlMsgNmId>pacs.008.001.08</OrgnlMsgNmId>
<OrgnlMsgNmId>11pacs.008.001.08</OrgnlMsgNmId>
<OrgnlCreDtTm>2021-02-17T08:30:00+01:00</OrgnlCreDtTm>
</OrgnlGrpInf>
<OrgnlInstrId>pacs8bizmsgidr01</OrgnlInstrId>
<OrgnlInstrId>//pacs8bizmsgidr01</OrgnlInstrId>
<OrgnlEndToEndId>pacs008EndToEndId-001</OrgnlEndToEndId>
<OrgnlUETR>8a562c67-ca16-48ba-b074-65581be6f001</OrgnlUETR>
<OrgnlIntrBkSttlmAmt Ccy="EUR">1500000</OrgnlIntrBkSttlmAmt>
......@@ -87,6 +87,8 @@ Change Log
<Rsn>
<Cd>AM09</Cd>
</Rsn>
<AddtlInf>HELLO,WORLD.HELLO,WORLD.HELLO,WORLD.HELLO</AddtlInf>
<AddtlInf>NICE TO MEET YOU</AddtlInf>
</CxlRsnInf>
</TxInf>
</Undrlyg>
......
......@@ -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>
......@@ -83,11 +83,15 @@ Change Log
</FinInstnId>
</IntrmyAgt>
<Itm>
<Id>NTFCTNITEM01 </Id>
<Id>//NTFCTNITEM019999999999 </Id>
<UETR>761d46fb-3734-4953-a160-afa9d8101212</UETR>
<Amt Ccy="EUR">2000000</Amt>
<XpctdValDt>2020-12-01</XpctdValDt>
<!--<XpctdValDt>2020-12-01</XpctdValDt> -->
</Itm>
<!--<Itm>
<Id>1</Id>
<Amt Ccy="USD">111</Amt>
</Itm>-->
</Ntfctn>
</NtfctnToRcv>
</Document>
......
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