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
c4b63b74
Commit
c4b63b74
authored
Oct 10, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加pacs009001,camt054001报文要素展示功能
parent
289ef17e
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
399 additions
and
70 deletions
+399
-70
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+4
-19
AbstractMx2MapCreator.java
...va/com/brilliance/swift/mx2map/AbstractMx2MapCreator.java
+70
-4
Mx2MapCreatorManager.java
...ava/com/brilliance/swift/mx2map/Mx2MapCreatorManager.java
+7
-11
Mx2MapCamt053Creator.java
...brilliance/swift/mx2map/camt053/Mx2MapCamt053Creator.java
+3
-2
Mx2MapCamt054Creator.java
...brilliance/swift/mx2map/camt054/Mx2MapCamt054Creator.java
+86
-0
Mx2MapPacs008Creator.java
...brilliance/swift/mx2map/pacs008/Mx2MapPacs008Creator.java
+28
-22
Mx2MapPacs009Creator.java
...brilliance/swift/mx2map/pacs009/Mx2MapPacs009Creator.java
+133
-0
Mx2Mt940950Creator.java
...m/brilliance/swift/mx2mt/mt940950/Mx2Mt940950Creator.java
+12
-8
Field61Generate.java
...brilliance/swift/mx2mt/mt940950/impl/Field61Generate.java
+5
-0
MessageUtil.java
.../src/main/java/com/brilliance/swift/util/MessageUtil.java
+28
-1
Messages_CN.properties
swiftCore/src/main/resources/Messages_CN.properties
+10
-1
Messages_US.properties
swiftCore/src/main/resources/Messages_US.properties
+9
-1
Mx2ElementTest.java
swiftCore/src/test/java/com/brilliance/Mx2ElementTest.java
+4
-1
No files found.
swiftCore/src/main/java/com/brilliance/swift/SwiftTransfer.java
View file @
c4b63b74
...
...
@@ -6,10 +6,7 @@ import com.brilliance.swift.mt2mx.Mt2MxCreatorManager;
import
com.brilliance.swift.mx2element.Mx2ElementCreatorManager
;
import
com.brilliance.swift.mx2map.Mx2MapCreatorManager
;
import
com.brilliance.swift.mx2mt.Mx2MtCreatorManager
;
import
com.brilliance.swift.util.MxMessageReader
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.SwiftTransferUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.util.*
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.prowidesoftware.swift.model.MxId
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
...
...
@@ -211,24 +208,12 @@ public class SwiftTransfer {
* @return
*/
public
static
String
showMxElement
(
String
xmlStr
,
String
localCode
)
{
String
mxElementStr
=
""
;
String
Builder
sb
=
new
StringBuilder
()
;
Map
<
String
,
Object
>
maps
=
mx2Map
(
xmlStr
,
localCode
);
if
(
maps
.
size
()
>
0
)
{
Set
<
String
>
keys
=
maps
.
keySet
();
for
(
String
key
:
keys
)
{
if
(
maps
.
get
(
key
)
instanceof
Map
)
{
mxElementStr
+=
Mx2MtConstants
.
NEW_LINE
;
mxElementStr
+=
key
+
":"
+
Mx2MtConstants
.
NEW_LINE
;
Map
<
String
,
Object
>
newMaps
=
(
Map
<
String
,
Object
>)
maps
.
get
(
key
);
for
(
String
tmpKey
:
newMaps
.
keySet
())
{
mxElementStr
+=
tmpKey
+
":"
+
newMaps
.
get
(
tmpKey
)
+
Mx2MtConstants
.
NEW_LINE
;
}
}
else
{
mxElementStr
+=
key
+
":"
+
maps
.
get
(
key
)
+
Mx2MtConstants
.
NEW_LINE
;
}
}
MessageUtil
.
showMaps
(
maps
,
sb
);
}
return
mxElementStr
;
return
sb
.
toString
()
;
}
/**
* 将MX xml转换成Map<String, String>
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/AbstractMx2MapCreator.java
View file @
c4b63b74
package
com
.
brilliance
.
swift
.
mx2map
;
import
com.alibaba.fastjson.JSONArray
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.util.MessageUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.common.CdtDbtCode
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
...
...
@@ -39,7 +42,7 @@ public abstract class AbstractMx2MapCreator implements Mx2MapCreator{
* @param name 表示party的名字
* @param elementMaps 平铺要素MAP
*/
protected
void
buildPartyInfo
(
String
name
,
Map
<
String
,
Object
>
elementMaps
)
{
protected
void
buildPartyInfo
(
Map
<
String
,
Object
>
targetMaps
,
String
name
,
Map
<
String
,
Object
>
elementMaps
)
{
String
[]
keys
=
new
String
[]{
name
+
"AcctIdIban"
,
name
+
"AcctId"
,
name
+
"Nm"
,
name
+
"OrgAnyBIC"
,
name
+
"PstlAdrCtry"
,
name
+
"PstlAdrDept"
,
name
+
"PstlAdrSubDept"
,
name
+
"PstlAdrStrtNm"
,
name
+
"PstlAdrBldgNb"
,
name
+
"PstlAdrBldgNm"
,
...
...
@@ -56,7 +59,7 @@ public abstract class AbstractMx2MapCreator implements Mx2MapCreator{
}
if
(
existFlag
)
{
Map
<
String
,
Object
>
newMaps
=
new
LinkedHashMap
<>();
maps
.
put
(
getPropertyValue
(
name
+
"Info"
),
newMaps
);
targetMaps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
name
+
"Info"
),
newMaps
);
for
(
String
key
:
keys
)
{
if
(
elementMaps
.
get
(
key
)
!=
null
)
{
Object
obj
=
elementMaps
.
get
(
key
);
...
...
@@ -80,7 +83,7 @@ public abstract class AbstractMx2MapCreator implements Mx2MapCreator{
* @param name 表示Agent的名字
* @param elementMaps 平铺要素MAP
*/
protected
void
buildAgentInfo
(
String
name
,
Map
<
String
,
Object
>
elementMaps
)
{
protected
void
buildAgentInfo
(
Map
<
String
,
Object
>
targetMaps
,
String
name
,
Map
<
String
,
Object
>
elementMaps
)
{
String
[]
keys
=
new
String
[]{
name
+
"AcctIdIban"
,
name
+
"AcctId"
,
name
+
"Bicfi"
,
name
+
"Nm"
,
name
+
"ClrSysIdType"
,
name
+
"ClrSysId"
,
name
+
"PstlAdrCtry"
,
name
+
"PstlAdrDept"
,
name
+
"PstlAdrSubDept"
,
...
...
@@ -98,7 +101,7 @@ public abstract class AbstractMx2MapCreator implements Mx2MapCreator{
}
if
(
existFlag
)
{
Map
<
String
,
Object
>
newMaps
=
new
LinkedHashMap
<>();
maps
.
put
(
getPropertyValue
(
name
+
"Info"
),
newMaps
);
targetMaps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
name
+
"Info"
),
newMaps
);
for
(
String
key
:
keys
)
{
if
(
elementMaps
.
get
(
key
)
!=
null
)
{
Object
obj
=
elementMaps
.
get
(
key
);
...
...
@@ -116,4 +119,67 @@ public abstract class AbstractMx2MapCreator implements Mx2MapCreator{
}
}
}
protected
void
buildAgentInfo
(
Map
<
String
,
Object
>
targetMaps
,
String
name
,
Map
<
String
,
Object
>
elementMaps
,
String
subMapName
)
{
String
[]
keys
=
new
String
[]{
name
+
"AcctIdIban"
,
name
+
"AcctId"
,
name
+
"Bicfi"
,
name
+
"Nm"
,
name
+
"ClrSysIdType"
,
name
+
"ClrSysId"
,
name
+
"PstlAdrCtry"
,
name
+
"PstlAdrDept"
,
name
+
"PstlAdrSubDept"
,
name
+
"PstlAdrStrtNm"
,
name
+
"PstlAdrBldgNb"
,
name
+
"PstlAdrBldgNm"
,
name
+
"PstlAdrFlr"
,
name
+
"PstlAdrRoom"
,
name
+
"PstlAdrTwnNm"
,
name
+
"PstlAdrPstBx"
,
name
+
"PstlAdrPstCd"
,
name
+
"PstlAdrCtrySubDvsn"
,
name
+
"PstlAdrDstrctNm"
,
name
+
"PstlAdrTwnLctnNm"
,
name
+
"AdrLines"
};
boolean
existFlag
=
false
;
for
(
String
key
:
keys
)
{
if
(
elementMaps
.
get
(
key
)
!=
null
)
{
existFlag
=
true
;
break
;
}
}
if
(
existFlag
)
{
Map
<
String
,
Object
>
newMaps
=
new
LinkedHashMap
<>();
targetMaps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
subMapName
),
newMaps
);
for
(
String
key
:
keys
)
{
if
(
elementMaps
.
get
(
key
)
!=
null
)
{
Object
obj
=
elementMaps
.
get
(
key
);
String
suffixKey
=
key
.
substring
(
key
.
indexOf
(
name
)
+
name
.
length
());
if
(
obj
instanceof
String
)
{
newMaps
.
put
(
getPropertyValue
(
suffixKey
.
substring
(
0
,
1
).
toLowerCase
()
+
suffixKey
.
substring
(
1
)),
obj
);
}
else
if
(
obj
instanceof
JSONArray
)
{
JSONArray
jsonArray
=
(
JSONArray
)
obj
;
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
Object
object
=
jsonArray
.
get
(
i
);
newMaps
.
put
(
getPropertyValue
(
suffixKey
.
substring
(
0
,
1
).
toLowerCase
()
+
suffixKey
.
substring
(
1
))
+
"("
+(
i
+
1
)
+
")"
,
object
);
}
}
}
}
}
}
protected
String
addSuffixWithMessageType
(
Map
<
String
,
Object
>
elementMaps
)
{
String
messageType
=
(
String
)
elementMaps
.
get
(
"messageType"
);
if
(
StringUtil
.
isNotEmpty
(
messageType
))
{
if
(
messageType
.
startsWith
(
"pacs008001"
))
{
return
messageType
+
"(MT103)"
;
}
else
if
(
messageType
.
startsWith
(
"pacs009001"
))
{
if
(
elementMaps
.
get
(
"undrlygCstmrCdtTrf"
)
!=
null
)
{
return
messageType
+
"(MT202COV)"
;
}
else
{
return
messageType
+
"(MT202)"
;
}
}
else
if
(
messageType
.
startsWith
(
"camt054001"
))
{
if
(
CdtDbtCode
.
CRDT
.
value
().
equals
(
elementMaps
.
get
(
"cdtDbtInd"
)))
{
return
messageType
+
"(MT910)"
;
}
else
{
return
messageType
+
"(MT900)"
;
}
}
else
if
(
messageType
.
startsWith
(
"camt053001"
))
{
return
messageType
+
"(MT950)"
;
}
else
{
return
messageType
;
}
}
return
null
;
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2map/Mx2MapCreatorManager.java
View file @
c4b63b74
...
...
@@ -3,7 +3,9 @@ package com.brilliance.swift.mx2map;
import
com.brilliance.swift.SwiftTransfer
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2map.camt053.Mx2MapCamt053Creator
;
import
com.brilliance.swift.mx2map.camt054.Mx2MapCamt054Creator
;
import
com.brilliance.swift.mx2map.pacs008.Mx2MapPacs008Creator
;
import
com.brilliance.swift.mx2map.pacs009.Mx2MapPacs009Creator
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
import
javax.xml.parsers.DocumentBuilder
;
...
...
@@ -33,17 +35,11 @@ public class Mx2MapCreatorManager {
return
new
Mx2MapCamt053Creator
();
}
else
if
(
"pacs.008.001"
.
equals
(
messageType
)){
return
new
Mx2MapPacs008Creator
();
}
/*else if("camt.029.001".equals(messageType)) {
return new Mx2MapCamt029Creator();
} else if("camt.056.001".equals(messageType)) {
return new Mx2MapCamt056Creator();
} else if("camt.052.001".equals(messageType)){
return new Mx2MapCamt052Creator();
} else if("camt.057.001".equals(messageType)){
return new Mx2MapCamt057Creator();
} else if("pacs.008.001".equals(messageType)){
return new Mx2MapPacs008Creator();
} */
else
{
}
else
if
(
"pacs.009.001"
.
equals
(
messageType
)){
return
new
Mx2MapPacs009Creator
();
}
else
if
(
"camt.054.001"
.
equals
(
messageType
)){
return
new
Mx2MapCamt054Creator
();
}
else
{
throw
new
SwiftException
(
"无效的报文类型"
);
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/camt053/Mx2MapCamt053Creator.java
View file @
c4b63b74
...
...
@@ -20,8 +20,9 @@ public class Mx2MapCamt053Creator extends AbstractMx2MapCreator {
if
(
elementMaps
.
get
(
"toBic"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
elementMaps
.
get
(
"toBic"
));
}
if
(
elementMaps
.
get
(
"msgDefIdr"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
elementMaps
.
get
(
"msgDefIdr"
));
String
messageType
=
addSuffixWithMessageType
(
elementMaps
);
if
(
messageType
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
messageType
);
}
if
(
elementMaps
.
get
(
"bizSvc"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
elementMaps
.
get
(
"bizSvc"
));
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/camt054/Mx2MapCamt054Creator.java
0 → 100644
View file @
c4b63b74
package
com
.
brilliance
.
swift
.
mx2map
.
camt054
;
import
com.brilliance.swift.SwiftTransfer
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2map.AbstractMx2MapCreator
;
import
com.brilliance.swift.vo.common.CdtDbtCode
;
import
java.math.BigDecimal
;
import
java.util.Map
;
public
class
Mx2MapCamt054Creator
extends
AbstractMx2MapCreator
{
@Override
public
Map
<
String
,
Object
>
mx2Map
()
throws
SwiftException
{
Map
<
String
,
Object
>
elementMaps
=
SwiftTransfer
.
mx2ElementMaps
(
xmlStr
);
if
(
elementMaps
.
get
(
"frBic"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.sendBic"
),
elementMaps
.
get
(
"frBic"
));
}
if
(
elementMaps
.
get
(
"toBic"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
elementMaps
.
get
(
"toBic"
));
}
String
messageType
=
addSuffixWithMessageType
(
elementMaps
);
if
(
messageType
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
messageType
);
}
if
(
elementMaps
.
get
(
"bizSvc"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
elementMaps
.
get
(
"bizSvc"
));
}
if
(
elementMaps
.
get
(
"creDt"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
elementMaps
.
get
(
"creDt"
));
}
if
(
elementMaps
.
get
(
"endToEndId"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
elementMaps
.
get
(
"endToEndId"
));
}
if
(
elementMaps
.
get
(
"uetr"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"uetr"
),
elementMaps
.
get
(
"uetr"
));
}
if
(
elementMaps
.
get
(
"cdtDbtInd"
)
!=
null
)
{
String
cdtDbtInd
=
(
String
)
elementMaps
.
get
(
"cdtDbtInd"
);
if
(
CdtDbtCode
.
CRDT
.
value
().
equals
(
cdtDbtInd
))
{
maps
.
put
(
getPropertyValue
(
"cdtDbtInd"
),
getPropertyValue
(
"credit"
));
}
else
{
maps
.
put
(
getPropertyValue
(
"cdtDbtInd"
),
getPropertyValue
(
"debit"
));
}
}
if
(
elementMaps
.
get
(
"sts"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"status"
),
elementMaps
.
get
(
"sts"
));
}
else
if
(
elementMaps
.
get
(
"stsPrtry"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"status"
),
elementMaps
.
get
(
"stsPrtry"
));
}
if
(
elementMaps
.
get
(
"bookgDt"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"bookingDate"
),
elementMaps
.
get
(
"bookgDt"
));
}
if
(
elementMaps
.
get
(
"bizMsgIdr"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"message.id"
),
elementMaps
.
get
(
"bizMsgIdr"
));
}
if
(
elementMaps
.
get
(
"valDt"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"valueDate"
),
elementMaps
.
get
(
"valDt"
));
}
if
(
elementMaps
.
get
(
"ntryAmt"
)
!=
null
)
{
BigDecimal
amt
=
(
BigDecimal
)
elementMaps
.
get
(
"ntryAmt"
);
if
(
elementMaps
.
get
(
"ntryCcy"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"valueAmt"
),
elementMaps
.
get
(
"ntryCcy"
)
+
" "
+
amt
.
toPlainString
());
}
else
{
maps
.
put
(
getPropertyValue
(
"valueAmt"
),
amt
.
toPlainString
());
}
}
if
(
elementMaps
.
get
(
"ntfctnAcctIdIban"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"acctIdIban"
),
elementMaps
.
get
(
"ntfctnAcctIdIban"
));
}
if
(
elementMaps
.
get
(
"ntfctnAcctId"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"acctId"
),
elementMaps
.
get
(
"ntfctnAcctId"
));
}
if
(
elementMaps
.
get
(
"ntfctnAcctCcy"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"accountCcy"
),
elementMaps
.
get
(
"ntfctnAcctCcy"
));
}
buildPartyInfo
(
maps
,
"dbtr"
,
elementMaps
);
buildAgentInfo
(
maps
,
"dbtrAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"intrmyAgt1"
,
elementMaps
);
if
(
elementMaps
.
get
(
"addtlTxInf"
)
!=
null
)
{
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"txnRemark"
),
elementMaps
.
get
(
"addtlTxInf"
));
}
return
maps
;
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2map/pacs008/Mx2MapPacs008Creator.java
View file @
c4b63b74
package
com
.
brilliance
.
swift
.
mx2map
.
pacs008
;
import
com.brilliance.swift.SwiftTransfer
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2map.AbstractMx2MapCreator
;
import
com.brilliance.swift.util.StringUtil
;
...
...
@@ -9,6 +10,7 @@ import com.prowidesoftware.swift.model.mt.AbstractMT;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -22,8 +24,9 @@ public class Mx2MapPacs008Creator extends AbstractMx2MapCreator {
if
(
elementMaps
.
get
(
"toBic"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
elementMaps
.
get
(
"toBic"
));
}
if
(
elementMaps
.
get
(
"msgDefIdr"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
elementMaps
.
get
(
"msgDefIdr"
));
String
messageType
=
addSuffixWithMessageType
(
elementMaps
);
if
(
messageType
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
messageType
);
}
if
(
elementMaps
.
get
(
"bizSvc"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
elementMaps
.
get
(
"bizSvc"
));
...
...
@@ -31,9 +34,7 @@ public class Mx2MapPacs008Creator extends AbstractMx2MapCreator {
if
(
elementMaps
.
get
(
"creDt"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
elementMaps
.
get
(
"creDt"
));
}
if
(
elementMaps
.
get
(
"bizMsgIdr"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"message.id"
),
elementMaps
.
get
(
"bizMsgIdr"
));
}
if
(
elementMaps
.
get
(
"endToEndId"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
elementMaps
.
get
(
"endToEndId"
));
}
...
...
@@ -49,39 +50,44 @@ public class Mx2MapPacs008Creator extends AbstractMx2MapCreator {
if
(
elementMaps
.
get
(
"sttlmAcctId"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"settlement.acct"
),
elementMaps
.
get
(
"sttlmAcctId"
));
}
Map
<
String
,
Object
>
creditTransferMaps
=
new
LinkedHashMap
<>();
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"creditTransferInfo"
),
creditTransferMaps
);
if
(
elementMaps
.
get
(
"bizMsgIdr"
)
!=
null
)
{
creditTransferMaps
.
put
(
getPropertyValue
(
"message.id"
),
elementMaps
.
get
(
"bizMsgIdr"
));
}
if
(
elementMaps
.
get
(
"intrBkSttlmDt"
)
!=
null
)
{
m
aps
.
put
(
getPropertyValue
(
"settlement.date"
),
elementMaps
.
get
(
"intrBkSttlmDt"
));
creditTransferM
aps
.
put
(
getPropertyValue
(
"settlement.date"
),
elementMaps
.
get
(
"intrBkSttlmDt"
));
}
if
(
elementMaps
.
get
(
"intrBkSttlmAmt"
)
!=
null
)
{
BigDecimal
amt
=
(
BigDecimal
)
elementMaps
.
get
(
"intrBkSttlmAmt"
);
if
(
elementMaps
.
get
(
"intrBkSttlmCcy"
)
!=
null
)
{
m
aps
.
put
(
getPropertyValue
(
"settlement.amt"
),
elementMaps
.
get
(
"intrBkSttlmCcy"
)
+
" "
+
amt
.
toPlainString
());
creditTransferM
aps
.
put
(
getPropertyValue
(
"settlement.amt"
),
elementMaps
.
get
(
"intrBkSttlmCcy"
)
+
" "
+
amt
.
toPlainString
());
}
else
{
m
aps
.
put
(
getPropertyValue
(
"settlement.amt"
),
amt
.
toPlainString
());
creditTransferM
aps
.
put
(
getPropertyValue
(
"settlement.amt"
),
amt
.
toPlainString
());
}
}
if
(
elementMaps
.
get
(
"instdAmt"
)
!=
null
)
{
BigDecimal
amt
=
(
BigDecimal
)
elementMaps
.
get
(
"instdAmt"
);
if
(
elementMaps
.
get
(
"instdAmtCcy"
)
!=
null
)
{
m
aps
.
put
(
getPropertyValue
(
"original.settlement.amt"
),
elementMaps
.
get
(
"instdAmtCcy"
)
+
" "
+
amt
.
toPlainString
());
creditTransferM
aps
.
put
(
getPropertyValue
(
"original.settlement.amt"
),
elementMaps
.
get
(
"instdAmtCcy"
)
+
" "
+
amt
.
toPlainString
());
}
else
{
m
aps
.
put
(
getPropertyValue
(
"original.settlement.amt"
),
amt
.
toPlainString
());
creditTransferM
aps
.
put
(
getPropertyValue
(
"original.settlement.amt"
),
amt
.
toPlainString
());
}
}
if
(
elementMaps
.
get
(
"xchgRate"
)
!=
null
)
{
BigDecimal
xchgRate
=
(
BigDecimal
)
elementMaps
.
get
(
"xchgRate"
);
m
aps
.
put
(
getPropertyValue
(
"exchange.rate"
),
xchgRate
.
toPlainString
());
}
buildPartyInfo
(
"dbtr"
,
elementMaps
);
buildAgentInfo
(
"dbtrAgt"
,
elementMaps
);
buildAgentInfo
(
"instgRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
"instdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
"thrdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
"intrmyAgt1"
,
elementMaps
);
buildAgentInfo
(
"cdtrAgt"
,
elementMaps
);
buildPartyInfo
(
"cdtr"
,
elementMaps
);
creditTransferM
aps
.
put
(
getPropertyValue
(
"exchange.rate"
),
xchgRate
.
toPlainString
());
}
buildPartyInfo
(
maps
,
"dbtr"
,
elementMaps
);
buildAgentInfo
(
maps
,
"dbtrAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"instgRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"instdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"thrdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"intrmyAgt1"
,
elementMaps
);
buildAgentInfo
(
maps
,
"cdtrAgt"
,
elementMaps
);
buildPartyInfo
(
maps
,
"cdtr"
,
elementMaps
);
if
(
elementMaps
.
get
(
"chrgBr"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"charge.by"
),
elementMaps
.
get
(
"chrgBr"
));
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"charge.by"
),
elementMaps
.
get
(
"chrgBr"
));
}
if
(
elementMaps
.
get
(
"chrgsInf"
)
!=
null
)
{
List
<
Map
<
String
,
Object
>>
list
=
(
List
<
Map
<
String
,
Object
>>)
elementMaps
.
get
(
"chrgsInf"
);
...
...
@@ -105,7 +111,7 @@ public class Mx2MapPacs008Creator extends AbstractMx2MapCreator {
}
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"72"
);
if
(
tag
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"
statement.entry.addtlTxInf
"
),
tag
.
getValue
());
maps
.
put
(
getPropertyValue
(
"
txnRemark
"
),
tag
.
getValue
());
}
tag
=
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
"77B"
);
if
(
tag
!=
null
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2map/pacs009/Mx2MapPacs009Creator.java
0 → 100644
View file @
c4b63b74
package
com
.
brilliance
.
swift
.
mx2map
.
pacs009
;
import
com.brilliance.swift.SwiftTransfer
;
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.prowidesoftware.swift.model.SwiftTagListBlock
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Mx2MapPacs009Creator
extends
AbstractMx2MapCreator
{
@Override
public
Map
<
String
,
Object
>
mx2Map
()
throws
SwiftException
{
Map
<
String
,
Object
>
elementMaps
=
SwiftTransfer
.
mx2ElementMaps
(
xmlStr
);
if
(
elementMaps
.
get
(
"frBic"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.sendBic"
),
elementMaps
.
get
(
"frBic"
));
}
if
(
elementMaps
.
get
(
"toBic"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.receiverBic"
),
elementMaps
.
get
(
"toBic"
));
}
String
messageType
=
addSuffixWithMessageType
(
elementMaps
);
if
(
messageType
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.msgDefId"
),
messageType
);
}
if
(
elementMaps
.
get
(
"bizSvc"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.bizSvc"
),
elementMaps
.
get
(
"bizSvc"
));
}
if
(
elementMaps
.
get
(
"creDt"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"app.header.creDt"
),
elementMaps
.
get
(
"creDt"
));
}
if
(
elementMaps
.
get
(
"endToEndId"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"endToEnd.id"
),
elementMaps
.
get
(
"endToEndId"
));
}
if
(
elementMaps
.
get
(
"uetr"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"uetr"
),
elementMaps
.
get
(
"uetr"
));
}
if
(
elementMaps
.
get
(
"sttlmMtd"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"settlement.method"
),
elementMaps
.
get
(
"sttlmMtd"
));
}
if
(
elementMaps
.
get
(
"sttlmAcctIdIban"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"settlement.acct"
),
elementMaps
.
get
(
"sttlmAcctIdIban"
));
}
if
(
elementMaps
.
get
(
"sttlmAcctId"
)
!=
null
)
{
maps
.
put
(
getPropertyValue
(
"settlement.acct"
),
elementMaps
.
get
(
"sttlmAcctId"
));
}
Map
<
String
,
Object
>
creditTransferMaps
=
new
LinkedHashMap
<>();
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"creditTransferInfo"
),
creditTransferMaps
);
if
(
elementMaps
.
get
(
"bizMsgIdr"
)
!=
null
)
{
creditTransferMaps
.
put
(
getPropertyValue
(
"message.id"
),
elementMaps
.
get
(
"bizMsgIdr"
));
}
if
(
elementMaps
.
get
(
"intrBkSttlmDt"
)
!=
null
)
{
creditTransferMaps
.
put
(
getPropertyValue
(
"settlement.date"
),
elementMaps
.
get
(
"intrBkSttlmDt"
));
}
if
(
elementMaps
.
get
(
"intrBkSttlmAmt"
)
!=
null
)
{
BigDecimal
amt
=
(
BigDecimal
)
elementMaps
.
get
(
"intrBkSttlmAmt"
);
if
(
elementMaps
.
get
(
"intrBkSttlmCcy"
)
!=
null
)
{
creditTransferMaps
.
put
(
getPropertyValue
(
"settlement.amt"
),
elementMaps
.
get
(
"intrBkSttlmCcy"
)
+
" "
+
amt
.
toPlainString
());
}
else
{
creditTransferMaps
.
put
(
getPropertyValue
(
"settlement.amt"
),
amt
.
toPlainString
());
}
}
buildAgentInfo
(
maps
,
"dbtr"
,
elementMaps
,
"dbtrAgtInfo"
);
buildAgentInfo
(
maps
,
"instgRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"instdRmbrsmntAgt"
,
elementMaps
);
buildAgentInfo
(
maps
,
"intrmyAgt1"
,
elementMaps
);
buildAgentInfo
(
maps
,
"cdtrAgt"
,
elementMaps
,
"cdtrAgtAcctInfo"
);
buildAgentInfo
(
maps
,
"cdtr"
,
elementMaps
,
"cdtrAgtInfo"
);
AbstractMT
abstractMT
=
null
;
try
{
String
mtMessage
=
SwiftTransfer
.
mx2Mt
(
xmlStr
,
null
,
null
);
if
(
StringUtil
.
isNotEmpty
(
mtMessage
))
{
abstractMT
=
AbstractMT
.
parse
(
mtMessage
);
}
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
}
Tag
tag
=
getTagByName
(
abstractMT
,
"72"
,
"A"
);
if
(
tag
!=
null
)
{
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"txnRemark"
),
tag
.
getValue
());
}
//子交易信息
if
(
elementMaps
.
get
(
"undrlygCstmrCdtTrf"
)
!=
null
)
{
Map
<
String
,
Object
>
undrlygCstmrCdtTrfMaps
=
(
Map
<
String
,
Object
>)
elementMaps
.
get
(
"undrlygCstmrCdtTrf"
);
Map
<
String
,
Object
>
undrlyTxnMaps
=
new
LinkedHashMap
<>();
maps
.
put
(
Mx2MtConstants
.
NEW_LINE
+
getPropertyValue
(
"undrlygCstmrCdtTrfInfo"
),
undrlyTxnMaps
);
buildPartyInfo
(
undrlyTxnMaps
,
"dbtr"
,
undrlygCstmrCdtTrfMaps
);
buildAgentInfo
(
undrlyTxnMaps
,
"dbtrAgt"
,
undrlygCstmrCdtTrfMaps
);
buildAgentInfo
(
undrlyTxnMaps
,
"intrmyAgt1"
,
undrlygCstmrCdtTrfMaps
);
buildAgentInfo
(
undrlyTxnMaps
,
"cdtrAgt"
,
undrlygCstmrCdtTrfMaps
);
buildPartyInfo
(
undrlyTxnMaps
,
"cdtr"
,
undrlygCstmrCdtTrfMaps
);
tag
=
getTagByName
(
abstractMT
,
"70"
,
"B"
);
if
(
tag
!=
null
)
{
undrlyTxnMaps
.
put
(
getPropertyValue
(
"remittanceInformation"
),
tag
.
getValue
());
}
tag
=
getTagByName
(
abstractMT
,
"72"
,
"B"
);
if
(
tag
!=
null
)
{
undrlyTxnMaps
.
put
(
getPropertyValue
(
"txnRemark"
),
tag
.
getValue
());
}
if
(
undrlygCstmrCdtTrfMaps
.
get
(
"instdAmt"
)
!=
null
)
{
BigDecimal
amt
=
(
BigDecimal
)
elementMaps
.
get
(
"instdAmt"
);
if
(
elementMaps
.
get
(
"instdAmtCcy"
)
!=
null
)
{
undrlyTxnMaps
.
put
(
getPropertyValue
(
"original.settlement.amt"
),
elementMaps
.
get
(
"instdAmtCcy"
)
+
" "
+
amt
.
toPlainString
());
}
else
{
undrlyTxnMaps
.
put
(
getPropertyValue
(
"original.settlement.amt"
),
amt
.
toPlainString
());
}
}
}
return
maps
;
}
protected
Tag
getTagByName
(
AbstractMT
abstractMT
,
String
tagName
,
String
sequence
)
{
if
(
abstractMT
==
null
||
abstractMT
.
getSwiftMessage
()
==
null
)
return
null
;
boolean
isCov
=
abstractMT
.
getSwiftMessage
().
isCOV
();
if
(
isCov
)
{
SwiftTagListBlock
swiftTagListBlock
=
abstractMT
.
getSequence
(
sequence
);
if
(
swiftTagListBlock
!=
null
)
{
return
swiftTagListBlock
.
getTagByName
(
tagName
);
}
}
else
{
return
abstractMT
.
getSwiftMessage
().
getBlock4
().
getTagByName
(
tagName
);
}
return
null
;
}
}
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/Mx2Mt940950Creator.java
View file @
c4b63b74
...
...
@@ -43,14 +43,18 @@ public class Mx2Mt940950Creator extends AbstractMx2MtCreator {
}
if
(
index
>
-
1
)
{
String
opbdCcy
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"Stmt.Bal("
+
index
+
").Amt@Ccy"
);
for
(
int
i
=
0
;
i
<
balanceTypeCount
;
i
++)
{
String
balanceType
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"Stmt.Bal("
+
i
+
").Tp.CdOrPrtry.Cd"
);
if
(
BalanceTypeCode
.
CLBD
.
value
().
equals
(
balanceType
)
||
BalanceTypeCode
.
CLAV
.
value
().
equals
(
balanceType
)
||
BalanceTypeCode
.
FWAV
.
value
().
equals
(
balanceType
))
{
String
balanceCcy
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"Stmt.Bal("
+
i
+
").Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
opbdCcy
)
&&
StringUtil
.
isNotEmpty
(
balanceCcy
)
&&
!
opbdCcy
.
substring
(
0
,
2
).
equals
(
balanceCcy
.
substring
(
0
,
2
)))
{
buildSTErrorInfo
(
91
,
null
,
null
);
if
(
StringUtil
.
isEmpty
(
opbdCcy
))
{
buildSTErrorInfo
(
91
,
null
,
null
);
}
else
{
for
(
int
i
=
0
;
i
<
balanceTypeCount
;
i
++)
{
String
balanceType
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"Stmt.Bal("
+
i
+
").Tp.CdOrPrtry.Cd"
);
if
(
BalanceTypeCode
.
CLBD
.
value
().
equals
(
balanceType
)
||
BalanceTypeCode
.
CLAV
.
value
().
equals
(
balanceType
)
||
BalanceTypeCode
.
FWAV
.
value
().
equals
(
balanceType
))
{
String
balanceCcy
=
getXmlNodeValue
(
bodyParentPath
,
document
,
"Stmt.Bal("
+
i
+
").Amt@Ccy"
);
if
(
StringUtil
.
isEmpty
(
balanceCcy
)
||
(
StringUtil
.
isNotEmpty
(
balanceCcy
)
&&
!
opbdCcy
.
substring
(
0
,
2
).
equals
(
balanceCcy
.
substring
(
0
,
2
))))
{
buildSTErrorInfo
(
91
,
null
,
null
);
}
}
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/impl/Field61Generate.java
View file @
c4b63b74
...
...
@@ -88,6 +88,11 @@ public class Field61Generate extends AbstractMx2MtTagsGenerate {
buildSTErrorInfo
(
93
,
"Block4/61/"
+(
i
+
1
),
amt
);
}
value
+=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
amt
),
ccy
);
}
else
{
//Translation Preconditions/PREC008
if
(
StringUtil
.
isNotEmpty
(
acctCcy
)
&&
!
acctCcy
.
equals
(
ccy
))
{
buildSTErrorInfo
(
95
,
"Block4/61/"
+(
i
+
1
),
null
);
}
}
value
+=
"NTRF"
;
...
...
swiftCore/src/main/java/com/brilliance/swift/util/MessageUtil.java
View file @
c4b63b74
package
com
.
brilliance
.
swift
.
util
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Set
;
public
class
MessageUtil
{
...
...
@@ -30,4 +32,29 @@ public class MessageUtil {
throw
new
SwiftException
(
e
.
getMessage
());
}
}
public
static
void
showMaps
(
Map
<
String
,
Object
>
maps
,
StringBuilder
sb
)
{
Set
<
String
>
keys
=
maps
.
keySet
();
for
(
String
key
:
keys
)
{
if
(
maps
.
get
(
key
)
instanceof
Map
)
{
sb
//.append(Mx2MtConstants.NEW_LINE)
.
append
(
key
).
append
(
":"
)
.
append
(
Mx2MtConstants
.
NEW_LINE
);
Map
<
String
,
Object
>
newMaps
=
(
Map
<
String
,
Object
>)
maps
.
get
(
key
);
showMaps
(
newMaps
,
sb
);
}
else
{
sb
.
append
(
key
).
append
(
":"
).
append
(
maps
.
get
(
key
)).
append
(
Mx2MtConstants
.
NEW_LINE
);
}
}
}
/*public static void main(String[] args) {
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig(CharsetUtil.CHARSET_GBK, "template", TemplateConfig.ResourceMode.CLASSPATH));
Template template = engine.getTemplate("template/pacs008001.vm");
Map<String, Object> maps = new HashMap<>();
maps.put("name", "程");
//maps.put("name1", "");
String result = template.render(maps);
System.out.println(result);
}*/
}
swiftCore/src/main/resources/Messages_CN.properties
View file @
c4b63b74
...
...
@@ -41,6 +41,7 @@ settlement.amt=\u53d1\u6c47\u91d1\u989d
original.settlement.amt
=
\u6536\u
6c47
\u
91d1
\u
989d
exchange.rate
=
\u
6c47
\u7387
ccy
=
\u
5e01
\u
79cd
creditTransferInfo
=
\u
6c47
\u7968\u
57fa
\u7840\u
4fe1
\u
606f
dbtrInfo
=
\u
6c47
\u
6b3e
\u
65b9
\u
4fe1
\u
606f
dbtrAgtInfo
=
\u
6c47
\u
6b3e
\u
884c
\u
4fe1
\u
606f
instgRmbrsmntAgtInfo
=
\u
53d1
\u
62a5
\u
884c
\u7684\u
4ee3
\u7406\u
884c
\u
4fe1
\u
606f
...
...
@@ -48,15 +49,23 @@ instdRmbrsmntAgtInfo=\u6536\u62a5\u884c\u7684\u4ee3\u7406\u884c\u4fe1\u606f
thrdRmbrsmntAgtInfo
=
\u
7b2c
\u
4e09
\u
65b9
\u
507f
\u
4ed8
\u
884c
\u
4fe1
\u
606f
intrmyAgt1Info
=
\u
4e2d
\u
95f4
\u
884c
\u
4fe1
\u
606f
cdtrAgtInfo
=
\u6536\u
6b3e
\u
884c
\u
4fe1
\u
606f
cdtrAgtAcctInfo
=
\u
8d26
\u6237\u
884c
\u
4fe1
\u
606f
cdtrInfo
=
\u6536\u
6b3e
\u
65b9
\u
4fe1
\u
606f
undrlygCstmrCdtTrfInfo
=
\u
5b50
\u
4ea4
\u6613\u
4fe1
\u
606f
charge.by
=
\u
8d39
\u7528\u
627f
\u
62c5
\u
65b9
\u
5f0f
charge.info
=
\u
8d39
\u7528\u
660e
\u
7ec6
remittanceInformation
=
\u
6c47
\u
6b3e
\u
4fe1
\u
606f
regulatoryReporting
=
\u
6cd5
\u
89c4
\u
8bf4
\u
660e
txnRemark
=
\u
4ea4
\u6613\u9644\u
8a00
cdtDbtInd
=
\u
501f
\u
8d37
\u6807\u
8bc6
status
=
\u
72b6
\u6001
bookingDate
=
\u
8bb0
\u
8d26
\u
65e5
\u
671f
valueDate
=
\u
8d77
\u
606f
\u
65e5
valueAmt
=
\u
91d1
\u
989d
#party&agent
acctIdIban
=
\u
8d26
\u
53f7
acctId
=
\u
8d26
\u
53f7
accountCcy
=
\u
8d26
\u6237\u
5e01
\u
79cd
nm
=
\u
540d
\u
79f0
orgAnyBIC
=
\u
7ec4
\u
7ec7
\u
673a
\u6784\u
884c
\u
53f7
pstlAdrCtry
=
\u
5c45
\u
4f4f
\u5730\u
56fd
\u
5bb6
...
...
swiftCore/src/main/resources/Messages_US.properties
View file @
c4b63b74
...
...
@@ -41,6 +41,7 @@ settlement.amt=Interbank Settlement Amount
original.settlement.amt
=
Instructed Amount
exchange.rate
=
Exchange Rate
ccy
=
Currency
creditTransferInfo
=
Credit Transfer Info
dbtrInfo
=
Debtor
dbtrAgtInfo
=
Debtor Agent
instgRmbrsmntAgtInfo
=
Instructing Reimbursement Agent
...
...
@@ -49,14 +50,21 @@ thrdRmbrsmntAgtInfo=Third Reimbursement Agent
intrmyAgt1Info
=
Intermediary Agent 1
cdtrAgtInfo
=
Creditor Agent
cdtrInfo
=
Creditor
undrlygCstmrCdtTrfInfo
=
Credit Transfer Transaction Information
charge.by
=
Charge Bearer
charge.info
=
Charges Information
remittanceInformation
=
Remittance Information
regulatoryReporting
=
Regulatory Reporting
txnRemark
=
Remark Of Transaction
cdtDbtInd
=
Credit Debit Indicator
status
=
Status
bookingDate
=
Booking Date
valueDate
=
Value Date
valueAmt
=
Value Amount
#party&agent
acctIdIban
=
Account Number(IBAN)
acctId
=
Account Number
accountCcy
=
Account Currency
nm
=
Name
orgAnyBIC
=
Organisation Identification BIC
pstlAdrCtry
=
Country
...
...
swiftCore/src/test/java/com/brilliance/Mx2ElementTest.java
View file @
c4b63b74
...
...
@@ -20,7 +20,10 @@ public class Mx2ElementTest {
@Test
public
void
testMx2Map
()
throws
IOException
{
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00800108.xml"));
File
file
=
FileUtils
.
toFile
(
Mx2MtTest
.
class
.
getResource
(
"/swiftXml/MxCamt05300108_950.xml"
));
File
file
=
FileUtils
.
toFile
(
Mx2MtTest
.
class
.
getResource
(
"/swiftXml/MxPacs00900108.xml"
));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxPacs00900108_COV.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxCamt05300108_950.xml"));
//File file = FileUtils.toFile(Mx2MtTest.class.getResource("/swiftXml/MxCamt05400108_CREDIT.xml"));
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
elementStr
=
SwiftTransfer
.
showMxElement
(
xmlStr
,
"CN"
);
System
.
out
.
println
(
elementStr
);
...
...
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