Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftMtMx
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
isc-v3.1-tmp
swiftMtMx
Commits
d88760d6
Commit
d88760d6
authored
Jul 08, 2022
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成mt942中文的报文要素展示
parent
2a458576
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
367 additions
and
38 deletions
+367
-38
Mx2MapCreatorManager.java
...ava/com/brilliance/swift/mx2map/Mx2MapCreatorManager.java
+8
-0
Mx2MapCamt029Creator.java
...brilliance/swift/mx2map/camt029/Mx2MapCamt029Creator.java
+6
-6
Mx2MapCamt052Creator.java
...brilliance/swift/mx2map/camt052/Mx2MapCamt052Creator.java
+121
-0
Mx2MapCamt056Creator.java
...brilliance/swift/mx2map/camt056/Mx2MapCamt056Creator.java
+6
-6
Mx2MapCamt057Creator.java
...brilliance/swift/mx2map/camt057/Mx2MapCamt057Creator.java
+135
-21
Messages_CN.properties
swiftCore/src/main/resources/Messages_CN.properties
+18
-0
MXcamt05200108_942.xml
swiftCore/src/main/resources/swiftXml/MXcamt05200108_942.xml
+5
-5
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt192/Test.java
+17
-0
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt196/Test.java
+17
-0
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt210/Test.java
+17
-0
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt942/Test.java
+17
-0
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2map/Mx2MapCreatorManager.java
View file @
d88760d6
...
@@ -2,8 +2,10 @@ package com.brilliance.swift.mx2map;
...
@@ -2,8 +2,10 @@ package com.brilliance.swift.mx2map;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2map.camt029.Mx2MapCamt029Creator
;
import
com.brilliance.swift.mx2map.camt029.Mx2MapCamt029Creator
;
import
com.brilliance.swift.mx2map.camt052.Mx2MapCamt052Creator
;
import
com.brilliance.swift.mx2map.camt053.Mx2MapCamt053Creator
;
import
com.brilliance.swift.mx2map.camt053.Mx2MapCamt053Creator
;
import
com.brilliance.swift.mx2map.camt056.Mx2MapCamt056Creator
;
import
com.brilliance.swift.mx2map.camt056.Mx2MapCamt056Creator
;
import
com.brilliance.swift.mx2map.camt057.Mx2MapCamt057Creator
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -33,6 +35,12 @@ public class Mx2MapCreatorManager {
...
@@ -33,6 +35,12 @@ public class Mx2MapCreatorManager {
} else if("camt.056.001".equals(messageType)) {
} else if("camt.056.001".equals(messageType)) {
return new Mx2MapCamt056Creator();
return new Mx2MapCamt056Creator();
}*/
}*/
/*else if("camt.052.001".equals(messageType)){
return new Mx2MapCamt052Creator();
}*/
/*else if("camt.057.001".equals(messageType)){
return new Mx2MapCamt057Creator();
}*/
else
{
else
{
return
new
DefaultMx2MapCreator
();
return
new
DefaultMx2MapCreator
();
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/camt029/Mx2MapCamt029Creator.java
View file @
d88760d6
...
@@ -37,13 +37,13 @@ public class Mx2MapCamt029Creator extends AbstractMx2MapCreator {
...
@@ -37,13 +37,13 @@ public class Mx2MapCamt029Creator extends AbstractMx2MapCreator {
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
String
cxlSts
Id
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.CxlStsId"
);
String
message
Id
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.CxlStsId"
);
if
(
StringUtil
.
isNotEmpty
(
cxlSts
Id
)){
if
(
StringUtil
.
isNotEmpty
(
message
Id
)){
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"message.id"
),
cxlSts
Id
);
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"message.id"
),
message
Id
);
}
}
String
case
Id
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.RslvdCase.Id"
);
String
endToEnd
Id
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.RslvdCase.Id"
);
if
(
StringUtil
.
isNotEmpty
(
case
Id
)){
if
(
StringUtil
.
isNotEmpty
(
endToEnd
Id
)){
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
case
Id
);
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
endToEnd
Id
);
}
}
String
nameId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
String
nameId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlMsgNmId"
);
String
dateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"
);
String
dateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/camt052/Mx2MapCamt052Creator.java
0 → 100644
View file @
d88760d6
package
com
.
brilliance
.
swift
.
mx2map
.
camt052
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2map.AbstractMx2MapCreator
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.vo.common.CdtDbtCode
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentHelper
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.util.Map
;
public
class
Mx2MapCamt052Creator
extends
AbstractMx2MapCreator
{
@Override
public
Map
<
String
,
String
>
mx2Map
()
throws
SwiftException
{
try
{
Document
document
=
DocumentHelper
.
parseText
(
xmlStr
);
Map
<
String
,
String
>
parentElementMaps
=
XmlUtil
.
getParentElementMaps
(
document
);
String
appHdrParentElementName
=
parentElementMaps
.
get
(
"AppHdr"
);
String
grpHdrParentElementName
=
parentElementMaps
.
get
(
"GrpHdr"
);
String
bodyParentElementName
=
parentElementMaps
.
get
(
"Rpt"
);
String
sendBic
=
abstractMX
.
getAppHdr
().
from
();
maps
.
put
(
getPropertyValue
(
"app.header.sendBic"
),
sendBic
);
String
receiverBic
=
abstractMX
.
getAppHdr
().
to
();
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
receiverBic
);
String
msgDefId
=
abstractMX
.
getAppHdr
().
messageName
();
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
msgDefId
);
String
bizSvc
=
abstractMX
.
getAppHdr
().
serviceName
();
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
String
messageId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Id"
);
if
(
StringUtil
.
isNotEmpty
(
messageId
)){
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"message.id"
),
messageId
);
}
String
iban
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Acct.Id.IBAN"
);
String
acctId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Acct.Id.Othr.Id"
);
String
account
=
StringUtil
.
isNotEmpty
(
iban
)
?
iban
:
acctId
;
if
(
StringUtil
.
isNotEmpty
(
account
))
{
maps
.
put
(
getPropertyValue
(
"statement.account"
),
account
);
}
String
elctrncSeqNb
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.LglSeqNb"
);
if
(
StringUtil
.
isEmpty
(
elctrncSeqNb
)
||
elctrncSeqNb
.
length
()
>
5
)
{
elctrncSeqNb
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.ElctrncSeqNb"
);
}
if
(
StringUtil
.
isNotEmpty
(
elctrncSeqNb
))
{
maps
.
put
(
getPropertyValue
(
"statement.sequence.number"
),
elctrncSeqNb
);
}
String
pageNumber
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.RptPgntn.PgNb"
);
if
(
StringUtil
.
isNotEmpty
(
pageNumber
)){
maps
.
put
(
getPropertyValue
(
"statement.page.number"
),
pageNumber
);
}
String
amount
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Acct.Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
amount
)){
maps
.
put
(
getPropertyValue
(
"report.account.currency"
),
amount
+
"0"
);
}
String
dateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.CreDtTm"
);
if
(
StringUtil
.
isEmpty
(
dateStr
)){
dateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".GrpHdr.CreDtTm"
);
}
if
(
StringUtil
.
isEmpty
(
dateStr
)){
maps
.
put
(
getPropertyValue
(
"report.creDtTm"
),
dateStr
);
}
int
entryCount
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
".Rpt.Ntry"
,
null
);
if
(
entryCount
>
0
)
{
for
(
int
i
=
0
;
i
<
entryCount
;
i
++)
{
String
reversalIndicator
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Ntry("
+
i
+
").RvslInd"
);
String
creditDebitIndicator
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Ntry("
+
i
+
").CdtDbtInd"
);
if
(
StringUtil
.
isNotEmpty
(
reversalIndicator
)
&&
Boolean
.
valueOf
(
reversalIndicator
))
{
if
(
CdtDbtCode
.
DBIT
.
value
().
equals
(
creditDebitIndicator
))
{
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"statement.entry.crdr"
)+
"("
+(
i
+
1
)+
")"
,
getPropertyValue
(
"reversal.credit"
));
}
else
{
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"statement.entry.crdr"
)+
"("
+(
i
+
1
)+
")"
,
getPropertyValue
(
"reversal.debit"
));
}
}
else
{
if
(
CdtDbtCode
.
DBIT
.
value
().
equals
(
creditDebitIndicator
))
{
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"statement.entry.crdr"
)+
"("
+(
i
+
1
)+
")"
,
getPropertyValue
(
"debit"
));
}
else
{
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"statement.entry.crdr"
)+
"("
+(
i
+
1
)+
")"
,
getPropertyValue
(
"credit"
));
}
}
String
valueDateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Ntry("
+
i
+
").ValDt.Dt"
);
if
(
StringUtil
.
isNotEmpty
(
valueDateStr
))
{
maps
.
put
(
getPropertyValue
(
"statement.entry.valueDate"
)+
"("
+(
i
+
1
)+
")"
,
valueDateStr
);
}
String
amt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Ntry("
+
i
+
").Amt"
);
String
ccy
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Ntry("
+
i
+
").Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
ccy
))
{
maps
.
put
(
getPropertyValue
(
"statement.entry.ccy"
)+
"("
+(
i
+
1
)+
")"
,
ccy
);
}
if
(
StringUtil
.
isNotEmpty
(
amt
))
{
maps
.
put
(
getPropertyValue
(
"statement.entry.amt"
)+
"("
+(
i
+
1
)+
")"
,
amt
);
}
String
endToEndId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.Ntry("
+
i
+
").NtryDtls.TxDtls.Refs.EndToEndId"
);
if
(
StringUtil
.
isNotEmpty
(
endToEndId
))
{
maps
.
put
(
getPropertyValue
(
"statement.entry.endToEndId"
)+
"("
+(
i
+
1
)+
")"
,
endToEndId
);
}
String
sumc
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.TxsSummry.TtlCdtNtries.Sum"
);
String
nbOfNtriesc
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.TxsSummry.TtlCdtNtries.NbOfNtries"
);
if
(
StringUtil
.
isNotEmpty
(
sumc
)&&
StringUtil
.
isNotEmpty
(
nbOfNtriesc
)){
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"report.transactionsSummary.totalCreditEntries.nbOfNtries"
),
nbOfNtriesc
);
maps
.
put
(
getPropertyValue
(
"report.transactionsSummary.totalCreditEntries.sum"
),
sumc
);
}
String
sumd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.TxsSummry.TtlDbtNtries.Sum"
);
String
nbOfNtriesd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Rpt.TxsSummry.TtlDbtNtries.NbOfNtries"
);
if
(
StringUtil
.
isNotEmpty
(
sumd
)&&
StringUtil
.
isNotEmpty
(
nbOfNtriesd
)){
maps
.
put
(
getPropertyValue
(
"report.transactionsSummary.totalDebitEntries.nbOfNtries"
),
nbOfNtriesd
);
maps
.
put
(
getPropertyValue
(
"report.transactionsSummary.totalDebitEntries.sum"
),
sumd
);
}
}
}
}
catch
(
DocumentException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
return
maps
;
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2map/camt056/Mx2MapCamt056Creator.java
View file @
d88760d6
...
@@ -35,13 +35,13 @@ public class Mx2MapCamt056Creator extends AbstractMx2MapCreator {
...
@@ -35,13 +35,13 @@ public class Mx2MapCamt056Creator extends AbstractMx2MapCreator {
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
String
cas
eId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Undrlyg.TxInf.Case.Id"
);
String
messag
eId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Undrlyg.TxInf.Case.Id"
);
if
(
StringUtil
.
isNotEmpty
(
cas
eId
)){
if
(
StringUtil
.
isNotEmpty
(
messag
eId
)){
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"message.id"
),
cas
eId
);
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"message.id"
),
messag
eId
);
}
}
String
i
d
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Undrlyg.TxInf.OrgnlInstrId"
);
String
endToEndI
d
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Undrlyg.TxInf.OrgnlInstrId"
);
if
(
StringUtil
.
isNotEmpty
(
i
d
)){
if
(
StringUtil
.
isNotEmpty
(
endToEndI
d
)){
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
i
d
);
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
endToEndI
d
);
}
}
String
nameId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"
);
String
nameId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Undrlyg.TxInf.OrgnlGrpInf.OrgnlMsgNmId"
);
String
dateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"
);
String
dateStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".CxlDtls.TxInfAndSts.OrgnlGrpInf.OrgnlCreDtTm"
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/camt057/Mx2MapCamt057Creator.java
View file @
d88760d6
package
com
.
brilliance
.
swift
.
mx2map
.
camt057
;
package
com
.
brilliance
.
swift
.
mx2map
.
camt057
;
import
com.alibaba.fastjson.JSONArray
;
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.mx2map.AbstractMx2MapCreator
;
import
com.brilliance.swift.mx2map.AbstractMx2MapCreator
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.dom4j.Document
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentHelper
;
import
org.dom4j.DocumentHelper
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
public
class
Mx2MapCamt057Creator
extends
AbstractMx2MapCreator
{
public
class
Mx2MapCamt057Creator
extends
AbstractMx2MapCreator
{
...
@@ -25,14 +28,16 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
...
@@ -25,14 +28,16 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
maps
.
put
(
getPropertyValue
(
"app.header.sendBic"
),
sendBic
);
maps
.
put
(
getPropertyValue
(
"app.header.sendBic"
),
sendBic
);
String
receiverBic
=
abstractMX
.
getAppHdr
().
to
();
String
receiverBic
=
abstractMX
.
getAppHdr
().
to
();
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
receiverBic
);
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
receiverBic
);
String
bizMsgId
=
abstractMX
.
getAppHdr
().
reference
();
maps
.
put
(
getPropertyValue
(
"app.header.bizMsgId"
),
bizMsgId
);
String
msgDefId
=
abstractMX
.
getAppHdr
().
messageName
();
String
msgDefId
=
abstractMX
.
getAppHdr
().
messageName
();
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
msgDefId
);
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
msgDefId
);
String
bizSvc
=
abstractMX
.
getAppHdr
().
serviceName
();
String
bizSvc
=
abstractMX
.
getAppHdr
().
serviceName
();
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
bizSvc
);
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
XMLGregorianCalendar
creDt
=
abstractMX
.
getAppHdr
().
creationDate
();
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
creDt
.
toXMLFormat
());
String
messageId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".GrpHdr.MsgId"
);
if
(
StringUtil
.
isNotEmpty
(
messageId
)){
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"message.id"
),
messageId
);
}
String
accountId
=
""
;
String
accountId
=
""
;
String
iban
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Acct.Id.IBAN"
);
String
iban
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Acct.Id.IBAN"
);
String
id
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Acct.Id.Othr.Id"
);
String
id
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Acct.Id.Othr.Id"
);
...
@@ -52,15 +57,22 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
...
@@ -52,15 +57,22 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
if
(
StringUtil
.
isNotEmpty
(
accountId
)){
if
(
StringUtil
.
isNotEmpty
(
accountId
)){
maps
.
put
(
getPropertyValue
(
"notification.account.id"
),
accountId
);
maps
.
put
(
getPropertyValue
(
"notification.account.id"
),
accountId
);
}
}
String
reference
=
""
;
String
valDtStr
=
""
;
String
endToEndId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").EndToEndId
"
);
String
valDt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.XpctdValDt
"
);
if
(
StringUtil
.
isNotEmpty
(
endToEndId
)){
if
(
StringUtil
.
isNotEmpty
(
valDt
)){
reference
=
endToEndId
;
valDtStr
=
valDt
;
}
else
{
}
else
{
reference
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").Id
"
);
valDtStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").XpctdValDt
"
);
}
}
if
(
StringUtil
.
isNotEmpty
(
reference
)){
if
(
StringUtil
.
isNotEmpty
(
valDtStr
)){
maps
.
put
(
getPropertyValue
(
"notification.item.reference"
),
reference
);
maps
.
put
(
getPropertyValue
(
"notification.xpctdValDt"
),
valDtStr
);
}
String
endToEndId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").EndToEndId"
);
if
(
StringUtil
.
isEmpty
(
endToEndId
)){
endToEndId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").Id"
);
}
if
(
StringUtil
.
isNotEmpty
(
endToEndId
)){
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"endToEnd.id"
),
endToEndId
);
}
}
String
ccy
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").Amt@Ccy"
);
String
ccy
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
ccy
))
{
if
(
StringUtil
.
isNotEmpty
(
ccy
))
{
...
@@ -70,21 +82,51 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
...
@@ -70,21 +82,51 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
if
(
StringUtil
.
isNotEmpty
(
amt
))
{
if
(
StringUtil
.
isNotEmpty
(
amt
))
{
maps
.
put
(
getPropertyValue
(
"notification.amount.amt"
),
amt
);
maps
.
put
(
getPropertyValue
(
"notification.amount.amt"
),
amt
);
}
}
String
valDtStr
=
""
;
String
partyPath1
=
".Ntfctn.Dbtr.Pty"
;
String
valDt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.XpctdValDt"
);
String
partyPath2
=
".Ntfctn.Itm("
+
0
+
").Dbtr.Pty"
;
if
(
StringUtil
.
isNotEmpty
(
valDt
)){
String
agentPath1
=
".Ntfctn.Dbtr.Agt"
;
valDtStr
=
valDt
;
String
agentPath2
=
".Ntfctn.Itm("
+
0
+
").Dbtr.Agt"
;
}
else
{
Map
<
String
,
String
>
partyMessage1
=
getPartyAndAgentAndAccountMessage
(
document
,
bodyParentElementName
,
partyPath1
,
"party"
);
valDtStr
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").XpctdValDt"
);
Map
<
String
,
String
>
partyMessage2
=
getPartyAndAgentAndAccountMessage
(
document
,
bodyParentElementName
,
partyPath2
,
"party"
);
Map
<
String
,
String
>
agentMessage1
=
getPartyAndAgentAndAccountMessage
(
document
,
bodyParentElementName
,
agentPath1
,
"agent"
);
Map
<
String
,
String
>
agentMessage2
=
getPartyAndAgentAndAccountMessage
(
document
,
bodyParentElementName
,
agentPath2
,
"agent"
);
maps
.
put
(
getPropertyValue
(
"remitter.anyBIC"
),
partyMessage1
.
get
(
"anyBIC"
));
maps
.
put
(
getPropertyValue
(
"remitter.ctry"
),
partyMessage1
.
get
(
"ctry"
));
maps
.
put
(
getPropertyValue
(
"remitter.nm"
),
partyMessage1
.
get
(
"nm"
));
maps
.
put
(
getPropertyValue
(
"remitter.adrLine"
),
partyMessage1
.
get
(
"adrLine"
));
maps
.
put
(
getPropertyValue
(
"remitter.cd"
),
partyMessage1
.
get
(
"cd"
));
maps
.
put
(
getPropertyValue
(
"remitter.mmbId"
),
partyMessage1
.
get
(
"mmbId"
));
/*String agentPath3 = ".Ntfctn.DbtrAgt";
String agentPath4 = ".Ntfctn.Itm("+0+").DbtrAgt";
maps.put("instructingBank",null);
Map<String, String> agentMessage3 = getPartyAndAgentAndAccountMessage(document, bodyParentElementName, agentPath3);
Map<String, String> agentMessage4 = getPartyAndAgentAndAccountMessage(document, bodyParentElementName, agentPath4);
if(agentMessage3!=null||agentMessage4!=null){
maps.clear();
}
}
if
(
StringUtil
.
isNotEmpty
(
valDtStr
)){
if (agentMessage3!=null){
maps
.
put
(
getPropertyValue
(
"notification.xpctdValDt"
),
valDtStr
);
maps.putAll(agentMessage3);
}else if(agentMessage4!=null){
maps.putAll(agentMessage4);
}
String agentPath5 = ".Ntfctn.IntrmyAgt";
String agentPath6 = ".Ntfctn.Itm("+0+").IntrmyAgt";
maps.put("intermediaryBank",null);
Map<String, String> agentMessage5 = getPartyAndAgentAndAccountMessage(document, bodyParentElementName, agentPath5);
Map<String, String> agentMessage6 = getPartyAndAgentAndAccountMessage(document, bodyParentElementName, agentPath6);
if(agentMessage5!=null||agentMessage6!=null){
maps.clear();
}
}
int
count1
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
".Ntfctn.Dbtr.Pty"
,
null
);
if(agentMessage5!=null){
maps.putAll(agentMessage5);
}else if(agentMessage6!=null){
maps.putAll(agentMessage6);
}*/
/*int count1 = XmlUtil.getChildrenCount(document, bodyParentElementName + ".Ntfctn.Dbtr.Pty",null);
int count2 = XmlUtil.getChildrenCount(document, bodyParentElementName + ".Ntfctn.Itm("+0+").Dbtr.Pty",null);
int count2 = XmlUtil.getChildrenCount(document, bodyParentElementName + ".Ntfctn.Itm("+0+").Dbtr.Pty",null);
int count3 = XmlUtil.getChildrenCount(document, bodyParentElementName + ".Ntfctn.Dbtr.Agt",null);
int count3 = XmlUtil.getChildrenCount(document, bodyParentElementName + ".Ntfctn.Dbtr.Agt",null);
int
count4
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
".Ntfctn.Itm("
+
0
+
").Dbtr.Agt"
,
null
);
int count4 = XmlUtil.getChildrenCount(document, bodyParentElementName + ".Ntfctn.Itm("+0+").Dbtr.Agt",null);
*/
String
bicCode
=
""
;
/*
String bicCode = "";
String country = "";
String country = "";
int addressLineCount = 0;
int addressLineCount = 0;
String name = "";
String name = "";
...
@@ -142,10 +184,82 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
...
@@ -142,10 +184,82 @@ public class Mx2MapCamt057Creator extends AbstractMx2MapCreator {
}
}
if(StringUtil.isNotEmpty(ClearingSystemId)){
if(StringUtil.isNotEmpty(ClearingSystemId)){
maps.put(getPropertyValue("notification.debtor.agent.financialInstitutionIdentification.clearingSystemMemberIdentification.mmbId"), ClearingSystemId);
maps.put(getPropertyValue("notification.debtor.agent.financialInstitutionIdentification.clearingSystemMemberIdentification.mmbId"), ClearingSystemId);
}
}
*/
}
catch
(
DocumentException
e
)
{
}
catch
(
DocumentException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
return
maps
;
return
maps
;
}
}
//choice选项为party和agent
public
Map
<
String
,
String
>
getPartyAndAgentAndAccountMessage
(
Document
document
,
String
bodyParentElementName
,
String
partyAndAgentAndAccountPath
,
String
choice
){
String
bicCode
=
""
;
String
country
=
""
;
int
addressLineCount
=
0
;
String
address
=
""
;
String
name
=
""
;
String
clearingSystemCode
=
""
;
String
ClearingSystemId
=
""
;
String
account
=
""
;
Map
<
String
,
String
>
maps
=
new
HashMap
<>();
if
(
"party"
.
equals
(
choice
)){
int
countParty
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
,
null
);
if
(
countParty
>
0
){
bicCode
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".Id.OrgId.AnyBIC"
);
country
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".PstlAdr.Ctry"
);
addressLineCount
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".PstlAdr.AdrLine"
,
null
);
name
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".Nm"
);
for
(
int
i
=
0
;
i
<
addressLineCount
;
i
++)
{
if
(
i
!=
1
||
i
!=
addressLineCount
-
1
){
address
=
address
+
","
;
}
address
=
address
+
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
".PstlAdr.AdrLine("
+
i
+
")"
);
}
}
}
if
(
"agent"
.
equals
(
choice
)){
int
countAgent
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
,
null
);
if
(
countAgent
>
0
){
bicCode
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".Id.OrgId.AnyBIC"
);
country
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".FinInstnId.PstlAdr.Ctry"
);
addressLineCount
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".FinInstnId.PstlAdr.AdrLine"
,
null
);
name
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".FinInstnId.Nm"
);
clearingSystemCode
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".FinInstnId.ClrSysMmbId.ClrSysId.Cd"
);
ClearingSystemId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".FinInstnId.ClrSysMmbId.MmbId"
);
for
(
int
i
=
0
;
i
<
addressLineCount
;
i
++)
{
if
(
i
!=
1
||
i
!=
addressLineCount
-
1
){
address
=
address
+
","
;
}
address
=
address
+
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".FinInstnId.PstlAdr.AdrLine("
+
i
+
")"
);
}
}
}
if
(
"account"
.
equals
(
choice
)){
account
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".Id.IBAN"
);
if
(
StringUtil
.
isEmpty
(
account
)){
account
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentElementName
+
partyAndAgentAndAccountPath
+
".Id.Othr.Id"
);
}
}
if
(
StringUtil
.
isNotEmpty
(
bicCode
)){
maps
.
put
(
getPropertyValue
(
"anyBIC"
),
bicCode
);
}
if
(
StringUtil
.
isNotEmpty
(
country
)){
maps
.
put
(
getPropertyValue
(
"ctry"
),
country
);
}
if
(
StringUtil
.
isNotEmpty
(
account
)){
maps
.
put
(
getPropertyValue
(
"account"
),
account
);
}
if
(
StringUtil
.
isNotEmpty
(
name
)){
maps
.
put
(
getPropertyValue
(
"nm"
),
name
);
}
if
(
StringUtil
.
isNotEmpty
(
address
)){
maps
.
put
(
getPropertyValue
(
"adrLine"
),
address
);
}
if
(
StringUtil
.
isNotEmpty
(
clearingSystemCode
)){
maps
.
put
(
getPropertyValue
(
"cd"
),
clearingSystemCode
);
}
if
(
StringUtil
.
isNotEmpty
(
ClearingSystemId
)){
maps
.
put
(
getPropertyValue
(
"mmbId"
),
ClearingSystemId
);
}
return
maps
;
}
}
}
swiftCore/src/main/resources/Messages_CN.properties
View file @
d88760d6
...
@@ -31,6 +31,24 @@ cancellationDetails.transactionInformationAndStatus.cancellationStatusReasonInfo
...
@@ -31,6 +31,24 @@ cancellationDetails.transactionInformationAndStatus.cancellationStatusReasonInfo
cancellationDetails.transactionInformationAndStatus.cancellationStatusReasonInformation.addtlInf
=
\u
4ea4
\u6613\u
64a4
\u9500\u
8bf7
\u
6c42
\u
54cd
\u
5e94
\u
8be6
\u
60c5
cancellationDetails.transactionInformationAndStatus.cancellationStatusReasonInformation.addtlInf
=
\u
4ea4
\u6613\u
64a4
\u9500\u
8bf7
\u
6c42
\u
54cd
\u
5e94
\u
8be6
\u
60c5
underlying.transactionInformation.cancellationReasonInformation.reason.cd
=
\u
4ea4
\u6613\u
64a4
\u9500\u
8bf7
\u
6c42
\u
4ee3
\u7801
underlying.transactionInformation.cancellationReasonInformation.reason.cd
=
\u
4ea4
\u6613\u
64a4
\u9500\u
8bf7
\u
6c42
\u
4ee3
\u7801
underlying.transactionInformation.cancellationReasonInformation.addtlInf
=
\u
4ea4
\u6613\u
64a4
\u9500\u
8bf7
\u
6c42
\u
8be6
\u
60c5
underlying.transactionInformation.cancellationReasonInformation.addtlInf
=
\u
4ea4
\u6613\u
64a4
\u9500\u
8bf7
\u
6c42
\u
8be6
\u
60c5
report.account.currency
=
\u6700\u
4f4e
\u
91d1
\u
989d
\u
89c4
\u
5b9a
report.creDtTm
=
\u
65e5
\u
671f
report.transactionsSummary.totalCreditEntries.nbOfNtries
=
\u
501f
\u
8bb0
\u
7b14
\u6570
report.transactionsSummary.totalCreditEntries.sum
=
\u
501f
\u
8bb0
\u
603b
\u
91d1
\u
989d
report.transactionsSummary.totalDebitEntries.nbOfNtries
=
\u
8d37
\u
8bb0
\u
7b14
\u6570
report.transactionsSummary.totalDebitEntries.sum
=
\u
8d37
\u
8bb0
\u
603b
\u
91d1
\u
989d
notification.amount.ccy
=
\u
8d27
\u
5e01
notification.amount.amt
=
\u
91d1
\u
989d
remitter
=
\u
6c47
\u
6b3e
\u
4eba
instructingBank
=
\u6307\u
793a
\u
884c
intermediaryBank
=
\u
4e2d
\u
95f4
\u
884c
remitter.anyBIC
=
\u
6c47
\u
6b3e
\u
4eba
\u
91d1
\u
878d
\u
673a
\u6784
bic
\u
4ee3
\u7801
remitter.ctry
=
\u
6c47
\u
6b3e
\u
4eba
\u
56fd
\u
5bb6
remitter.nm
=
\u
6c47
\u
6b3e
\u
4eba
\u
540d
\u
79f0
account
=
\u
8d26
\u6237
remitter.adrLine
=
\u
6c47
\u
6b3e
\u
4eba
\u5730\u5740
remitter.cd
=
\u
6c47
\u
6b3e
\u
4eba
\u
6e05
\u
7b97
\u
884c
\u
7cfb
\u
7edf
\u
4ee3
\u7801
remitter.mmbId
=
\u
6c47
\u
6b3e
\u
4eba
\u
6e05
\u
7b97
\u
884c
\u
7cfb
\u
7edf
\u
8d26
\u
53f7
#
#
message.id
=
\u
4e1a
\u
52a1
\u
7f16
\u
53f7
message.id
=
\u
4e1a
\u
52a1
\u
7f16
\u
53f7
endToEnd.id
=
\u
76f8
\u5173\u
4e1a
\u
52a1
\u
7f16
\u
53f7
endToEnd.id
=
\u
76f8
\u5173\u
4e1a
\u
52a1
\u
7f16
\u
53f7
...
...
swiftCore/src/main/resources/swiftXml/MXcamt05200108_942.xml
View file @
d88760d6
...
@@ -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-011111111111111111111111111
1
</Id>
<Id>
100-0
1
</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
1111111
</NbOfNtries>
<NbOfNtries>
87
</NbOfNtries>
<
!--<Sum>385700</Sum>--
>
<
Sum>
385700
</Sum
>
</TtlCdtNtries>
</TtlCdtNtries>
<TtlDbtNtries>
<TtlDbtNtries>
<NbOfNtries>
9
111111111
</NbOfNtries>
<NbOfNtries>
9
</NbOfNtries>
<
!--<Sum>210000</Sum>--
>
<
Sum>
210000
</Sum
>
</TtlDbtNtries>
</TtlDbtNtries>
</TxsSummry>
</TxsSummry>
<Ntry>
<Ntry>
...
...
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt192/Test.java
0 → 100644
View file @
d88760d6
package
com
.
brilliance
.
mx2mtmap
.
mt192
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Map
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05600108_292.xml"
));
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2Map
(
xmlStr
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
":"
+
v
));
}
}
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt196/Test.java
0 → 100644
View file @
d88760d6
package
com
.
brilliance
.
mx2mtmap
.
mt196
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Map
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt02900108_296.xml"
));
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2Map
(
xmlStr
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
":"
+
v
));
}
}
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt210/Test.java
0 → 100644
View file @
d88760d6
package
com
.
brilliance
.
mx2mtmap
.
mt210
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Map
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05700106.xml"
));
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2Map
(
xmlStr
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
":"
+
v
));
}
}
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt942/Test.java
0 → 100644
View file @
d88760d6
package
com
.
brilliance
.
mx2mtmap
.
mt942
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Map
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MXcamt05200108_942.xml"
));
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2Map
(
xmlStr
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
":"
+
v
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment