Commit b9ca124a by zhanghou

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

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