Commit d6972d2b by gechengyang

修改camt107/camt108/camt109转mt的部分规则逻辑

parent 9a5dc91e
...@@ -20,9 +20,9 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -20,9 +20,9 @@ public class Field20Generate 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 messageId = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.MsgId"); String messageId = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.MsgId");
if (StringUtil.isEmpty(messageId)) { /* if (StringUtil.isEmpty(messageId)) {
messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr"); messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr");
} }*/
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) { if (messageId.length() > 16) {
buildSTErrorInfo(13, "Block4/:20:", messageId); buildSTErrorInfo(13, "Block4/:20:", messageId);
......
...@@ -33,10 +33,10 @@ public class Field32aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -33,10 +33,10 @@ public class Field32aGenerate extends AbstractMx2MtTagsGenerate {
String cheValDtValue = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.ValDt.Dt"); String cheValDtValue = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.ValDt.Dt");
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt"); String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt@Ccy"); String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt@Ccy");
if ("XAU".equalsIgnoreCase(ccy) || "XAG".equalsIgnoreCase(ccy) /* if ("XAU".equalsIgnoreCase(ccy) || "XAG".equalsIgnoreCase(ccy)
|| "XPD".equalsIgnoreCase(ccy) || "XPT".equalsIgnoreCase(ccy)) { || "XPD".equalsIgnoreCase(ccy) || "XPT".equalsIgnoreCase(ccy)) {
buildSTErrorInfo(63, bodyHdrParentElementName+".Chq.Amt", ccy); buildSTErrorInfo(63, bodyHdrParentElementName+".Chq.Amt", ccy);
} }*/
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) { if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
cheAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy); cheAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
cheAmtCcy = ccy; cheAmtCcy = ccy;
......
...@@ -24,14 +24,14 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -24,14 +24,14 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate {
List<Tag> tags = swiftMessage.getBlock4().getTags(); List<Tag> tags = swiftMessage.getBlock4().getTags();
int cheDrwrAgt = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.DrwrAgt"); int cheDrwrAgt = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.DrwrAgt");
int cheDrwrAgtAcct = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.DrwrAgtAcct"); int cheDrwrAgtAcct = getXmlNodeCounts(bodyHdrParentElementName, document, "Chq.DrwrAgtAcct");
String account = ""; // String account = "";
if (cheDrwrAgt > 0 || cheDrwrAgtAcct > 0) { if (cheDrwrAgt > 0 || cheDrwrAgtAcct > 0) {
String cheDrwrAgtPath = bodyHdrParentElementName + ".Chq.DrwrAgt"; String cheDrwrAgtPath = bodyHdrParentElementName + ".Chq.DrwrAgt";
String cheDrwrAgtAcctPath = bodyHdrParentElementName + ".Chq.DrwrAgtAcct"; String cheDrwrAgtAcctPath = bodyHdrParentElementName + ".Chq.DrwrAgtAcct";
if (cheDrwrAgt == 0 ) { /* if (cheDrwrAgt == 0 ) {
account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.DrwrAgtAcct"); account = mx_to_mtAccount(bodyHdrParentElementName + ".Chq.DrwrAgtAcct");
// tags.add(new Tag(name_52B, account)); // tags.add(new Tag(name_52B, account));
} else { } else {*/
Tag tag = mx_to_mtAgentGeneric(name, cheDrwrAgtPath, cheDrwrAgtAcctPath, true, false, false, null); Tag tag = mx_to_mtAgentGeneric(name, cheDrwrAgtPath, cheDrwrAgtAcctPath, true, false, false, null);
if (tag != null) { if (tag != null) {
if (name_52D.equals(tag.getName())) { if (name_52D.equals(tag.getName())) {
...@@ -40,7 +40,7 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -40,7 +40,7 @@ public class Field52aGenerate extends AbstractMx2MtTagsGenerate {
} }
tags.add(tag); tags.add(tag);
} }
} //}
} }
} }
} }
...@@ -21,9 +21,9 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -21,9 +21,9 @@ public class Field20Generate 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 messageId = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.MsgId"); String messageId = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.MsgId");
if (StringUtil.isEmpty(messageId)) { /* if (StringUtil.isEmpty(messageId)) {
messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr"); messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr");
} }*/
if (StringUtil.isNotEmpty(messageId)) { if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) { if (messageId.length() > 16) {
buildSTErrorInfo(13, "Block4/:20:", messageId); buildSTErrorInfo(13, "Block4/:20:", messageId);
......
...@@ -33,10 +33,10 @@ public class Field32aGenerate extends AbstractMx2MtTagsGenerate { ...@@ -33,10 +33,10 @@ public class Field32aGenerate extends AbstractMx2MtTagsGenerate {
String cheValDtValue = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.FctvDt.Dt"); String cheValDtValue = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.FctvDt.Dt");
String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt"); String amt = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt");
String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt@Ccy"); String ccy = getXmlNodeValue(bodyHdrParentElementName, document, "Chq.Amt@Ccy");
if ("XAU".equalsIgnoreCase(ccy) || "XAG".equalsIgnoreCase(ccy) /* if ("XAU".equalsIgnoreCase(ccy) || "XAG".equalsIgnoreCase(ccy)
|| "XPD".equalsIgnoreCase(ccy) || "XPT".equalsIgnoreCase(ccy)) { || "XPD".equalsIgnoreCase(ccy) || "XPT".equalsIgnoreCase(ccy)) {
buildSTErrorInfo(63, bodyHdrParentElementName+".Chq.Amt", ccy); buildSTErrorInfo(63, bodyHdrParentElementName+".Chq.Amt", ccy);
} }*/
if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) { if (StringUtil.isNotEmpty(amt) && StringUtil.isNotEmpty(ccy)) {
cheAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy); cheAmt = NumberUtil.formatAmt(new BigDecimal(amt), ccy);
cheAmtCcy = ccy; cheAmtCcy = ccy;
......
...@@ -17,9 +17,9 @@ public class Field20Generate extends AbstractMx2MtTagsGenerate { ...@@ -17,9 +17,9 @@ public class Field20Generate 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 messageId = getXmlNodeValue(grpHdrParentElementName,document,"GrpHdr.MsgId"); String messageId = getXmlNodeValue(grpHdrParentElementName,document,"GrpHdr.MsgId");
if ( StringUtil.isEmpty(messageId) ) { /* if ( StringUtil.isEmpty(messageId) ) {
messageId = getXmlNodeValue(appHdrParentElementName,document,"AppHdr.BizMsgIdr"); messageId = getXmlNodeValue(appHdrParentElementName,document,"AppHdr.BizMsgIdr");
} }*/
if ( StringUtil.isNotEmpty(messageId) ) { if ( StringUtil.isNotEmpty(messageId) ) {
if ( messageId.length() > 16 ) { if ( messageId.length() > 16 ) {
buildSTErrorInfo(13,"Block4/:20:",messageId); buildSTErrorInfo(13,"Block4/:20:",messageId);
......
...@@ -20,8 +20,8 @@ public class Field76Generate extends AbstractMx2MtTagsGenerate { ...@@ -20,8 +20,8 @@ public class Field76Generate 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();
Map<String,String > map =new Hashtable<>(); Map<String,String > map =new Hashtable<>();
map.put("ACCP","Accepted"); map.put("ACCR","Accepted");
map.put("REJT","Rejected"); map.put("RJCR","Rejected");
String mxStatusCode = getXmlNodeValue(bodyHdrParentElementName,document,"Chq.ChqCxlOrStopSts.Sts.Cd"); String mxStatusCode = getXmlNodeValue(bodyHdrParentElementName,document,"Chq.ChqCxlOrStopSts.Sts.Cd");
String mxStatusDes = ""; String mxStatusDes = "";
String mxAddInfo = getXmlNodeValue(bodyHdrParentElementName,document,"Chq.ChqCxlOrStopSts.AddtlInf"); String mxAddInfo = getXmlNodeValue(bodyHdrParentElementName,document,"Chq.ChqCxlOrStopSts.AddtlInf");
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<RequestPayload> <RequestPayload>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02"> <AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<Fr> <Fr>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>HELSFIHHXXX</BICFI> <BICFI>HELSFIHHXXX</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</Fr> </Fr>
<To> <To>
<FIId> <FIId>
<FinInstnId> <FinInstnId>
<BICFI>NDEAFIHHXXX</BICFI> <BICFI>NDEAFIHHXXX</BICFI>
</FinInstnId> </FinInstnId>
</FIId> </FIId>
</To> </To>
<BizMsgIdr>CNCL-ID001</BizMsgIdr> <BizMsgIdr>CNCL-ID001</BizMsgIdr>
<MsgDefIdr>camt.108.001.01</MsgDefIdr> <MsgDefIdr>camt.108.001.01</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc> <BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2022-07-22T10:17:51.619+08:00</CreDt> <CreDt>2022-07-22T10:17:51.619+08:00</CreDt>
<PssblDplct>false</PssblDplct> <PssblDplct>false</PssblDplct>
<Prty>NORM</Prty> <Prty>NORM</Prty>
</AppHdr> </AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.108.001.01"> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.108.001.01">
<ChqCxlOrStopReq> <ChqCxlOrStopReq>
<GrpHdr> <GrpHdr>
<MsgId>CSE-001</MsgId> <MsgId>CSE-001</MsgId>
<CreDtTm>2022-07-22</CreDtTm> <CreDtTm>2021-04-09T09:00:00+02:00</CreDtTm>
<NbOfChqs>1</NbOfChqs> <NbOfChqs>1</NbOfChqs>
</GrpHdr> </GrpHdr>
<Chq> <Chq>
<OrgnlInstrId>AAAAAAA</OrgnlInstrId> <OrgnlInstrId>AAAAAAA</OrgnlInstrId><!--21-->
<!--21--> <ChqNb>BBBBB</ChqNb><!--30-->
<ChqNb>BBBBB</ChqNb> <IsseDt>2022-09-22</IsseDt><!--32B-->
<!--30--> <Amt Ccy="USD">123131</Amt><!--32A-->
<IsseDt>2022-09-22</IsseDt> <FctvDt>
<!--32B--> <Dt>2022-10-22</Dt>
<Amt Ccy="USD">123131</Amt> </FctvDt><!--52D--><!-- <DrwrAgt>--><!-- <FinInstnId>QWERTYOII</FinInstnId>--><!-- </DrwrAgt>--><!--52B-->
<!--32A--> <DrwrAgtAcct>
<FctvDt> <Id>
<Dt>2022-10-22</Dt> <IBAN>AB1234567890</IBAN>
</FctvDt> </Id>
<!--52D--> </DrwrAgtAcct><!--59-->
<!-- <DrwrAgt>--> <Pyee>
<!-- <FinInstnId>QWERTYOII</FinInstnId>--> <Nm>TTTT</Nm>
<!-- </DrwrAgt>--> <PstlAdr>
<!--52B--> <AdrLine>PPPPPPPP</AdrLine>
<DrwrAgtAcct> </PstlAdr>
<Id> </Pyee>
<IBAN>OBHHIO</IBAN> <ChqCxlOrStopRsn><!--75-->
</Id> <Rsn>
</DrwrAgtAcct> <Cd>NARR</Cd>
<!--59--> </Rsn>
<Pyee> <AddtlInf>REWQ123454579789870olikuytrewsadfghjREWQ123454579789870olikuytrewsadfghjREWQ123454579789870olikuytrewsadfghj</AddtlInf>
<Nm>TTTT</Nm> </ChqCxlOrStopRsn>
<PstlAdr> </Chq>
<AdrLine>PPPPPPPP</AdrLine> </ChqCxlOrStopReq>
</PstlAdr> </Document>
</Pyee>
<ChqCxlOrStopRsn>
<!--75-->
<Rsn>
<Cd>NARR</Cd>
</Rsn>
<AddtlInf>REWQ</AddtlInf>
</ChqCxlOrStopRsn>
</Chq>
</ChqCxlOrStopReq>
</Document>
</RequestPayload> </RequestPayload>
\ No newline at end of file
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
</DrwrAgtAcct> </DrwrAgtAcct>
<ChqCxlOrStopSts> <ChqCxlOrStopSts>
<Sts> <Sts>
<Cd>ACCP</Cd> <Cd>ACCR</Cd>
</Sts> </Sts>
<AddtlInf>ABC</AddtlInf> <AddtlInf>REWQ123454579789870olikuytrewsadfghjREWQ123454579789870olikuytrewsadfghjREWQ123454579789870olikuytrewsadfghj</AddtlInf>
</ChqCxlOrStopSts> </ChqCxlOrStopSts>
</Chq> </Chq>
</ChqCxlOrStopRpt> </ChqCxlOrStopRpt>
......
...@@ -29,11 +29,11 @@ Other product, service, or company names in this publication are trade names, tr ...@@ -29,11 +29,11 @@ Other product, service, or company names in this publication are trade names, tr
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Group: Cross Border Payments and Reporting Plus (CBPR+) Group: Cross Border Payments and Reporting Plus (CBPR+)
Collection: CBPRPlus_ISO 20022_Portfolio_Release 2023 Collection: CBPRPlus_SR2024
Usage Guideline: CBPRPlus-camt.109.001.01_ChequeCancellationOrStopReport Usage Guideline: CBPRPlus-camt.109.001.01_ChequeCancellationOrStopReport
Base Message: camt.109.001.01 Base Message: camt.109.001.01
Date of publication: 16 December 2022 Date of publication: 19 March 2024
URL: https://www2.swift.com/mystandards/#/mp/mx/_UQsRECZ9EeyFELcOlo2Q4w/_J873YCZ_EeyFELcOlo2Q4w URL: https://www2.swift.com/mystandards/#/mp/mx/_Hzd-0L2ZEe2VOtHXeCwa3Q/_TdEwQW5TEe6ijo6mcWmUwQ
Description: Principles: Description: Principles:
1A) AGENTS IDENTIFICATION - Textual Rules 1A) AGENTS IDENTIFICATION - Textual Rules
...@@ -59,7 +59,7 @@ All Name and Address for all actors, Related Remittance Information and Remittan ...@@ -59,7 +59,7 @@ All Name and Address for all actors, Related Remittance Information and Remittan
< is replaced with &lt; < is replaced with &lt;
> is replaced with &gt; > is replaced with &gt;
Generated by the MyStandards web platform [https://www.swift.com/mystandards] on 2023-06-20T04:02:36+00:00 Generated by the MyStandards web platform [https://www.swift.com/mystandards] on 2024-03-21T05:19:47+00:00
--> -->
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:camt.109.001.01" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:camt.109.001.01"> <xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:camt.109.001.01" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:camt.109.001.01">
<xs:element name="Document" type="Document"/> <xs:element name="Document" type="Document"/>
...@@ -116,8 +116,8 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on ...@@ -116,8 +116,8 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on
</xs:complexType> </xs:complexType>
<xs:simpleType name="CBPR_ChequeCancellationOrStopStatusCode"> <xs:simpleType name="CBPR_ChequeCancellationOrStopStatusCode">
<xs:restriction base="xs:string"> <xs:restriction base="xs:string">
<xs:enumeration value="REJT"/> <xs:enumeration value="RJCR"/>
<xs:enumeration value="ACCP"/> <xs:enumeration value="ACCR"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:simpleType name="CBPR_DateTime"> <xs:simpleType name="CBPR_DateTime">
...@@ -127,7 +127,7 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on ...@@ -127,7 +127,7 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on
</xs:simpleType> </xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax140Text"> <xs:simpleType name="CBPR_RestrictedFINXMax140Text">
<xs:restriction base="xs:string"> <xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+"/> <xs:pattern value="([0-9a-zA-Z\-\?:\(\)\.,'\+ ]([0-9a-zA-Z\-\?:\(\)\.,'\+ ]*(/[0-9a-zA-Z\-\?:\(\)\.,'\+ ])?)*)"/>
<xs:minLength value="1"/> <xs:minLength value="1"/>
<xs:maxLength value="140"/> <xs:maxLength value="140"/>
</xs:restriction> </xs:restriction>
...@@ -279,11 +279,11 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on ...@@ -279,11 +279,11 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on
<xs:element name="Dt" type="ISODate"/> <xs:element name="Dt" type="ISODate"/>
</xs:choice> </xs:choice>
</xs:complexType> </xs:complexType>
<xs:complexType name="DateAndPlaceOfBirth1"> <xs:complexType name="DateAndPlaceOfBirth1__1">
<xs:sequence> <xs:sequence>
<xs:element name="BirthDt" type="ISODate"/> <xs:element name="BirthDt" type="ISODate"/>
<xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/> <xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element name="CityOfBirth" type="Max35Text"/> <xs:element name="CityOfBirth" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element name="CtryOfBirth" type="CountryCode"/> <xs:element name="CtryOfBirth" type="CountryCode"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
...@@ -390,12 +390,6 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on ...@@ -390,12 +390,6 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on
<xs:pattern value="[0-9]{1,15}"/> <xs:pattern value="[0-9]{1,15}"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:simpleType name="Max35Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="OrganisationIdentification29__1"> <xs:complexType name="OrganisationIdentification29__1">
<xs:sequence> <xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="AnyBIC" type="AnyBICDec2014Identifier"/> <xs:element maxOccurs="1" minOccurs="0" name="AnyBIC" type="AnyBICDec2014Identifier"/>
...@@ -418,14 +412,14 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on ...@@ -418,14 +412,14 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on
<xs:complexType name="PartyIdentification135__1"> <xs:complexType name="PartyIdentification135__1">
<xs:sequence> <xs:sequence>
<xs:element name="Nm" type="CBPR_RestrictedFINXMax140Text_Extended"/> <xs:element name="Nm" type="CBPR_RestrictedFINXMax140Text_Extended"/>
<xs:element name="PstlAdr" type="PostalAddress24__2"/> <xs:element name="PstlAdr" type="PostalAddress24__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party38Choice__1"/> <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party38Choice__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/> <xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
<xs:complexType name="PersonIdentification13__1"> <xs:complexType name="PersonIdentification13__1">
<xs:sequence> <xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth1"/> <xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth1__1"/>
<xs:element maxOccurs="2" minOccurs="0" name="Othr" type="GenericPersonIdentification1__1"/> <xs:element maxOccurs="2" minOccurs="0" name="Othr" type="GenericPersonIdentification1__1"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
...@@ -454,25 +448,6 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on ...@@ -454,25 +448,6 @@ Generated by the MyStandards web platform [https://www.swift.com/mystandards] on
<xs:element maxOccurs="3" minOccurs="0" name="AdrLine" type="CBPR_RestrictedFINXMax35Text_Extended"/> <xs:element maxOccurs="3" minOccurs="0" name="AdrLine" type="CBPR_RestrictedFINXMax35Text_Extended"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
<xs:complexType name="PostalAddress24__2">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Dept" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="CBPR_RestrictedFINXMax16Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="BldgNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="Flr" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="PstBx" type="CBPR_RestrictedFINXMax16Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="Room" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="CBPR_RestrictedFINXMax16Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="TwnLctnNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="DstrctNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
<xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="CBPR_RestrictedFINXMax35Text_Extended"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProxyAccountIdentification1__1"> <xs:complexType name="ProxyAccountIdentification1__1">
<xs:sequence> <xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ProxyAccountType1Choice__1"/> <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ProxyAccountType1Choice__1"/>
......
...@@ -7,6 +7,7 @@ import org.junit.Test; ...@@ -7,6 +7,7 @@ import org.junit.Test;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.Map;
public class Mx2ElementTest { public class Mx2ElementTest {
...@@ -44,7 +45,9 @@ public class Mx2ElementTest { ...@@ -44,7 +45,9 @@ public class Mx2ElementTest {
File file = new File(Mx2MessageTest.class.getResource("/swiftXml/camt11000101.xml").toURI().getPath()); File file = new File(Mx2MessageTest.class.getResource("/swiftXml/camt11000101.xml").toURI().getPath());
String xml = new String(Files.readAllBytes(file.toPath())); String xml = new String(Files.readAllBytes(file.toPath()));
String elementStr = SwiftTransfer.mx2Element(xml); String elementStr = SwiftTransfer.mx2Element(xml);
Map<String, Object> stringObjectMap = SwiftTransfer.mx2ElementMaps(xml);
System.out.println(elementStr); System.out.println(elementStr);
System.out.println("stringObjectMap="+stringObjectMap);
} }
@Test @Test
......
...@@ -301,8 +301,8 @@ public class Mx2MtTest { ...@@ -301,8 +301,8 @@ public class Mx2MtTest {
@Test @Test
public void testMx2MtMap() throws IOException { public void testMx2MtMap() throws IOException {
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108_COV.xml")); //File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108_COV.xml"));
File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/iso_ack.xml")); // File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/iso_ack.xml"));
// File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/camt10900101.xml")); File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/camt10900101.xml"));
String xmlStr = FileUtils.readFileToString(file); String xmlStr = FileUtils.readFileToString(file);
Map<String, String> maps = SwiftTransfer.mx2MtMap(xmlStr, null); Map<String, String> maps = SwiftTransfer.mx2MtMap(xmlStr, null);
for (String key : maps.keySet()) { for (String key : maps.keySet()) {
......
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