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
ca1f9a42
Commit
ca1f9a42
authored
Jul 20, 2022
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基本完成camt05300108报文要素展示的编写
parent
f255e727
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
238 additions
and
50 deletions
+238
-50
AbstractMt2MxCamt052001ParseField.java
...t/mt2mx/camt052001/AbstractMt2MxCamt052001ParseField.java
+0
-1
Mt2MxCamt052001Creator.java
...liance/swift/mt2mx/camt052001/Mt2MxCamt052001Creator.java
+0
-12
Camt052001Parse13DField.java
.../swift/mt2mx/camt052001/impl/Camt052001Parse13DField.java
+0
-5
Camt052001Parse20Field.java
...e/swift/mt2mx/camt052001/impl/Camt052001Parse20Field.java
+0
-1
Camt052001Parse21Field.java
...e/swift/mt2mx/camt052001/impl/Camt052001Parse21Field.java
+0
-2
Camt052001Parse61Field.java
...e/swift/mt2mx/camt052001/impl/Camt052001Parse61Field.java
+3
-2
Camt052001Parse90CField.java
.../swift/mt2mx/camt052001/impl/Camt052001Parse90CField.java
+0
-1
AbstractMt2MxCamt057001ParseField.java
...t/mt2mx/camt057001/AbstractMt2MxCamt057001ParseField.java
+0
-2
Mt2MxCamt057001Creator.java
...liance/swift/mt2mx/camt057001/Mt2MxCamt057001Creator.java
+0
-11
Camt057001Parse20Field.java
...e/swift/mt2mx/camt057001/impl/Camt057001Parse20Field.java
+0
-4
Camt057001Parse32BField.java
.../swift/mt2mx/camt057001/impl/Camt057001Parse32BField.java
+0
-4
Camt057001Parse50Field.java
...e/swift/mt2mx/camt057001/impl/Camt057001Parse50Field.java
+3
-2
Camt057001Parse52Field.java
...e/swift/mt2mx/camt057001/impl/Camt057001Parse52Field.java
+0
-1
Camt057001Parse56Field.java
...e/swift/mt2mx/camt057001/impl/Camt057001Parse56Field.java
+0
-1
Mx2ElementCreatorManager.java
...brilliance/swift/mx2element/Mx2ElementCreatorManager.java
+5
-1
Mx2ElementCamt053001Creator.java
...ft/mx2element/camt053001/Mx2ElementCamt053001Creator.java
+166
-0
MxCamt05300108_950.xml
swiftCore/src/main/resources/swiftXml/MxCamt05300108_950.xml
+12
-0
camt053001.properties
swiftCore/src/main/resources/template/camt053001.properties
+31
-0
pacs009001.properties
swiftCore/src/main/resources/template/pacs009001.properties
+0
-0
Test950.java
...st/java/com/brilliance/mx2element/camt053001/Test950.java
+18
-0
No files found.
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt052001/AbstractMt2MxCamt052001ParseField.java
View file @
ca1f9a42
...
...
@@ -3,7 +3,6 @@ package com.brilliance.swift.mt2mx.camt052001;
import
com.alibaba.fastjson.JSONArray
;
import
com.brilliance.swift.mt2mx.AbstractMt2MxParseField
;
import
java.util.HashMap
;
import
java.util.Map
;
public
abstract
class
AbstractMt2MxCamt052001ParseField
extends
AbstractMt2MxParseField
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt052001/Mt2MxCamt052001Creator.java
View file @
ca1f9a42
package
com
.
brilliance
.
swift
.
mt2mx
.
camt052001
;
import
com.alibaba.fastjson.JSONArray
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.AbstractMt2MxCreator
;
import
com.brilliance.swift.mt2mx.Mt2MxContextIdentifier
;
import
com.brilliance.swift.mt2mx.Mt2MxParseField
;
import
com.brilliance.swift.mt2mx.camt029001.impl.*
;
import
com.brilliance.swift.mt2mx.camt052001.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.SwiftTransferUtil
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.brilliance.swift.vo.common.EntryStatusCode
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field77A
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
com.prowidesoftware.swift.model.mx.dic.AddressType2Code
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt052001/impl/Camt052001Parse13DField.java
View file @
ca1f9a42
package
com
.
brilliance
.
swift
.
mt2mx
.
camt052001
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt052001.AbstractMt2MxCamt052001ParseField
;
import
com.brilliance.swift.mt2mx.camt054001.AbstractMt2MxCamt054001ParseField
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field13D
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Camt052001Parse13DField
extends
AbstractMt2MxCamt052001ParseField
{
private
static
final
String
NAME
=
"13D"
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt052001/impl/Camt052001Parse20Field.java
View file @
ca1f9a42
...
...
@@ -2,7 +2,6 @@ package com.brilliance.swift.mt2mx.camt052001.impl;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt052001.AbstractMt2MxCamt052001ParseField
;
import
com.brilliance.swift.mt2mx.camt054001.AbstractMt2MxCamt054001ParseField
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt052001/impl/Camt052001Parse21Field.java
View file @
ca1f9a42
...
...
@@ -2,8 +2,6 @@ package com.brilliance.swift.mt2mx.camt052001.impl;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt052001.AbstractMt2MxCamt052001ParseField
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
public
class
Camt052001Parse21Field
extends
AbstractMt2MxCamt052001ParseField
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt052001/impl/Camt052001Parse61Field.java
View file @
ca1f9a42
...
...
@@ -5,9 +5,10 @@ import com.brilliance.swift.exception.SwiftException;
import
com.brilliance.swift.mt2mx.camt052001.AbstractMt2MxCamt052001ParseField
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.vo.common.CdtDbtCode
;
import
com.brilliance.swift.vo.common.EntryStatusCode
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.*
;
import
com.prowidesoftware.swift.model.field.Field34F
;
import
com.prowidesoftware.swift.model.field.Field61
;
import
com.prowidesoftware.swift.model.field.Field86
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.text.ParseException
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt052001/impl/Camt052001Parse90CField.java
View file @
ca1f9a42
...
...
@@ -4,7 +4,6 @@ import com.brilliance.swift.exception.SwiftException;
import
com.brilliance.swift.mt2mx.camt052001.AbstractMt2MxCamt052001ParseField
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field90C
;
import
com.prowidesoftware.swift.model.field.Field90D
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.util.HashMap
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt057001/AbstractMt2MxCamt057001ParseField.java
View file @
ca1f9a42
package
com
.
brilliance
.
swift
.
mt2mx
.
camt057001
;
import
com.alibaba.fastjson.JSONArray
;
import
com.brilliance.swift.mt2mx.AbstractMt2MxParseField
;
import
java.util.HashMap
;
import
java.util.Map
;
public
abstract
class
AbstractMt2MxCamt057001ParseField
extends
AbstractMt2MxParseField
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt057001/Mt2MxCamt057001Creator.java
View file @
ca1f9a42
package
com
.
brilliance
.
swift
.
mt2mx
.
camt057001
;
import
com.alibaba.fastjson.JSONArray
;
import
com.brilliance.swift.constants.ERROR
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.AbstractMt2MxCreator
;
import
com.brilliance.swift.mt2mx.Mt2MxContextIdentifier
;
import
com.brilliance.swift.mt2mx.Mt2MxParseField
;
import
com.brilliance.swift.mt2mx.camt054001.impl.*
;
import
com.brilliance.swift.mt2mx.camt057001.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.SwiftTransferUtil
;
import
com.brilliance.swift.vo.SwiftTranslationErrorInfo
;
import
com.brilliance.swift.vo.SwiftTranslationReport
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field32A
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
com.prowidesoftware.swift.model.mx.dic.CreditDebitCode
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt057001/impl/Camt057001Parse20Field.java
View file @
ca1f9a42
package
com
.
brilliance
.
swift
.
mt2mx
.
camt057001
.
impl
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt056001.AbstractMt2MxCamt056001ParseField
;
import
com.brilliance.swift.mt2mx.camt057001.AbstractMt2MxCamt057001ParseField
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Camt057001Parse20Field
extends
AbstractMt2MxCamt057001ParseField
{
private
static
final
String
NAME
=
"20"
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt057001/impl/Camt057001Parse32BField.java
View file @
ca1f9a42
...
...
@@ -3,14 +3,10 @@ package com.brilliance.swift.mt2mx.camt057001.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt057001.AbstractMt2MxCamt057001ParseField
;
import
com.brilliance.swift.util.DateUtil
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field32A
;
import
com.prowidesoftware.swift.model.field.Field32B
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt057001/impl/Camt057001Parse50Field.java
View file @
ca1f9a42
...
...
@@ -3,9 +3,10 @@ package com.brilliance.swift.mt2mx.camt057001.impl;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt057001.AbstractMt2MxCamt057001ParseField
;
import
com.brilliance.swift.util.StringUtil
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.*
;
import
com.prowidesoftware.swift.model.field.Field50
;
import
com.prowidesoftware.swift.model.field.Field50C
;
import
com.prowidesoftware.swift.model.field.Field50F
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.util.HashMap
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt057001/impl/Camt057001Parse52Field.java
View file @
ca1f9a42
...
...
@@ -2,7 +2,6 @@ package com.brilliance.swift.mt2mx.camt057001.impl;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt057001.AbstractMt2MxCamt057001ParseField
;
import
com.brilliance.swift.util.StringUtil
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field52A
;
import
com.prowidesoftware.swift.model.field.Field52D
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2mx/camt057001/impl/Camt057001Parse56Field.java
View file @
ca1f9a42
...
...
@@ -2,7 +2,6 @@ package com.brilliance.swift.mt2mx.camt057001.impl;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2mx.camt057001.AbstractMt2MxCamt057001ParseField
;
import
com.brilliance.swift.util.StringUtil
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.field.Field56A
;
import
com.prowidesoftware.swift.model.field.Field56D
;
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2element/Mx2ElementCreatorManager.java
View file @
ca1f9a42
package
com
.
brilliance
.
swift
.
mx2element
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2element.camt053001.Mx2ElementCamt053001Creator
;
import
com.brilliance.swift.mx2element.camt054001.Mx2ElementCamt054001Creator
;
import
com.brilliance.swift.mx2element.pacs008001.Mx2ElementPacs008001Creator
;
import
com.google.gson.Gson
;
...
...
@@ -34,7 +35,10 @@ public class Mx2ElementCreatorManager {
return
new
Mx2ElementPacs008001Creator
();
}
else
if
(
"camt.054.001"
.
equals
(
messageType
)){
return
new
Mx2ElementCamt054001Creator
();
}
else
{
}
else
if
(
"camt.053.001"
.
equals
(
messageType
)){
return
new
Mx2ElementCamt053001Creator
();
}
else
{
throw
new
SwiftException
(
"Invalid message type"
);
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2element/camt053001/Mx2ElementCamt053001Creator.java
0 → 100644
View file @
ca1f9a42
package
com
.
brilliance
.
swift
.
mx2element
.
camt053001
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mx2element.AbstractMx2ElementCreator
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.vo.common.BalanceTypeCode
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentHelper
;
import
java.math.BigDecimal
;
import
java.util.*
;
public
class
Mx2ElementCamt053001Creator
extends
AbstractMx2ElementCreator
{
@Override
public
Map
<
String
,
Object
>
buildElement
()
{
return
super
.
buildElement
();
}
public
Object
buildOpbdBalance
(){
balance
(
BalanceTypeCode
.
OPBD
.
value
());
return
null
;
}
public
Object
buildClbdBalance
(){
balance
(
BalanceTypeCode
.
CLBD
.
value
());
return
null
;
}
public
Object
buildClavBalance
(){
balance
(
BalanceTypeCode
.
CLAV
.
value
());
return
null
;
}
public
Object
bulidNtry
(){
try
{
Document
document
=
DocumentHelper
.
parseText
(
xmlStr
);
Map
<
String
,
String
>
parentElementMaps
=
XmlUtil
.
getParentElementMaps
(
document
);
String
bodyParentPath
=
parentElementMaps
.
get
(
"Stmt"
);
int
entryCount
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentPath
+
".Stmt.Ntry"
,
null
);
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
if
(
entryCount
>
0
){
for
(
int
i
=
0
;
i
<
entryCount
;
i
++)
{
Map
<
String
,
Object
>
entryMaps
=
new
LinkedHashMap
<>();
String
ntryRef
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").NtryRef"
);
if
(
StringUtil
.
isNotEmpty
(
ntryRef
))
{
entryMaps
.
put
(
"ntryRef"
,
ntryRef
);
}
String
ntryAmt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").Amt"
);
if
(
StringUtil
.
isNotEmpty
(
ntryAmt
))
{
entryMaps
.
put
(
"ntryAmt"
,
new
BigDecimal
(
ntryAmt
));
}
String
ntryCcy
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
ntryCcy
))
{
entryMaps
.
put
(
"ntryCcy"
,
ntryCcy
);
}
String
ntryCdtDbtInd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").CdtDbtInd"
);
if
(
StringUtil
.
isNotEmpty
(
ntryCdtDbtInd
))
{
entryMaps
.
put
(
"ntryCdtDbtInd"
,
ntryCdtDbtInd
);
}
String
ntryRvslInd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").RvslInd"
);
if
(
StringUtil
.
isNotEmpty
(
ntryRvslInd
))
{
entryMaps
.
put
(
"ntryRvslInd"
,
Boolean
.
valueOf
(
ntryRvslInd
));
}
String
ntrySts
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").Sts.Cd"
);
if
(
StringUtil
.
isNotEmpty
(
ntrySts
))
{
entryMaps
.
put
(
"ntrySts"
,
ntrySts
);
}
String
ntryStsPrtry
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").Sts.Prtry"
);
if
(
StringUtil
.
isNotEmpty
(
ntryStsPrtry
))
{
entryMaps
.
put
(
"ntryStsPrtry"
,
ntryStsPrtry
);
}
String
ntryBookgDt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").BookgDt.Dt"
);
if
(
StringUtil
.
isNotEmpty
(
ntryBookgDt
))
{
entryMaps
.
put
(
"ntryBookgDt"
,
ntryBookgDt
);
}
String
ntryValDt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").ValDt.Dt"
);
if
(
StringUtil
.
isNotEmpty
(
ntryValDt
))
{
entryMaps
.
put
(
"ntryValDt"
,
ntryValDt
);
}
String
ntryAcctSvcrRef
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").AcctSvcrRef"
);
if
(
StringUtil
.
isNotEmpty
(
ntryAcctSvcrRef
))
{
entryMaps
.
put
(
"ntryAcctSvcrRef"
,
ntryAcctSvcrRef
);
}
String
ntryBkTxCdDomnCd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").BkTxCd.Domn.Cd"
);
if
(
StringUtil
.
isNotEmpty
(
ntryBkTxCdDomnCd
))
{
entryMaps
.
put
(
"ntryBkTxCdDomnCd"
,
ntryBkTxCdDomnCd
);
}
String
ntryBkTxCdFmlyCd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").BkTxCd.Domn.Fmly.Cd"
);
if
(
StringUtil
.
isNotEmpty
(
ntryBkTxCdFmlyCd
))
{
entryMaps
.
put
(
"ntryBkTxCdFmlyCd"
,
ntryBkTxCdFmlyCd
);
}
String
ntryBkTxCdFmlySubFmlyCd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").BkTxCd.Domn.Fmly.SubFmlyCd"
);
if
(
StringUtil
.
isNotEmpty
(
ntryBkTxCdFmlySubFmlyCd
))
{
entryMaps
.
put
(
"ntryBkTxCdFmlySubFmlyCd"
,
ntryBkTxCdFmlySubFmlyCd
);
}
String
ntryBkTxCdPrtryCd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").BkTxCd.Prtry.Cd"
);
if
(
StringUtil
.
isNotEmpty
(
ntryBkTxCdPrtryCd
))
{
entryMaps
.
put
(
"ntryBkTxCdPrtryCd"
,
ntryBkTxCdPrtryCd
);
}
String
endToEndId
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").NtryDtls.TxDtls.Refs.EndToEndId"
);
if
(
StringUtil
.
isNotEmpty
(
endToEndId
))
{
entryMaps
.
put
(
"endToEndId"
,
endToEndId
);
}
String
addtlTxInf
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Ntry("
+
i
+
").NtryDtls.TxDtls.AddtlTxInf"
);
if
(
StringUtil
.
isNotEmpty
(
addtlTxInf
))
{
entryMaps
.
put
(
"addtlTxInf"
,
addtlTxInf
);
}
list
.
add
(
entryMaps
);
}
}
if
(
list
.
size
()>
0
){
return
list
;
}
else
{
return
null
;
}
}
catch
(
DocumentException
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
}
}
public
void
balance
(
String
type
){
try
{
Document
document
=
DocumentHelper
.
parseText
(
xmlStr
);
Map
<
String
,
String
>
parentElementMaps
=
XmlUtil
.
getParentElementMaps
(
document
);
String
bodyParentPath
=
parentElementMaps
.
get
(
"Stmt"
);
int
balCount
=
XmlUtil
.
getChildrenCount
(
document
,
bodyParentPath
+
".Stmt.Bal"
,
null
);
if
(
balCount
>
0
){
for
(
int
i
=
0
;
i
<
balCount
;
i
++)
{
String
balanceType
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Bal("
+
i
+
").Tp.CdOrPrtry.Cd"
);
if
(
StringUtil
.
isNotEmpty
(
type
)&&
type
.
equals
(
balanceType
))
{
balanceType
=
balanceType
.
toLowerCase
();
String
balSubType
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Bal("
+
i
+
").Tp.SubTp.Cd"
);
if
(
StringUtil
.
isNotEmpty
(
balSubType
)){
maps
.
put
(
balanceType
+
"BalSubType"
,
balSubType
);
}
String
balSubTypePrtry
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Bal("
+
i
+
").Tp.SubTp.Prtry"
);
if
(
StringUtil
.
isNotEmpty
(
balSubTypePrtry
)){
maps
.
put
(
balanceType
+
"BalSubTypePrtry"
,
balSubTypePrtry
);
}
String
balAmt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Bal("
+
i
+
").Amt"
);
if
(
StringUtil
.
isNotEmpty
(
balAmt
)){
maps
.
put
(
balanceType
+
"BalAmt"
,
new
BigDecimal
(
balAmt
));
}
String
balCcy
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Bal("
+
i
+
").Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
balCcy
)){
maps
.
put
(
balanceType
+
"BalCcy"
,
balCcy
);
}
String
balCdtDbtInd
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Bal("
+
i
+
").CdtDbtInd"
);
if
(
StringUtil
.
isNotEmpty
(
balCdtDbtInd
)){
maps
.
put
(
balanceType
+
"BalCdtDbtInd"
,
balCdtDbtInd
);
}
String
balDt
=
XmlUtil
.
getXmlNodeValue
(
document
,
bodyParentPath
+
".Stmt.Bal("
+
i
+
").Dt.Dt"
);
if
(
StringUtil
.
isNotEmpty
(
balDt
)){
maps
.
put
(
balanceType
+
"BalDt"
,
balDt
);
}
}
}
}
}
catch
(
DocumentException
e
)
{
throw
new
SwiftException
(
e
.
getMessage
());
}
}
}
swiftCore/src/main/resources/swiftXml/MxCamt05300108_950.xml
View file @
ca1f9a42
...
...
@@ -80,6 +80,18 @@ Change Log
<Dt>
2020-08-04
</Dt>
</Dt>
</Bal>
<Bal>
<Tp>
<CdOrPrtry>
<Cd>
CLAV
</Cd>
</CdOrPrtry>
</Tp>
<Amt
Ccy=
"EUR"
>
1234.21
</Amt>
<CdtDbtInd>
CRDT
</CdtDbtInd>
<Dt>
<Dt>
2020-08-04
</Dt>
</Dt>
</Bal>
<Ntry>
<Amt
Ccy=
"EUR"
>
65124.23
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
...
...
swiftCore/src/main/resources/template/camt053001.properties
0 → 100644
View file @
ca1f9a42
#APPLICATION HEADER
frBic
=
appHdr.fr.fiId.finInstnId.bicfi?appHdr.fr.orgId.id.orgId.anyBIC
toBic
=
appHdr.to.fiId.finInstnId.bicfi?appHdr.to.orgId.id.orgId.anyBIC
bizMsgIdr
=
bkToCstmrStmt.stmt.Id?bkToCstmrStmt.grpHdr.msgId?appHdr.bizMsgIdr
msgDefIdr
=
appHdr.msgDefIdr
bizSvc
=
appHdr.bizSvc
creDt
=
bkToCstmrStmt.grpHdr.creDtTm?appHdr.creDt
priority
=
appHdr.prty
#BODY
#25
acctIdIban
=
bkToCstmrStmt.stmt.acct.id.iban
acctId
=
bkToCstmrStmt.stmt.acct.id.othr.id
acctIdType
=
bkToCstmrStmt.stmt.acct.id.othr.schmeNm.cd
acctIdTypePrtry
=
bkToCstmrStmt.stmt.acct.id.othr.schmeNm.prtry
acctType
=
bkToCstmrStmt.stmt.acct.tp.cd.tp.prtry
acctTypePrtry
=
bkToCstmrStmt.stmt.acct
acctCcy
=
bkToCstmrStmt.stmt.acct.ccy
acctNm
=
bkToCstmrStmt.stmt.acct.nm
#28
lglSeqNb
=
bkToCstmrStmt.stmt.lglSeqNb&bigdecimal?bkToCstmrStmt.stmt.elctrncSeqNb&bigdecimal
pgNb
=
bkToCstmrStmt.stmt.stmtPgntn.pgNb
lastPgInd
=
bkToCstmrStmt.stmt.stmtPgntn.lastPgInd&boolean
#60
opbdBal
=
@buildOpbdBalance
#61
ntry
=
@bulidNtry
#62
clbdBal
=
@buildClbdBalance
#64
clavBal
=
@buildClavBalance
\ No newline at end of file
swiftCore/src/main/resources/template/pacs009001.properties
0 → 100644
View file @
ca1f9a42
This diff is collapsed.
Click to expand it.
swiftCore/src/test/java/com/brilliance/mx2element/camt053001/Test950.java
0 → 100644
View file @
ca1f9a42
package
com
.
brilliance
.
mx2element
.
camt053001
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
public
class
Test950
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05300108_950.xml"
);
//File file = new File("d:/test/MxPacs00800108.xml");
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
String
jsonStr
=
SwiftTransfer
.
mx2Element
(
xmlStr
);
System
.
out
.
println
(
jsonStr
);
}
}
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