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
be410ce5
Commit
be410ce5
authored
May 10, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加SwiftHeader,类似于ISO20022 AppHdr
2.增加TransactionReference,包含uetr,endToEndId等
parent
5c0f7831
Hide whitespace changes
Inline
Side-by-side
Showing
71 changed files
with
1109 additions
and
647 deletions
+1109
-647
pom.xml
pom.xml
+11
-0
SwiftTransfer.java
...ore/src/main/java/com/brilliance/swift/SwiftTransfer.java
+43
-3
AbstractMt2SwiftDtoCreator.java
...lliance/swift/mt2SwiftDto/AbstractMt2SwiftDtoCreator.java
+37
-35
AbstractMt2SwiftDtoParseFields.java
...nce/swift/mt2SwiftDto/AbstractMt2SwiftDtoParseFields.java
+3
-1
Mt2SwiftDtoPCamt053001Creator.java
...mt2SwiftDto/camt053001/Mt2SwiftDtoPCamt053001Creator.java
+12
-16
Camt053001Parse20Field.java
...t/mt2SwiftDto/camt053001/impl/Camt053001Parse20Field.java
+1
-1
Mt2SwiftDtoPCamt054001Creator.java
...mt2SwiftDto/camt054001/Mt2SwiftDtoPCamt054001Creator.java
+12
-16
Camt054001Parse20Field.java
...t/mt2SwiftDto/camt054001/impl/Camt054001Parse20Field.java
+2
-2
Camt054001Parse21Field.java
...t/mt2SwiftDto/camt054001/impl/Camt054001Parse21Field.java
+2
-2
Mt2SwiftDtoPacs008001Creator.java
.../mt2SwiftDto/pacs008001/Mt2SwiftDtoPacs008001Creator.java
+12
-16
Pacs00801Parse20Field.java
...ft/mt2SwiftDto/pacs008001/impl/Pacs00801Parse20Field.java
+2
-1
Pacs00801Parse71Field.java
...ft/mt2SwiftDto/pacs008001/impl/Pacs00801Parse71Field.java
+16
-8
Mt2SwiftDtoPacs009001Creator.java
.../mt2SwiftDto/pacs009001/Mt2SwiftDtoPacs009001Creator.java
+17
-15
Pacs009001Parse20Field.java
...t/mt2SwiftDto/pacs009001/impl/Pacs009001Parse20Field.java
+2
-1
Pacs009001Parse21Field.java
...t/mt2SwiftDto/pacs009001/impl/Pacs009001Parse21Field.java
+2
-2
AbstractMx2SwiftDtoCreator.java
...lliance/swift/mx2swiftdto/AbstractMx2SwiftDtoCreator.java
+36
-0
Mx2SwiftDtoBTCDCNCreator.java
...ift/mx2swiftdto/bankcdbcdnf/Mx2SwiftDtoBTCDCNCreator.java
+11
-33
Mx2SwiftDtoBTCSCreator.java
...e/swift/mx2swiftdto/bankcusta/Mx2SwiftDtoBTCSCreator.java
+11
-35
Mx2SwiftDtoCCTCreator.java
...e/swift/mx2swiftdto/custcdttsf/Mx2SwiftDtoCCTCreator.java
+26
-37
Mx2SwiftDtoFICTCreator.java
...ift/mx2swiftdto/fininstcdttsf/Mx2SwiftDtoFICTCreator.java
+10
-35
AbstractSwiftDto2MtCreator.java
...lliance/swift/swiftdto2mt/AbstractSwiftDto2MtCreator.java
+7
-10
SwiftDto2MtCreatorManager.java
...illiance/swift/swiftdto2mt/SwiftDto2MtCreatorManager.java
+1
-1
SwiftDto2Mt103Creator.java
...liance/swift/swiftdto2mt/mt103/SwiftDto2Mt103Creator.java
+20
-0
Tag20Generate.java
...rilliance/swift/swiftdto2mt/mt103/impl/Tag20Generate.java
+2
-2
Tag71Generate.java
...rilliance/swift/swiftdto2mt/mt103/impl/Tag71Generate.java
+14
-8
SwiftDto2Mt202Creator.java
...liance/swift/swiftdto2mt/mt202/SwiftDto2Mt202Creator.java
+7
-1
Tag20Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag20Generate.java
+2
-2
Tag21Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag21Generate.java
+4
-2
SwiftDto2Mt900910Creator.java
.../swift/swiftdto2mt/mt900910/SwiftDto2Mt900910Creator.java
+18
-0
Tag20Generate.java
...liance/swift/swiftdto2mt/mt900910/impl/Tag20Generate.java
+2
-2
Tag21Generate.java
...liance/swift/swiftdto2mt/mt900910/impl/Tag21Generate.java
+4
-2
SwiftDto2Mt940950Creator.java
.../swift/swiftdto2mt/mt940950/SwiftDto2Mt940950Creator.java
+17
-0
Tag20Generate.java
...liance/swift/swiftdto2mt/mt940950/impl/Tag20Generate.java
+2
-3
SwiftDto2MxCreatorManager.java
...illiance/swift/swiftdto2mx/SwiftDto2MxCreatorManager.java
+1
-1
SwiftDto2MxCamt053001Creator.java
...ftdto2mx/camt053001/v08/SwiftDto2MxCamt053001Creator.java
+17
-11
SwiftDto2MxCamt054001Creator.java
...ftdto2mx/camt054001/v08/SwiftDto2MxCamt054001Creator.java
+16
-13
SwiftDto2MxPacs008001Creator.java
...ftdto2mx/pacs008001/v09/SwiftDto2MxPacs008001Creator.java
+25
-24
SwiftDto2MxPacs009001Creator.java
...ftdto2mx/pacs009001/v09/SwiftDto2MxPacs009001Creator.java
+16
-12
XmlUtil.java
...Core/src/main/java/com/brilliance/swift/util/XmlUtil.java
+3
-3
BankToCustomerDebitCreditNotification.java
...iance/swift/vo/BankToCustomerDebitCreditNotification.java
+6
-5
BankToCustomerStatement.java
...java/com/brilliance/swift/vo/BankToCustomerStatement.java
+5
-5
SwiftDto.java
...tCore/src/main/java/com/brilliance/swift/vo/SwiftDto.java
+5
-75
SwiftDtoAdapter.java
...rc/main/java/com/brilliance/swift/vo/SwiftDtoAdapter.java
+2
-1
SwiftHeader.java
...re/src/main/java/com/brilliance/swift/vo/SwiftHeader.java
+123
-0
VoCustomerCreditTransfer.java
...ava/com/brilliance/swift/vo/VoCustomerCreditTransfer.java
+23
-9
VoFinancialInstitutionCreditTransfer.java
...liance/swift/vo/VoFinancialInstitutionCreditTransfer.java
+9
-9
ChargeInfo.java
.../main/java/com/brilliance/swift/vo/common/ChargeInfo.java
+24
-0
TransactionReference.java
.../com/brilliance/swift/vo/common/TransactionReference.java
+34
-0
BankToCustomerStatement.json
...src/main/resources/swiftJson/BankToCustomerStatement.json
+18
-23
BankToStatement.json
swiftCore/src/main/resources/swiftJson/BankToStatement.json
+16
-30
CustomerCreditTransfer.json
.../src/main/resources/swiftJson/CustomerCreditTransfer.json
+59
-33
FinancialInstitutionCreditTransfer.json
...sources/swiftJson/FinancialInstitutionCreditTransfer.json
+87
-33
FinancialInstitutionCreditTransfer_COV.json
...ces/swiftJson/FinancialInstitutionCreditTransfer_COV.json
+135
-32
MxCamt05300108_940.xml
swiftCore/src/main/resources/swiftXml/MxCamt05300108_940.xml
+8
-10
MxCamt05300108_950.xml
swiftCore/src/main/resources/swiftXml/MxCamt05300108_950.xml
+6
-8
MxPacs00800109.xml
swiftCore/src/main/resources/swiftXml/MxPacs00800109.xml
+4
-2
MxPacs00900109.xml
swiftCore/src/main/resources/swiftXml/MxPacs00900109.xml
+1
-1
MxPacs00900109_COV.xml
swiftCore/src/main/resources/swiftXml/MxPacs00900109_COV.xml
+1
-1
Test.java
...e/src/test/java/com/brilliance/mt2mx/pacs009001/Test.java
+7
-1
TestMx2MtFor103.java
...test/java/com/brilliance/mx2mt/mt103/TestMx2MtFor103.java
+1
-1
TestMx2MtFor202.java
...test/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202.java
+1
-1
TestMx2MtFor202COV.java
...t/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202COV.java
+1
-1
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt103/Test.java
+21
-0
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt202/Test.java
+35
-0
Test.java
...ore/src/test/java/com/brilliance/mx2mtmap/mt950/Test.java
+21
-0
Test940.java
...st/java/com/brilliance/mx2swiftdto/bankcusta/Test940.java
+1
-1
Test950.java
...st/java/com/brilliance/mx2swiftdto/bankcusta/Test950.java
+1
-1
Test.java
...test/java/com/brilliance/mx2swiftdto/custcdttsf/Test.java
+1
-1
Test.java
...t/java/com/brilliance/mx2swiftdto/fininstcdttsf/Test.java
+4
-4
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt202/Test.java
+2
-2
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt950/Test.java
+1
-1
No files found.
pom.xml
View file @
be410ce5
...
...
@@ -74,5 +74,15 @@
<artifactId>
spring-core
</artifactId>
<version>
5.0.5.RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.brilliance.swift
</groupId>
<artifactId>
eibs-container
</artifactId>
<version>
3.5.0
</version>
</dependency>
<dependency>
<groupId>
com.brilliance.swift
</groupId>
<artifactId>
eibs-ext
</artifactId>
<version>
1.0.0
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
swiftCore/src/main/java/com/brilliance/swift/SwiftTransfer.java
View file @
be410ce5
...
...
@@ -7,6 +7,7 @@ import com.brilliance.swift.swiftdto2mt.SwiftDto2MtCreatorManager;
import
com.brilliance.swift.swiftdto2mx.SwiftDto2MxCreatorManager
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.SwiftDto
;
import
com.prowidesoftware.swift.model.mx.AbstractMX
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
...
...
@@ -109,8 +110,7 @@ public class SwiftTransfer {
public
static
String
mx2Mt
(
File
file
,
String
outPutFilePath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
try
{
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
SwiftDto
swiftDto
=
new
Mx2SwiftDtoCreatorManager
().
convert
(
xmlStr
,
outPutFilePath
,
extraMap
);
return
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
swiftDto
,
outPutFilePath
,
null
);
return
mx2Mt
(
xmlStr
,
outPutFilePath
,
extraMap
);
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
...
...
@@ -119,7 +119,17 @@ public class SwiftTransfer {
public
static
String
mx2Mt
(
String
xmlStr
,
String
outPutFilePath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
SwiftDto
swiftDto
=
new
Mx2SwiftDtoCreatorManager
().
convert
(
xmlStr
,
outPutFilePath
,
extraMap
);
return
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
swiftDto
,
outPutFilePath
,
null
);
String
bnkBic
=
null
;
String
mtIoType
=
"O"
;
//代表是收报,默认值
if
(
extraMap
!=
null
)
{
bnkBic
=
(
String
)
extraMap
.
get
(
"bnkBic"
);
}
if
(
StringUtil
.
isNotEmpty
(
bnkBic
))
{
if
(
bnkBic
.
equals
(
swiftDto
.
getSwiftHeader
().
getSenderBic
()))
{
mtIoType
=
"I"
;
//如果发报行和本行bic一样,表示是发报
}
}
return
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
swiftDto
,
outPutFilePath
,
mtIoType
);
}
/**
...
...
@@ -140,4 +150,34 @@ public class SwiftTransfer {
return
new
SwiftDto2MxCreatorManager
().
swiftDto2Mx
(
swiftDto
,
outPutFilePath
);
}
/**
* swift xml输出mt 相关的map
* 用于邮储版本
* @param xmlStr
* @param extraMap
* @return
* @throws SwiftException
*/
public
static
Map
<
String
,
String
>
mx2MtMap
(
String
xmlStr
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
SwiftDto
swiftDto
=
new
Mx2SwiftDtoCreatorManager
().
convert
(
xmlStr
,
null
,
null
);
String
bnkBic
=
null
;
String
mtIoType
=
"O"
;
//代表是收报,默认值
if
(
extraMap
!=
null
)
{
bnkBic
=
(
String
)
extraMap
.
get
(
"bnkBic"
);
//得到本行的bicCode
}
if
(
StringUtil
.
isNotEmpty
(
bnkBic
))
{
if
(
bnkBic
.
equals
(
swiftDto
.
getSwiftHeader
().
getSenderBic
()))
{
mtIoType
=
"I"
;
//如果发报行和本行bic一样,表示是发报
}
}
String
mtStr
=
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
swiftDto
,
null
,
mtIoType
);
Map
<
String
,
String
>
maps
=
MessageReader
.
getSwfMsgInfoViaMsg
(
mtStr
);
maps
.
put
(
"std"
,
"MX"
);
AbstractMX
abstractMx
=
AbstractMX
.
parse
(
xmlStr
);
if
(
abstractMx
!=
null
)
{
maps
.
put
(
"xty"
,
abstractMx
.
getMxId
().
id
());
//ISO20022类型
}
return
maps
;
}
}
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/AbstractMt2SwiftDtoCreator.java
View file @
be410ce5
...
...
@@ -3,8 +3,9 @@ package com.brilliance.swift.mt2SwiftDto;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.Swift
Dto
;
import
com.brilliance.swift.vo.Swift
Header
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.util.Date
;
...
...
@@ -21,40 +22,41 @@ public abstract class AbstractMt2SwiftDtoCreator implements Mt2SwiftDtoCreator {
this
.
context
=
context
;
}
@Override
public
void
preProcess
()
throws
SwiftException
{
try
{
SwiftDto
swiftDto
=
new
SwiftDto
();
AbstractMT
abstractMT
=
context
.
get
(
AbstractMT
.
class
);
String
senderBic
=
abstractMT
.
getSender
();
if
(
senderBic
.
endsWith
(
Mx2MtConstants
.
BICSUFFIX
))
{
senderBic
=
senderBic
.
substring
(
0
,
8
);
}
else
{
senderBic
=
senderBic
.
substring
(
0
,
8
)
+
senderBic
.
substring
(
9
,
12
);
}
swiftDto
.
setSenderBic
(
senderBic
);
String
receiverBic
=
abstractMT
.
getReceiver
();
if
(
receiverBic
.
endsWith
(
Mx2MtConstants
.
BICSUFFIX
))
{
receiverBic
=
receiverBic
.
substring
(
0
,
8
);
}
else
{
receiverBic
=
receiverBic
.
substring
(
0
,
8
)
+
receiverBic
.
substring
(
9
,
12
);
}
swiftDto
.
setReceiverBic
(
receiverBic
);
swiftDto
.
setCreateDate
(
new
Date
());
String
priority
=
abstractMT
.
getMessagePriority
();
if
(
"N"
.
equals
(
priority
))
{
swiftDto
.
setMessagePriority
(
MessagePriority
.
NORM
);
}
else
if
(
"U"
.
equals
(
priority
)
||
"S"
.
equals
(
priority
))
{
swiftDto
.
setMessagePriority
(
MessagePriority
.
HIGH
);
}
String
uetr
=
abstractMT
.
getSwiftMessage
().
getUETR
();
if
(
StringUtil
.
isNotEmpty
(
uetr
))
{
swiftDto
.
setUetr
(
uetr
);
}
context
.
set
(
swiftDto
);
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
public
SwiftHeader
buildSwiftHeader
()
throws
SwiftException
{
SwiftHeader
swiftHeader
=
new
SwiftHeader
();
AbstractMT
abstractMT
=
context
.
get
(
AbstractMT
.
class
);
String
senderBic
=
abstractMT
.
getSender
();
if
(
senderBic
.
endsWith
(
Mx2MtConstants
.
BICSUFFIX
))
{
senderBic
=
senderBic
.
substring
(
0
,
8
);
}
else
{
senderBic
=
senderBic
.
substring
(
0
,
8
)
+
senderBic
.
substring
(
9
,
12
);
}
swiftHeader
.
setSenderBic
(
senderBic
);
String
receiverBic
=
abstractMT
.
getReceiver
();
if
(
receiverBic
.
endsWith
(
Mx2MtConstants
.
BICSUFFIX
))
{
receiverBic
=
receiverBic
.
substring
(
0
,
8
);
}
else
{
receiverBic
=
receiverBic
.
substring
(
0
,
8
)
+
receiverBic
.
substring
(
9
,
12
);
}
swiftHeader
.
setReceiverBic
(
receiverBic
);
swiftHeader
.
setCreateDate
(
new
Date
());
String
priority
=
abstractMT
.
getMessagePriority
();
if
(
"N"
.
equals
(
priority
))
{
swiftHeader
.
setMessagePriority
(
MessagePriority
.
NORM
);
}
else
if
(
"U"
.
equals
(
priority
)
||
"S"
.
equals
(
priority
))
{
swiftHeader
.
setMessagePriority
(
MessagePriority
.
HIGH
);
}
return
swiftHeader
;
}
public
TransactionReference
buildTxnRef
()
throws
SwiftException
{
TransactionReference
txnRef
=
new
TransactionReference
();
AbstractMT
abstractMT
=
context
.
get
(
AbstractMT
.
class
);
String
uetr
=
abstractMT
.
getSwiftMessage
().
getUETR
();
if
(
StringUtil
.
isNotEmpty
(
uetr
))
{
txnRef
.
setUetr
(
uetr
);
}
return
txnRef
;
}
}
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/AbstractMt2SwiftDtoParseFields.java
View file @
be410ce5
...
...
@@ -70,7 +70,9 @@ public abstract class AbstractMt2SwiftDtoParseFields implements Mt2SwiftDtoParse
if
(
account
.
length
()
>
3
&&
(
account
.
startsWith
(
"/C/"
)
||
account
.
startsWith
(
"/D/"
)))
{
account
=
account
.
substring
(
3
);
}
else
{
account
=
account
.
substring
(
1
);
if
(
account
.
startsWith
(
"/"
))
{
account
=
account
.
substring
(
1
);
}
}
if
(
SwiftTransferUtil
.
checkIbanAccount
(
account
))
{
partyAcct
.
setIbanAcct
(
account
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/Mt2SwiftDtoPCamt053001Creator.java
View file @
be410ce5
...
...
@@ -7,7 +7,8 @@ import com.brilliance.swift.mt2SwiftDto.Mt2SwiftDtoParseFields;
import
com.brilliance.swift.mt2SwiftDto.camt053001.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.SwiftDto
;
import
com.brilliance.swift.vo.SwiftHeader
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
java.io.File
;
import
java.util.ArrayList
;
...
...
@@ -20,21 +21,16 @@ import java.util.List;
public
class
Mt2SwiftDtoPCamt053001Creator
extends
AbstractMt2SwiftDtoCreator
{
@Override
public
void
preProcess
()
throws
SwiftException
{
try
{
super
.
preProcess
();
SwiftDto
swiftDto
=
context
.
get
(
SwiftDto
.
class
);
BankToCustomerStatement
bankToCustomerStatement
=
new
BankToCustomerStatement
();
bankToCustomerStatement
.
setSenderBic
(
swiftDto
.
getSenderBic
());
bankToCustomerStatement
.
setReceiverBic
(
swiftDto
.
getReceiverBic
());
bankToCustomerStatement
.
setCreateDate
(
swiftDto
.
getCreateDate
());
bankToCustomerStatement
.
setMessagePriority
(
swiftDto
.
getMessagePriority
());
bankToCustomerStatement
.
setUetr
(
swiftDto
.
getUetr
());
bankToCustomerStatement
.
setMessageType
(
"camt.053.001"
);
bankToCustomerStatement
.
setVersion
(
"08"
);
context
.
set
(
bankToCustomerStatement
);
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
SwiftHeader
swiftHeader
=
buildSwiftHeader
();
swiftHeader
.
setMessageDefId
(
"camt.053.001.09"
);
swiftHeader
.
setBusinessService
(
"swift.cbprplus.02"
);
swiftHeader
.
setMessageType
(
"camt.053.001"
);
swiftHeader
.
setVersion
(
"08"
);
BankToCustomerStatement
bankToCustomerStatement
=
new
BankToCustomerStatement
();
bankToCustomerStatement
.
setSwiftHeader
(
swiftHeader
);
TransactionReference
txnRef
=
buildTxnRef
();
bankToCustomerStatement
.
setTxnRef
(
txnRef
);
context
.
set
(
bankToCustomerStatement
);
}
@Override
public
List
<
Mt2SwiftDtoParseFields
>
getParseFieldsList
()
throws
SwiftException
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse20Field.java
View file @
be410ce5
...
...
@@ -19,7 +19,7 @@ public class Camt053001Parse20Field extends AbstractMt2SwiftDtoParseFields {
BankToCustomerStatement
bankToCustomerStatement
=
context
.
get
(
BankToCustomerStatement
.
class
);
Field20
field20
=
getField20
();
if
(
field20
!=
null
)
{
bankToCustomerStatement
.
setMessageId
(
field20
.
getValue
());
bankToCustomerStatement
.
getSwiftHeader
().
setMessageId
(
field20
.
getValue
());
}
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt054001/Mt2SwiftDtoPCamt054001Creator.java
View file @
be410ce5
...
...
@@ -7,7 +7,8 @@ import com.brilliance.swift.mt2SwiftDto.Mt2SwiftDtoParseFields;
import
com.brilliance.swift.mt2SwiftDto.camt054001.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerDebitCreditNotification
;
import
com.brilliance.swift.vo.SwiftDto
;
import
com.brilliance.swift.vo.SwiftHeader
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
java.io.File
;
import
java.util.ArrayList
;
...
...
@@ -21,21 +22,16 @@ public class Mt2SwiftDtoPCamt054001Creator extends AbstractMt2SwiftDtoCreator {
@Override
public
void
preProcess
()
throws
SwiftException
{
try
{
super
.
preProcess
();
SwiftDto
swiftDto
=
context
.
get
(
SwiftDto
.
class
);
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
new
BankToCustomerDebitCreditNotification
();
bankToCustomerDebitCreditNotification
.
setSenderBic
(
swiftDto
.
getSenderBic
());
bankToCustomerDebitCreditNotification
.
setReceiverBic
(
swiftDto
.
getReceiverBic
());
bankToCustomerDebitCreditNotification
.
setCreateDate
(
swiftDto
.
getCreateDate
());
bankToCustomerDebitCreditNotification
.
setMessagePriority
(
swiftDto
.
getMessagePriority
());
bankToCustomerDebitCreditNotification
.
setUetr
(
swiftDto
.
getUetr
());
bankToCustomerDebitCreditNotification
.
setMessageType
(
"camt.054.001"
);
bankToCustomerDebitCreditNotification
.
setVersion
(
"08"
);
context
.
set
(
bankToCustomerDebitCreditNotification
);
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
SwiftHeader
swiftHeader
=
buildSwiftHeader
();
swiftHeader
.
setMessageDefId
(
"camt.054.001.09"
);
swiftHeader
.
setBusinessService
(
"swift.cbprplus.02"
);
swiftHeader
.
setMessageType
(
"camt.054.001"
);
swiftHeader
.
setVersion
(
"08"
);
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
new
BankToCustomerDebitCreditNotification
();
bankToCustomerDebitCreditNotification
.
setSwiftHeader
(
swiftHeader
);
TransactionReference
txnRef
=
buildTxnRef
();
bankToCustomerDebitCreditNotification
.
setTxnRef
(
txnRef
);
context
.
set
(
bankToCustomerDebitCreditNotification
);
}
@Override
public
List
<
Mt2SwiftDtoParseFields
>
getParseFieldsList
()
throws
SwiftException
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt054001/impl/Camt054001Parse20Field.java
View file @
be410ce5
...
...
@@ -21,14 +21,14 @@ public class Camt054001Parse20Field extends AbstractMt2SwiftDtoParseFields {
MT900
mt900
=
(
MT900
)
context
.
get
(
AbstractMT
.
class
);
Field20
field20
=
mt900
.
getField20
();
if
(
field20
!=
null
){
bankToCustomerDebitCreditNotification
.
setMessageId
(
field20
.
getValue
());
bankToCustomerDebitCreditNotification
.
getSwiftHeader
().
setMessageId
(
field20
.
getValue
());
bankToCustomerDebitCreditNotification
.
setCdtDbtCode
(
"DBIT"
);
}
}
else
{
MT910
mt910
=
(
MT910
)
context
.
get
(
AbstractMT
.
class
);
Field20
field20
=
mt910
.
getField20
();
if
(
field20
!=
null
){
bankToCustomerDebitCreditNotification
.
setMessageId
(
field20
.
getValue
());
bankToCustomerDebitCreditNotification
.
getSwiftHeader
().
setMessageId
(
field20
.
getValue
());
bankToCustomerDebitCreditNotification
.
setCdtDbtCode
(
"CRDT"
);
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt054001/impl/Camt054001Parse21Field.java
View file @
be410ce5
...
...
@@ -21,13 +21,13 @@ public class Camt054001Parse21Field extends AbstractMt2SwiftDtoParseFields {
MT900
mt900
=
(
MT900
)
context
.
get
(
AbstractMT
.
class
);
Field21
field21
=
mt900
.
getField21
();
if
(
field21
!=
null
){
bankToCustomerDebitCreditNotification
.
setEndToEndId
(
field21
.
getValue
());
bankToCustomerDebitCreditNotification
.
getTxnRef
().
setEndToEndId
(
field21
.
getValue
());
}
}
else
{
MT910
mt910
=
(
MT910
)
context
.
get
(
AbstractMT
.
class
);
Field21
field21
=
mt910
.
getField21
();
if
(
field21
!=
null
){
bankToCustomerDebitCreditNotification
.
setEndToEndId
(
field21
.
getValue
());
bankToCustomerDebitCreditNotification
.
getTxnRef
().
setEndToEndId
(
field21
.
getValue
());
}
}
}
catch
(
Exception
e
){
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/pacs008001/Mt2SwiftDtoPacs008001Creator.java
View file @
be410ce5
...
...
@@ -6,8 +6,9 @@ import com.brilliance.swift.mt2SwiftDto.Mt2SwiftDtoContextIdentifier;
import
com.brilliance.swift.mt2SwiftDto.Mt2SwiftDtoParseFields
;
import
com.brilliance.swift.mt2SwiftDto.pacs008001.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.Swift
Dto
;
import
com.brilliance.swift.vo.Swift
Header
;
import
com.brilliance.swift.vo.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
java.io.File
;
import
java.util.ArrayList
;
...
...
@@ -19,21 +20,16 @@ public class Mt2SwiftDtoPacs008001Creator extends AbstractMt2SwiftDtoCreator {
@Override
public
void
preProcess
()
throws
SwiftException
{
try
{
super
.
preProcess
();
SwiftDto
swiftDto
=
context
.
get
(
SwiftDto
.
class
);
VoCustomerCreditTransfer
customerCreditTransfer
=
new
VoCustomerCreditTransfer
();
customerCreditTransfer
.
setSenderBic
(
swiftDto
.
getSenderBic
());
customerCreditTransfer
.
setReceiverBic
(
swiftDto
.
getReceiverBic
());
customerCreditTransfer
.
setCreateDate
(
swiftDto
.
getCreateDate
());
customerCreditTransfer
.
setMessagePriority
(
swiftDto
.
getMessagePriority
());
customerCreditTransfer
.
setUetr
(
swiftDto
.
getUetr
());
customerCreditTransfer
.
setMessageType
(
"pacs.008.001"
);
customerCreditTransfer
.
setVersion
(
"09"
);
context
.
set
(
customerCreditTransfer
);
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
SwiftHeader
swiftHeader
=
buildSwiftHeader
();
swiftHeader
.
setMessageDefId
(
"pacs.008.001.09"
);
swiftHeader
.
setBusinessService
(
"swift.cbprplus.02"
);
swiftHeader
.
setMessageType
(
"pacs.008.001"
);
swiftHeader
.
setVersion
(
"09"
);
VoCustomerCreditTransfer
customerCreditTransfer
=
new
VoCustomerCreditTransfer
();
customerCreditTransfer
.
setSwiftHeader
(
swiftHeader
);
TransactionReference
txnRef
=
buildTxnRef
();
customerCreditTransfer
.
setTxnRef
(
txnRef
);
context
.
set
(
customerCreditTransfer
);
}
@Override
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/pacs008001/impl/Pacs00801Parse20Field.java
View file @
be410ce5
...
...
@@ -15,7 +15,8 @@ public class Pacs00801Parse20Field extends AbstractMt2SwiftDtoParseFields {
MT103
mt103
=
(
MT103
)
context
.
get
(
AbstractMT
.
class
);
Field20
field20
=
mt103
.
getField20
();
if
(
field20
!=
null
)
{
customerCreditTransfer
.
setMessageId
(
field20
.
getValue
());
customerCreditTransfer
.
getSwiftHeader
().
setMessageId
(
field20
.
getValue
());
customerCreditTransfer
.
getTxnRef
().
setInstructionId
(
field20
.
getValue
());
}
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/pacs008001/impl/Pacs00801Parse71Field.java
View file @
be410ce5
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.mt2SwiftDto.AbstractMt2SwiftDtoParseFields;
import
com.brilliance.swift.vo.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.common.CcyFormatAmount
;
import
com.brilliance.swift.vo.common.ChargeForEnum
;
import
com.brilliance.swift.vo.common.ChargeInfo
;
import
com.prowidesoftware.swift.model.field.Field71A
;
import
com.prowidesoftware.swift.model.field.Field71F
;
import
com.prowidesoftware.swift.model.field.Field71G
;
...
...
@@ -30,21 +31,28 @@ public class Pacs00801Parse71Field extends AbstractMt2SwiftDtoParseFields {
customerCreditTransfer
.
setChargeFor
(
ChargeForEnum
.
SHAR
);
}
}
CcyFormatAmount
cfa
=
null
;
List
<
Field71F
>
field71FList
=
mt103
.
getField71F
();
if
(
field71FList
.
size
()
>
0
)
{
cfa
=
new
CcyFormatAmount
();
cfa
.
setCcy
(
field71FList
.
get
(
0
).
getCurrency
());
cfa
.
setAmt
(
field71FList
.
get
(
0
).
amount
());
for
(
Field71F
field71F
:
field71FList
)
{
ChargeInfo
chargeInfo
=
new
ChargeInfo
();
CcyFormatAmount
cfa
=
new
CcyFormatAmount
();
cfa
.
setCcy
(
field71F
.
getCurrency
());
cfa
.
setAmt
(
field71F
.
amount
());
chargeInfo
.
setAmt
(
cfa
);
chargeInfo
.
setPartyDto
(
customerCreditTransfer
.
getInstgAgtParty
());
customerCreditTransfer
.
addChargeInfo
(
chargeInfo
);
}
}
Field71G
field71G
=
mt103
.
getField71G
();
if
(
field71G
!=
null
)
{
cfa
=
new
CcyFormatAmount
();
ChargeInfo
chargeInfo
=
new
ChargeInfo
();
CcyFormatAmount
cfa
=
new
CcyFormatAmount
();
cfa
.
setCcy
(
field71G
.
getCurrency
());
cfa
.
setAmt
(
field71G
.
amount
());
}
if
(
cfa
!=
null
)
{
customerCreditTransfer
.
setChargeCcyFormatAmount
(
cfa
);
chargeInfo
.
setAmt
(
cfa
);
chargeInfo
.
setPartyDto
(
customerCreditTransfer
.
getInstdAgtParty
());
customerCreditTransfer
.
addChargeInfo
(
chargeInfo
);
}
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/pacs009001/Mt2SwiftDtoPacs009001Creator.java
View file @
be410ce5
...
...
@@ -7,8 +7,10 @@ import com.brilliance.swift.mt2SwiftDto.Mt2SwiftDtoParseFields;
import
com.brilliance.swift.mt2SwiftDto.pacs009001.impl.*
;
import
com.brilliance.swift.mt2SwiftDto.pacs009001.impl.cov.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.Swift
Dto
;
import
com.brilliance.swift.vo.Swift
Header
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
java.io.File
;
import
java.util.ArrayList
;
...
...
@@ -18,21 +20,21 @@ public class Mt2SwiftDtoPacs009001Creator extends AbstractMt2SwiftDtoCreator {
@Override
public
void
preProcess
()
throws
SwiftException
{
try
{
super
.
preProcess
();
SwiftDto
swiftDto
=
context
.
get
(
SwiftDto
.
class
);
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
new
VoFinancialInstitutionCreditTransfer
();
financialInstitutionCreditTransfer
.
setSenderBic
(
swiftDto
.
getSenderBic
());
financialInstitutionCreditTransfer
.
setReceiverBic
(
swiftDto
.
getReceiverBic
());
financialInstitutionCreditTransfer
.
setCreateDate
(
swiftDto
.
getCreateDate
());
financialInstitutionCreditTransfer
.
setMessagePriority
(
swiftDto
.
getMessagePriority
());
financialInstitutionCreditTransfer
.
setUetr
(
swiftDto
.
getUetr
());
financialInstitutionCreditTransfer
.
setMessageType
(
"pacs.009.001"
);
financialInstitutionCreditTransfer
.
setVersion
(
"09"
);
context
.
set
(
financialInstitutionCreditTransfer
);
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
SwiftHeader
swiftHeader
=
buildSwiftHeader
();
swiftHeader
.
setMessageDefId
(
"pacs.009.001.09"
);
AbstractMT
abstractMT
=
context
.
get
(
AbstractMT
.
class
);
if
(
abstractMT
.
getSwiftMessage
().
isCOV
())
{
swiftHeader
.
setBusinessService
(
"swift.cbprplus.cov.02"
);
}
else
{
swiftHeader
.
setBusinessService
(
"swift.cbprplus.02"
);
}
swiftHeader
.
setMessageType
(
"pacs.009.001"
);
swiftHeader
.
setVersion
(
"09"
);
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
new
VoFinancialInstitutionCreditTransfer
();
financialInstitutionCreditTransfer
.
setSwiftHeader
(
swiftHeader
);
TransactionReference
txnRef
=
buildTxnRef
();
financialInstitutionCreditTransfer
.
setTxnRef
(
txnRef
);
context
.
set
(
financialInstitutionCreditTransfer
);
}
@Override
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/pacs009001/impl/Pacs009001Parse20Field.java
View file @
be410ce5
...
...
@@ -15,7 +15,8 @@ public class Pacs009001Parse20Field extends AbstractMt2SwiftDtoParseFields {
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
context
.
get
(
VoFinancialInstitutionCreditTransfer
.
class
);
Field20
field20
=
getField20
();
if
(
field20
!=
null
)
{
financialInstitutionCreditTransfer
.
setMessageId
(
field20
.
getValue
());
financialInstitutionCreditTransfer
.
getSwiftHeader
().
setMessageId
(
field20
.
getValue
());
financialInstitutionCreditTransfer
.
getTxnRef
().
setInstructionId
(
field20
.
getValue
());
}
}
catch
(
Exception
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/pacs009001/impl/Pacs009001Parse21Field.java
View file @
be410ce5
...
...
@@ -17,9 +17,9 @@ public class Pacs009001Parse21Field extends AbstractMt2SwiftDtoParseFields {
Field21
field21
=
getField21
();
if
(
field21
!=
null
)
{
if
(
Mx2MtConstants
.
MT_21_DEFAULT_VALUE
.
equals
(
field21
.
getValue
()))
{
financialInstitutionCreditTransfer
.
setEndToEndId
(
Mx2MtConstants
.
MX_END_TO_END_ID_DEFAULT_VALUE
);
financialInstitutionCreditTransfer
.
getTxnRef
().
setEndToEndId
(
Mx2MtConstants
.
MX_END_TO_END_ID_DEFAULT_VALUE
);
}
else
{
financialInstitutionCreditTransfer
.
setEndToEndId
(
field21
.
getValue
());
financialInstitutionCreditTransfer
.
getTxnRef
().
setEndToEndId
(
field21
.
getValue
());
}
}
}
catch
(
Exception
e
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2swiftdto/AbstractMx2SwiftDtoCreator.java
View file @
be410ce5
...
...
@@ -4,9 +4,13 @@ import com.brilliance.swift.exception.SwiftException;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.util.XmlUtil
;
import
com.brilliance.swift.vo.SwiftHeader
;
import
com.brilliance.swift.vo.common.*
;
import
org.dom4j.Document
;
import
javax.xml.datatype.DatatypeConfigurationException
;
import
javax.xml.datatype.DatatypeFactory
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
...
...
@@ -29,10 +33,42 @@ public abstract class AbstractMx2SwiftDtoCreator implements Mx2SwiftDtoCreator{
protected
String
bodyHdrParentElementName
;
protected
SwiftHeader
swiftHeader
;
protected
String
defaultFormate
=
"yyyy-MM-dd HH:mm:ss,SSS"
;
protected
String
defaultDateFormate
=
"yyyy-MM-dd"
;
@Override
public
void
appHeader
()
throws
SwiftException
{
try
{
swiftHeader
=
new
SwiftHeader
();
String
sendBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.Fr.FIId.FinInstnId"
);
swiftHeader
.
setSenderBic
(
sendBicCode
);
String
receiverBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.To.FIId.FinInstnId"
);
swiftHeader
.
setReceiverBic
(
receiverBicCode
);
String
createDateStr
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.CreDt"
);
if
(
StringUtil
.
isNotEmpty
(
createDateStr
))
{
XMLGregorianCalendar
createDt
=
DatatypeFactory
.
newInstance
().
newXMLGregorianCalendar
(
createDateStr
);
Date
createDate
=
DateUtil
.
formatAndParseDate
(
createDt
.
toGregorianCalendar
().
getTime
(),
defaultFormate
);
swiftHeader
.
setCreateDate
(
createDate
);
}
String
messageId
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.BizMsgIdr"
);
swiftHeader
.
setMessageId
(
messageId
);
String
priority
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.Prty"
);
if
(
StringUtil
.
isNotEmpty
(
priority
))
{
swiftHeader
.
setMessagePriority
(
MessagePriority
.
fromValue
(
priority
));
}
String
messageDefId
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.MsgDefIdr"
);
swiftHeader
.
setMessageDefId
(
messageDefId
);
String
businessService
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.BizSvc"
);
swiftHeader
.
setBusinessService
(
businessService
);
}
catch
(
DatatypeConfigurationException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
catch
(
ParseException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
protected
String
getXmlNodeValue
(
String
parentPath
,
Document
document
,
String
path
)
{
if
(
StringUtil
.
isNotEmpty
(
parentPath
))
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2swiftdto/bankcdbcdnf/Mx2SwiftDtoBTCDCNCreator.java
View file @
be410ce5
...
...
@@ -34,35 +34,15 @@ public class Mx2SwiftDtoBTCDCNCreator extends AbstractMx2SwiftDtoCreator {
grpHdrParentElementName
=
parentElementMaps
.
get
(
"GrpHdr"
);
bodyHdrParentElementName
=
parentElementMaps
.
get
(
"Ntfctn"
);
bankToCustomerDebitCreditNotification
=
new
BankToCustomerDebitCreditNotification
();
bankToCustomerDebitCreditNotification
.
setMessageType
(
"camt.054.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
bankToCustomerDebitCreditNotification
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"08"
:
version
);
}
@Override
public
void
appHeader
()
throws
SwiftException
{
try
{
String
sendBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.Fr.FIId.FinInstnId"
);
String
receiverBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.To.FIId.FinInstnId"
);
String
createDateStr
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.CreDt"
);
if
(
StringUtil
.
isNotEmpty
(
createDateStr
))
{
XMLGregorianCalendar
createDt
=
DatatypeFactory
.
newInstance
().
newXMLGregorianCalendar
(
createDateStr
);
Date
createDate
=
DateUtil
.
formatAndParseDate
(
createDt
.
toGregorianCalendar
().
getTime
(),
defaultFormate
);
bankToCustomerDebitCreditNotification
.
setCreateDate
(
createDate
);
}
String
messageId
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.BizMsgIdr"
);
String
priority
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.Prty"
);
if
(
StringUtil
.
isNotEmpty
(
priority
))
{
bankToCustomerDebitCreditNotification
.
setMessagePriority
(
MessagePriority
.
fromValue
(
priority
));
}
bankToCustomerDebitCreditNotification
.
setMessageId
(
messageId
);
bankToCustomerDebitCreditNotification
.
setSenderBic
(
sendBicCode
);
bankToCustomerDebitCreditNotification
.
setReceiverBic
(
receiverBicCode
);
}
catch
(
DatatypeConfigurationException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
catch
(
ParseException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
super
.
appHeader
();
swiftHeader
.
setMessageType
(
"camt.054.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
swiftHeader
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"08"
:
version
);
bankToCustomerDebitCreditNotification
.
setSwiftHeader
(
swiftHeader
);
}
@Override
...
...
@@ -75,14 +55,12 @@ public class Mx2SwiftDtoBTCDCNCreator extends AbstractMx2SwiftDtoCreator {
try
{
String
cdtDbtInd
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Ntfctn.Ntry.CdtDbtInd"
);
bankToCustomerDebitCreditNotification
.
setCdtDbtCode
(
cdtDbtInd
);
//UETR
String
uetr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Ntfctn.Ntry.NtryDtls.TxDtls.Refs.UETR"
);
if
(
StringUtil
.
isNotEmpty
(
uetr
))
{
bankToCustomerDebitCreditNotification
.
setUetr
(
uetr
);
}
//<Ntfctn><Ntry><NtryDtls><TxDtls><Refs><EndToEndId>
String
endToEndId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Ntfctn.Ntry.NtryDtls.TxDtls.Refs.EndToEndId"
);
bankToCustomerDebitCreditNotification
.
setEndToEndId
(
endToEndId
);
TransactionReference
txnRef
=
new
TransactionReference
();
txnRef
.
setInstructionId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Ntfctn.Ntry.NtryDtls.TxDtls.Refs.InstrId"
));
txnRef
.
setEndToEndId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Ntfctn.Ntry.NtryDtls.TxDtls.Refs.EndToEndId"
));
txnRef
.
setUetr
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Ntfctn.Ntry.NtryDtls.TxDtls.Refs.UETR"
));
bankToCustomerDebitCreditNotification
.
setTxnRef
(
txnRef
);
//<Ntfctn><Acct><Id><IBAN>
//<Ntfctn><Acct><Id><<Othr><Id>
String
iban
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Ntfctn.Acct.Id.IBAN"
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2swiftdto/bankcusta/Mx2SwiftDtoBTCSCreator.java
View file @
be410ce5
...
...
@@ -10,14 +10,10 @@ import com.brilliance.swift.vo.BankToCustomerStatement;
import
com.brilliance.swift.vo.common.*
;
import
org.dom4j.Document
;
import
javax.xml.datatype.DatatypeConfigurationException
;
import
javax.xml.datatype.DatatypeFactory
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.io.File
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -34,35 +30,15 @@ public class Mx2SwiftDtoBTCSCreator extends AbstractMx2SwiftDtoCreator {
grpHdrParentElementName
=
parentElementMaps
.
get
(
"GrpHdr"
);
bodyHdrParentElementName
=
parentElementMaps
.
get
(
"Stmt"
);
bankToCustomerStatement
=
new
BankToCustomerStatement
();
bankToCustomerStatement
.
setMessageType
(
"camt.053.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
bankToCustomerStatement
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"08"
:
version
);
}
@Override
public
void
appHeader
()
throws
SwiftException
{
try
{
String
sendBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.Fr.FIId.FinInstnId"
);
String
receiverBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.To.FIId.FinInstnId"
);
String
createDateStr
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.CreDt"
);
if
(
StringUtil
.
isNotEmpty
(
createDateStr
))
{
XMLGregorianCalendar
createDt
=
DatatypeFactory
.
newInstance
().
newXMLGregorianCalendar
(
createDateStr
);
Date
createDate
=
DateUtil
.
formatAndParseDate
(
createDt
.
toGregorianCalendar
().
getTime
(),
defaultFormate
);
bankToCustomerStatement
.
setCreateDate
(
createDate
);
}
String
messageId
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.BizMsgIdr"
);
String
priority
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.Prty"
);
if
(
StringUtil
.
isNotEmpty
(
priority
))
{
bankToCustomerStatement
.
setMessagePriority
(
MessagePriority
.
fromValue
(
priority
));
}
bankToCustomerStatement
.
setMessageId
(
messageId
);
bankToCustomerStatement
.
setSenderBic
(
sendBicCode
);
bankToCustomerStatement
.
setReceiverBic
(
receiverBicCode
);
}
catch
(
DatatypeConfigurationException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
catch
(
ParseException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
super
.
appHeader
();
swiftHeader
.
setMessageType
(
"camt.053.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
swiftHeader
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"08"
:
version
);
bankToCustomerStatement
.
setSwiftHeader
(
swiftHeader
);
}
@Override
...
...
@@ -74,12 +50,12 @@ public class Mx2SwiftDtoBTCSCreator extends AbstractMx2SwiftDtoCreator {
@Override
public
void
messageBody
()
throws
SwiftException
{
try
{
//UETR
String
uetr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.Ntry.NtryDtls.TxDtls.Refs.UETR"
);
bankToCustomerStatement
.
setUetr
(
uetr
);
//EndToEndId
//String endToEndId = getXmlNodeValue(bodyHdrParentElementName, document, "Stmt.Ntry.NtryDtls.TxDtls.Refs.EndToEndId"
);
//bankToCustomerStatement.setEndToEndId(endToEndId);
TransactionReference
txnRef
=
new
TransactionReference
();
txnRef
.
setInstructionId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.Ntry.NtryDtls.TxDtls.Refs.InstrId"
)
);
txnRef
.
setEndToEndId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.Ntry.NtryDtls.TxDtls.Refs.EndToEndId"
)
);
txnRef
.
setUetr
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"Stmt.Ntry.NtryDtls.TxDtls.Refs.UETR"
));
bankToCustomerStatement
.
setTxnRef
(
txnRef
);
PartyAccount
account
=
acctConvertPartyAcct
(
bodyHdrParentElementName
,
document
,
"Stmt.Acct"
);
bankToCustomerStatement
.
setAccount
(
account
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2swiftdto/custcdttsf/Mx2SwiftDtoCCTCreator.java
View file @
be410ce5
...
...
@@ -37,35 +37,15 @@ public class Mx2SwiftDtoCCTCreator extends AbstractMx2SwiftDtoCreator {
grpHdrParentElementName
=
parentElementMaps
.
get
(
"GrpHdr"
);
bodyHdrParentElementName
=
parentElementMaps
.
get
(
"CdtTrfTxInf"
);
customerCreditTransfer
=
new
VoCustomerCreditTransfer
();
customerCreditTransfer
.
setMessageType
(
"pacs.008.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
customerCreditTransfer
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"09"
:
version
);
}
@Override
public
void
appHeader
()
throws
SwiftException
{
try
{
String
sendBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.Fr.FIId.FinInstnId"
);
String
receiverBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.To.FIId.FinInstnId"
);
String
createDateStr
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.CreDt"
);
if
(
StringUtil
.
isNotEmpty
(
createDateStr
))
{
XMLGregorianCalendar
createDt
=
DatatypeFactory
.
newInstance
().
newXMLGregorianCalendar
(
createDateStr
);
Date
createDate
=
DateUtil
.
formatAndParseDate
(
createDt
.
toGregorianCalendar
().
getTime
(),
defaultFormate
);
customerCreditTransfer
.
setCreateDate
(
createDate
);
}
String
messageId
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.BizMsgIdr"
);
String
priority
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.Prty"
);
if
(
StringUtil
.
isNotEmpty
(
priority
))
{
customerCreditTransfer
.
setMessagePriority
(
MessagePriority
.
fromValue
(
priority
));
}
customerCreditTransfer
.
setMessageId
(
messageId
);
customerCreditTransfer
.
setSenderBic
(
sendBicCode
);
customerCreditTransfer
.
setReceiverBic
(
receiverBicCode
);
}
catch
(
DatatypeConfigurationException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
catch
(
ParseException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
super
.
appHeader
();
swiftHeader
.
setMessageType
(
"pacs.008.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
swiftHeader
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"09"
:
version
);
customerCreditTransfer
.
setSwiftHeader
(
swiftHeader
);
}
@Override
...
...
@@ -83,11 +63,12 @@ public class Mx2SwiftDtoCCTCreator extends AbstractMx2SwiftDtoCreator {
@Override
public
void
messageBody
()
throws
SwiftException
{
try
{
//UETR
String
uetr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.UETR"
);
if
(
StringUtil
.
isNotEmpty
(
uetr
))
{
customerCreditTransfer
.
setUetr
(
uetr
);
}
TransactionReference
txnRef
=
new
TransactionReference
();
txnRef
.
setInstructionId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.InstrId"
));
txnRef
.
setEndToEndId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.EndToEndId"
));
txnRef
.
setUetr
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.UETR"
));
customerCreditTransfer
.
setTxnRef
(
txnRef
);
//party
PartyDto
debitParty
=
convertPartyDto
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.Dbtr"
,
"CdtTrfTxInf.DbtrAcct"
);
PartyDto
debitAgtParty
=
agtConvertPartyDto
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.DbtrAgt"
,
"CdtTrfTxInf.DbtrAgtAcct"
);
...
...
@@ -198,13 +179,21 @@ public class Mx2SwiftDtoCCTCreator extends AbstractMx2SwiftDtoCreator {
if
(
StringUtil
.
isNotEmpty
(
chrgBr
))
{
customerCreditTransfer
.
setChargeFor
(
ChargeForEnum
.
valueOf
(
chrgBr
));
}
String
chrgAmtStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.ChrgsInf"
);
String
chrgCcy
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.ChrgsInf@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
chrgCcy
)
&&
StringUtil
.
isNotEmpty
(
chrgAmtStr
))
{
CcyFormatAmount
chrgCfa
=
new
CcyFormatAmount
();
chrgCfa
.
setCcy
(
chrgCcy
);
chrgCfa
.
setAmt
(
new
BigDecimal
(
chrgAmtStr
));
customerCreditTransfer
.
setChargeCcyFormatAmount
(
chrgCfa
);
int
chargeInfoCount
=
getXmlNodeCounts
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.ChrgsInf"
);
if
(
chargeInfoCount
>
0
)
{
for
(
int
i
=
0
;
i
<
chargeInfoCount
;
i
++)
{
ChargeInfo
chargeInfo
=
new
ChargeInfo
();
String
chrgAmtStr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.ChrgsInf("
+
i
+
").Amt"
);
String
chrgCcy
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.ChrgsInf("
+
i
+
").Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
chrgCcy
)
&&
StringUtil
.
isNotEmpty
(
chrgAmtStr
))
{
CcyFormatAmount
chrgCfa
=
new
CcyFormatAmount
();
chrgCfa
.
setCcy
(
chrgCcy
);
chrgCfa
.
setAmt
(
new
BigDecimal
(
chrgAmtStr
));
chargeInfo
.
setAmt
(
chrgCfa
);
}
chargeInfo
.
setPartyDto
(
agtConvertPartyDto
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.ChrgsInf("
+
i
+
").Agt"
,
null
));
customerCreditTransfer
.
addChargeInfo
(
chargeInfo
);
}
}
//InstructionForCreditAgent
String
instForCdtAgentCode
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.InstrForCdtrAgt.Cd"
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2swiftdto/fininstcdttsf/Mx2SwiftDtoFICTCreator.java
View file @
be410ce5
...
...
@@ -33,35 +33,15 @@ public class Mx2SwiftDtoFICTCreator extends AbstractMx2SwiftDtoCreator {
grpHdrParentElementName
=
parentElementMaps
.
get
(
"GrpHdr"
);
bodyHdrParentElementName
=
parentElementMaps
.
get
(
"CdtTrfTxInf"
);
financialInstitutionCreditTransfer
=
new
VoFinancialInstitutionCreditTransfer
();
financialInstitutionCreditTransfer
.
setMessageType
(
"pacs.009.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
financialInstitutionCreditTransfer
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"09"
:
version
);
}
@Override
public
void
appHeader
()
throws
SwiftException
{
try
{
String
sendBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.Fr.FIId.FinInstnId"
);
String
receiverBicCode
=
getBicCode
(
appHdrParentElementName
,
document
,
"AppHdr.To.FIId.FinInstnId"
);
String
createDateStr
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.CreDt"
);
if
(
StringUtil
.
isNotEmpty
(
createDateStr
))
{
XMLGregorianCalendar
createDt
=
DatatypeFactory
.
newInstance
().
newXMLGregorianCalendar
(
createDateStr
);
Date
createDate
=
DateUtil
.
formatAndParseDate
(
createDt
.
toGregorianCalendar
().
getTime
(),
defaultFormate
);
financialInstitutionCreditTransfer
.
setCreateDate
(
createDate
);
}
String
messageId
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.BizMsgIdr"
);
String
priority
=
getXmlNodeValue
(
appHdrParentElementName
,
document
,
"AppHdr.Prty"
);
if
(
StringUtil
.
isNotEmpty
(
priority
))
{
financialInstitutionCreditTransfer
.
setMessagePriority
(
MessagePriority
.
fromValue
(
priority
));
}
financialInstitutionCreditTransfer
.
setMessageId
(
messageId
);
financialInstitutionCreditTransfer
.
setSenderBic
(
sendBicCode
);
financialInstitutionCreditTransfer
.
setReceiverBic
(
receiverBicCode
);
}
catch
(
DatatypeConfigurationException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
catch
(
ParseException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
super
.
appHeader
();
swiftHeader
.
setMessageType
(
"pacs.009.001"
);
String
version
=
(
String
)
context
.
get
(
Mx2SwiftDtoContextIdentifier
.
MX_VERSION
,
true
);
swiftHeader
.
setVersion
(
StringUtil
.
isEmpty
(
version
)?
"09"
:
version
);
financialInstitutionCreditTransfer
.
setSwiftHeader
(
swiftHeader
);
}
@Override
...
...
@@ -77,16 +57,11 @@ public class Mx2SwiftDtoFICTCreator extends AbstractMx2SwiftDtoCreator {
@Override
public
void
messageBody
()
throws
SwiftException
{
try
{
//UETR
String
uetr
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.UETR"
);
if
(
StringUtil
.
isNotEmpty
(
uetr
))
{
financialInstitutionCreditTransfer
.
setUetr
(
uetr
);
}
//EndToEndId
String
endToEndId
=
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.EndToEndId"
);
if
(
StringUtil
.
isNotEmpty
(
uetr
))
{
financialInstitutionCreditTransfer
.
setEndToEndId
(
endToEndId
);
}
TransactionReference
txnRef
=
new
TransactionReference
();
txnRef
.
setInstructionId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.InstrId"
));
txnRef
.
setEndToEndId
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.EndToEndId"
));
txnRef
.
setUetr
(
getXmlNodeValue
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.PmtId.UETR"
));
financialInstitutionCreditTransfer
.
setTxnRef
(
txnRef
);
//party
PartyDto
debitParty
=
agtConvertPartyDto
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.Dbtr"
,
"CdtTrfTxInf.DbtrAcct"
);
PartyDto
intrmyAgtParty
=
agtConvertPartyDto
(
bodyHdrParentElementName
,
document
,
"CdtTrfTxInf.IntrmyAgt1"
,
"CdtTrfTxInf.IntrmyAgt1Acct"
);
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/AbstractSwiftDto2MtCreator.java
View file @
be410ce5
...
...
@@ -71,9 +71,9 @@ public abstract class AbstractSwiftDto2MtCreator implements SwiftDto2MtCreator{
SwiftDto
swiftDto
=
(
SwiftDto
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
);
String
mtIoType
=
(
String
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
MT_IO_TYPE
,
true
);
if
(
"O"
.
equalsIgnoreCase
(
mtIoType
))
{
block1
.
setLogicalTerminal
(
processBicCode
(
swiftDto
.
getReceiverBic
()));
block1
.
setLogicalTerminal
(
processBicCode
(
swiftDto
.
get
SwiftHeader
().
get
ReceiverBic
()));
}
else
{
block1
.
setLogicalTerminal
(
processBicCode
(
swiftDto
.
getSenderBic
()));
block1
.
setLogicalTerminal
(
processBicCode
(
swiftDto
.
getS
wiftHeader
().
getS
enderBic
()));
}
block1
.
setSessionNumber
(
getRandomNumber
(
4
));
block1
.
setSequenceNumber
(
getRandomNumber
(
6
));
...
...
@@ -84,13 +84,13 @@ public abstract class AbstractSwiftDto2MtCreator implements SwiftDto2MtCreator{
public
void
withBlock2
()
throws
SwiftException
{
SwiftDto
swiftDto
=
(
SwiftDto
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
);
String
mtIoType
=
(
String
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
MT_IO_TYPE
,
true
);
String
messagePriority
=
MessagePriority
.
NORM
.
equals
(
swiftDto
.
getMessagePriority
())
?
"N"
:
"U"
;
String
messagePriority
=
MessagePriority
.
NORM
.
equals
(
swiftDto
.
get
SwiftHeader
().
get
MessagePriority
())
?
"N"
:
"U"
;
if
(
"O"
.
equalsIgnoreCase
(
mtIoType
))
{
SwiftBlock2Output
block2
=
new
SwiftBlock2Output
();
block2
.
setMessageType
(
getMtType
());
block2
.
setSenderInputTime
(
DateUtil
.
format
(
swiftDto
.
getCreateDate
(),
"HHmm"
));
block2
.
setMIRDate
(
DateUtil
.
format
(
swiftDto
.
getCreateDate
(),
"yyMMdd"
));
block2
.
setMIRLogicalTerminal
(
processBicCode
(
swiftDto
.
getSenderBic
()));
block2
.
setSenderInputTime
(
DateUtil
.
format
(
swiftDto
.
get
SwiftHeader
().
get
CreateDate
(),
"HHmm"
));
block2
.
setMIRDate
(
DateUtil
.
format
(
swiftDto
.
get
SwiftHeader
().
get
CreateDate
(),
"yyMMdd"
));
block2
.
setMIRLogicalTerminal
(
processBicCode
(
swiftDto
.
getS
wiftHeader
().
getS
enderBic
()));
block2
.
setMIRSessionNumber
(
getRandomNumber
(
4
));
block2
.
setMIRSequenceNumber
(
getRandomNumber
(
6
));
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -101,7 +101,7 @@ public abstract class AbstractSwiftDto2MtCreator implements SwiftDto2MtCreator{
}
else
{
SwiftBlock2Input
block2
=
new
SwiftBlock2Input
();
block2
.
setMessageType
(
getMtType
());
block2
.
setReceiverAddress
(
processBicCode
(
swiftDto
.
getReceiverBic
()));
block2
.
setReceiverAddress
(
processBicCode
(
swiftDto
.
get
SwiftHeader
().
get
ReceiverBic
()));
block2
.
setMessagePriority
(
messagePriority
);
context
.
get
(
SwiftMessage
.
class
).
setBlock2
(
block2
);
}
...
...
@@ -113,9 +113,6 @@ public abstract class AbstractSwiftDto2MtCreator implements SwiftDto2MtCreator{
List
<
Tag
>
tags
=
new
ArrayList
<>();
SwiftBlock3
block3
=
new
SwiftBlock3
();
tags
.
add
(
new
Tag
(
"108"
,
new
SimpleDateFormat
(
"yyMMddHHmmssSSSS"
).
format
(
Calendar
.
getInstance
().
getTime
())));
if
(
StringUtil
.
isNotEmpty
(
swiftDto
.
getUetr
()))
{
tags
.
add
(
new
Tag
(
"121"
,
swiftDto
.
getUetr
()));
}
block3
.
setTags
(
tags
);
context
.
get
(
SwiftMessage
.
class
).
setBlock3
(
block3
);
}
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/SwiftDto2MtCreatorManager.java
View file @
be410ce5
...
...
@@ -15,7 +15,7 @@ public class SwiftDto2MtCreatorManager {
context
.
set
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
swiftDto
);
context
.
set
(
SwiftDto2MtContextIdentifier
.
MT_OUTPUT_FILE_PATH
,
fileOutputPath
);
context
.
set
(
SwiftDto2MtContextIdentifier
.
MT_IO_TYPE
,
StringUtil
.
isEmpty
(
mtIoType
)?
"O"
:
mtIoType
);
AbstractSwiftDto2MtCreator
creator
=
getCreator
(
swiftDto
.
getMessageType
());
AbstractSwiftDto2MtCreator
creator
=
getCreator
(
swiftDto
.
get
SwiftHeader
().
get
MessageType
());
creator
.
setContext
(
context
);
creator
.
preProcess
();
creator
.
withBlock1
();
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt103/SwiftDto2Mt103Creator.java
View file @
be410ce5
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt103
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtCreator
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.mt103.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.SwiftBlock3
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
SwiftDto2Mt103Creator
extends
AbstractSwiftDto2MtCreator
{
@Override
public
void
withBlock3
()
throws
SwiftException
{
super
.
withBlock3
();
SwiftBlock3
block3
=
context
.
get
(
SwiftMessage
.
class
).
getBlock3
();
VoCustomerCreditTransfer
customerCreditTransfer
=
(
VoCustomerCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
TransactionReference
txnRef
=
customerCreditTransfer
.
getTxnRef
();
if
(
txnRef
!=
null
&&
StringUtil
.
isNotEmpty
(
txnRef
.
getUetr
()))
{
block3
.
getTags
().
add
(
new
Tag
(
"121"
,
txnRef
.
getUetr
()));
}
}
@Override
public
List
<
SwiftDto2MtTagGenerate
>
getGenerateTagList
()
{
List
<
SwiftDto2MtTagGenerate
>
list
=
new
ArrayList
<>();
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt103/impl/Tag20Generate.java
View file @
be410ce5
...
...
@@ -20,8 +20,8 @@ public class Tag20Generate extends AbstractSwiftDto2MtTagGenerate {
VoCustomerCreditTransfer
customerCreditTransfer
=
(
VoCustomerCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
StringUtil
.
isNotEmpty
(
customerCreditTransfer
.
getMessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
customerCreditTransfer
.
getMessageId
()));
if
(
StringUtil
.
isNotEmpty
(
customerCreditTransfer
.
get
SwiftHeader
().
get
MessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
customerCreditTransfer
.
get
SwiftHeader
().
get
MessageId
()));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt103/impl/Tag71Generate.java
View file @
be410ce5
...
...
@@ -6,6 +6,7 @@ import com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier;
import
com.brilliance.swift.util.NumberUtil
;
import
com.brilliance.swift.vo.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.common.CcyFormatAmount
;
import
com.brilliance.swift.vo.common.ChargeInfo
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mx.dic.ChargeBearerType1Code
;
...
...
@@ -35,14 +36,19 @@ public class Tag71Generate extends AbstractSwiftDto2MtTagGenerate {
value
=
"SHA"
;
}
tags
.
add
(
new
Tag
(
name_A
,
value
));
if
(
customerCreditTransfer
.
getChargeCcyFormatAmount
()
!=
null
)
{
CcyFormatAmount
chargeCcyFormatAmount
=
customerCreditTransfer
.
getChargeCcyFormatAmount
();
String
ccy
=
chargeCcyFormatAmount
.
getCcy
();
String
amt
=
NumberUtil
.
formatAmt
(
chargeCcyFormatAmount
.
getAmt
(),
ccy
);
if
(
"SHA"
.
equals
(
value
)
||
"BEN"
.
equals
(
value
))
{
tags
.
add
(
new
Tag
(
name_F
,
ccy
+
amt
));
}
else
if
(
"OUR"
.
equals
(
value
))
{
tags
.
add
(
new
Tag
(
name_G
,
ccy
+
amt
));
List
<
ChargeInfo
>
chargeInfos
=
customerCreditTransfer
.
getChargeInfoList
();
if
(
chargeInfos
.
size
()
>
0
)
{
for
(
ChargeInfo
chargeInfo
:
chargeInfos
)
{
CcyFormatAmount
chargeCcyFormatAmount
=
chargeInfo
.
getAmt
();
if
(
chargeCcyFormatAmount
!=
null
)
{
String
ccy
=
chargeCcyFormatAmount
.
getCcy
();
String
amt
=
NumberUtil
.
formatAmt
(
chargeCcyFormatAmount
.
getAmt
(),
ccy
);
if
(
"SHA"
.
equals
(
value
)
||
"BEN"
.
equals
(
value
))
{
tags
.
add
(
new
Tag
(
name_F
,
ccy
+
amt
));
}
else
if
(
"OUR"
.
equals
(
value
))
{
tags
.
add
(
new
Tag
(
name_G
,
ccy
+
amt
));
}
}
}
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/SwiftDto2Mt202Creator.java
View file @
be410ce5
...
...
@@ -5,7 +5,9 @@ import com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtCreator;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.mt202.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.SwiftBlock3
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
...
...
@@ -18,12 +20,16 @@ public class SwiftDto2Mt202Creator extends AbstractSwiftDto2MtCreator {
@Override
public
void
withBlock3
()
throws
SwiftException
{
super
.
withBlock3
();
SwiftBlock3
block3
=
context
.
get
(
SwiftMessage
.
class
).
getBlock3
();
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
if
(
financialInstitutionCreditTransfer
!=
null
&&
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
()
!=
null
)
{
SwiftBlock3
block3
=
context
.
get
(
SwiftMessage
.
class
).
getBlock3
();
block3
.
getTags
().
add
(
new
Tag
(
"119"
,
"COV"
));
}
TransactionReference
txnRef
=
financialInstitutionCreditTransfer
.
getTxnRef
();
if
(
txnRef
!=
null
&&
StringUtil
.
isNotEmpty
(
txnRef
.
getUetr
()))
{
block3
.
getTags
().
add
(
new
Tag
(
"121"
,
txnRef
.
getUetr
()));
}
}
@Override
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag20Generate.java
View file @
be410ce5
...
...
@@ -20,8 +20,8 @@ public class Tag20Generate extends AbstractSwiftDto2MtTagGenerate {
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
StringUtil
.
isNotEmpty
(
financialInstitutionCreditTransfer
.
getMessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
financialInstitutionCreditTransfer
.
getMessageId
()));
if
(
StringUtil
.
isNotEmpty
(
financialInstitutionCreditTransfer
.
get
SwiftHeader
().
get
MessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
financialInstitutionCreditTransfer
.
get
SwiftHeader
().
get
MessageId
()));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag21Generate.java
View file @
be410ce5
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
...
...
@@ -20,8 +21,9 @@ public class Tag21Generate extends AbstractSwiftDto2MtTagGenerate {
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
StringUtil
.
isNotEmpty
(
financialInstitutionCreditTransfer
.
getEndToEndId
()))
{
tags
.
add
(
new
Tag
(
name
,
financialInstitutionCreditTransfer
.
getEndToEndId
()));
TransactionReference
txnRef
=
financialInstitutionCreditTransfer
.
getTxnRef
();
if
(
txnRef
!=
null
&&
StringUtil
.
isNotEmpty
(
txnRef
.
getEndToEndId
()))
{
tags
.
add
(
new
Tag
(
name
,
txnRef
.
getEndToEndId
()));
}
else
{
tags
.
add
(
new
Tag
(
name
,
"NONREF"
));
}
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/SwiftDto2Mt900910Creator.java
View file @
be410ce5
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt900910
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtCreator
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.mt900910.impl.*
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerDebitCreditNotification
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.SwiftBlock3
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -13,6 +19,18 @@ import static com.brilliance.swift.constants.Mx2MtConstants.MT_TYPE_900;
import
static
com
.
brilliance
.
swift
.
constants
.
Mx2MtConstants
.
MT_TYPE_910
;
public
class
SwiftDto2Mt900910Creator
extends
AbstractSwiftDto2MtCreator
{
@Override
public
void
withBlock3
()
throws
SwiftException
{
super
.
withBlock3
();
SwiftBlock3
block3
=
context
.
get
(
SwiftMessage
.
class
).
getBlock3
();
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
TransactionReference
txnRef
=
bankToCustomerDebitCreditNotification
.
getTxnRef
();
if
(
txnRef
!=
null
&&
StringUtil
.
isNotEmpty
(
txnRef
.
getUetr
()))
{
block3
.
getTags
().
add
(
new
Tag
(
"121"
,
txnRef
.
getUetr
()));
}
}
@Override
public
List
<
SwiftDto2MtTagGenerate
>
getGenerateTagList
()
{
List
<
SwiftDto2MtTagGenerate
>
list
=
new
ArrayList
<>();
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag20Generate.java
View file @
be410ce5
...
...
@@ -21,8 +21,8 @@ public class Tag20Generate extends AbstractSwiftDto2MtTagGenerate {
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
StringUtil
.
isNotEmpty
(
bankToCustomerDebitCreditNotification
.
getMessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
bankToCustomerDebitCreditNotification
.
getMessageId
()));
if
(
StringUtil
.
isNotEmpty
(
bankToCustomerDebitCreditNotification
.
get
SwiftHeader
().
get
MessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
bankToCustomerDebitCreditNotification
.
get
SwiftHeader
().
get
MessageId
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag21Generate.java
View file @
be410ce5
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerDebitCreditNotification
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
...
...
@@ -21,8 +22,9 @@ public class Tag21Generate extends AbstractSwiftDto2MtTagGenerate {
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
StringUtil
.
isNotEmpty
(
bankToCustomerDebitCreditNotification
.
getEndToEndId
()))
{
tags
.
add
(
new
Tag
(
name
,
bankToCustomerDebitCreditNotification
.
getEndToEndId
()));
TransactionReference
txnRef
=
bankToCustomerDebitCreditNotification
.
getTxnRef
();
if
(
txnRef
!=
null
&&
StringUtil
.
isNotEmpty
(
txnRef
.
getEndToEndId
()))
{
tags
.
add
(
new
Tag
(
name
,
txnRef
.
getEndToEndId
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/SwiftDto2Mt940950Creator.java
View file @
be410ce5
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtCreator
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtTagGenerate
;
...
...
@@ -7,11 +8,27 @@ import com.brilliance.swift.swiftdto2mt.mt940950.impl.*;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.ReportEntry
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.SwiftBlock3
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
SwiftDto2Mt940950Creator
extends
AbstractSwiftDto2MtCreator
{
@Override
public
void
withBlock3
()
throws
SwiftException
{
super
.
withBlock3
();
SwiftBlock3
block3
=
context
.
get
(
SwiftMessage
.
class
).
getBlock3
();
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
TransactionReference
txnRef
=
bankToCustomerStatement
.
getTxnRef
();
if
(
txnRef
!=
null
&&
StringUtil
.
isNotEmpty
(
txnRef
.
getUetr
()))
{
block3
.
getTags
().
add
(
new
Tag
(
"121"
,
txnRef
.
getUetr
()));
}
}
@Override
public
List
<
SwiftDto2MtTagGenerate
>
getGenerateTagList
()
{
List
<
SwiftDto2MtTagGenerate
>
list
=
new
ArrayList
<>();
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag20Generate.java
View file @
be410ce5
...
...
@@ -4,7 +4,6 @@ import com.brilliance.swift.exception.SwiftException;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerDebitCreditNotification
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
...
...
@@ -22,8 +21,8 @@ public class Tag20Generate extends AbstractSwiftDto2MtTagGenerate {
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
StringUtil
.
isNotEmpty
(
bankToCustomerStatement
.
getMessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
bankToCustomerStatement
.
getMessageId
()));
if
(
StringUtil
.
isNotEmpty
(
bankToCustomerStatement
.
get
SwiftHeader
().
get
MessageId
()))
{
tags
.
add
(
new
Tag
(
name
,
bankToCustomerStatement
.
get
SwiftHeader
().
get
MessageId
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mx/SwiftDto2MxCreatorManager.java
View file @
be410ce5
...
...
@@ -13,7 +13,7 @@ public class SwiftDto2MxCreatorManager {
SwiftDto2MxContext
context
=
new
SwiftDto2MxContext
();
context
.
set
(
SwiftDto2MxContextIdentifier
.
SWIFT_DTO_OBJ
,
swiftDto
);
context
.
set
(
SwiftDto2MxContextIdentifier
.
MX_OUTPUT_FILE_PATH
,
fileOutputPath
);
AbstractSwiftDto2MxCreator
creator
=
getCreator
(
swiftDto
.
getMessageType
());
AbstractSwiftDto2MxCreator
creator
=
getCreator
(
swiftDto
.
get
SwiftHeader
().
get
MessageType
());
creator
.
setContext
(
context
).
create
();
String
xmlStr
=
(
String
)
context
.
get
(
SwiftDto2MxContextIdentifier
.
MX_XML
);
return
xmlStr
;
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mx/camt053001/v08/SwiftDto2MxCamt053001Creator.java
View file @
be410ce5
...
...
@@ -6,6 +6,7 @@ import com.brilliance.swift.swiftdto2mx.SwiftDto2MxContextIdentifier;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.SwiftHeader
;
import
com.brilliance.swift.vo.common.*
;
import
com.prowidesoftware.swift.model.mx.BusinessAppHdrV02
;
import
com.prowidesoftware.swift.model.mx.MxCamt05300108
;
...
...
@@ -28,6 +29,7 @@ public class SwiftDto2MxCamt053001Creator extends AbstractSwiftDto2MxCreator {
if
(
bankToCustomerStatement
==
null
)
{
return
;
}
SwiftHeader
swiftHeader
=
bankToCustomerStatement
.
getSwiftHeader
();
MxCamt05300108
mxCamt05300108
=
new
MxCamt05300108
();
//set AppHdr
BusinessAppHdrV02
businessAppHdrV02
=
new
BusinessAppHdrV02
();
...
...
@@ -35,7 +37,7 @@ public class SwiftDto2MxCamt053001Creator extends AbstractSwiftDto2MxCreator {
Party44Choice
fr
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
fiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
finInstnId
=
new
FinancialInstitutionIdentification18
();
finInstnId
.
setBICFI
(
bankToCustomerStatement
.
getSenderBic
());
finInstnId
.
setBICFI
(
swiftHeader
.
getSenderBic
());
fiId
.
setFinInstnId
(
finInstnId
);
fr
.
setFIId
(
fiId
);
businessAppHdrV02
.
setFr
(
fr
);
...
...
@@ -43,28 +45,29 @@ public class SwiftDto2MxCamt053001Creator extends AbstractSwiftDto2MxCreator {
Party44Choice
to
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
toFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
toFinInstnId
=
new
FinancialInstitutionIdentification18
();
toFinInstnId
.
setBICFI
(
bankToCustomerStatement
.
getReceiverBic
());
toFinInstnId
.
setBICFI
(
swiftHeader
.
getReceiverBic
());
toFiId
.
setFinInstnId
(
toFinInstnId
);
to
.
setFIId
(
toFiId
);
businessAppHdrV02
.
setTo
(
to
);
//
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
bankToCustomerStatement
.
getCreateDate
());
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
swiftHeader
.
getCreateDate
());
businessAppHdrV02
.
setCreDt
(
creDt
);
if
(
MessagePriority
.
NORM
.
equals
(
bankToCustomerStatement
.
getMessagePriority
()))
{
if
(
MessagePriority
.
NORM
.
equals
(
swiftHeader
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
NORM
.
value
());
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
bankToCustomerStatement
.
getMessagePriority
()))
{
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
swiftHeader
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
HIGH
.
value
());
}
businessAppHdrV02
.
setMsgDefIdr
(
"camt.053.001.08"
);
businessAppHdrV02
.
setBizMsgIdr
(
bankToCustomerStatement
.
getMessageId
());
businessAppHdrV02
.
setMsgDefIdr
(
swiftHeader
.
getMessageDefId
());
businessAppHdrV02
.
setBizMsgIdr
(
swiftHeader
.
getMessageId
());
businessAppHdrV02
.
setBizSvc
(
swiftHeader
.
getBusinessService
());
mxCamt05300108
.
setAppHdr
(
businessAppHdrV02
);
//grpHdr
BankToCustomerStatementV08
bkToCstmrStmt
=
new
BankToCustomerStatementV08
();
mxCamt05300108
.
setBkToCstmrStmt
(
bkToCstmrStmt
);
GroupHeader81
grpHdr
=
new
GroupHeader81
();
grpHdr
.
setMsgId
(
bankToCustomerStatement
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
bankToCustomerStatement
.
getCreateDate
()));
grpHdr
.
setMsgId
(
swiftHeader
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
swiftHeader
.
getCreateDate
()));
bkToCstmrStmt
.
setGrpHdr
(
grpHdr
);
//AccountStatement
AccountStatement9
stmt
=
new
AccountStatement9
();
...
...
@@ -191,9 +194,12 @@ public class SwiftDto2MxCamt053001Creator extends AbstractSwiftDto2MxCreator {
EntryTransaction10
txDtls
=
new
EntryTransaction10
();
ntryDtls
.
addTxDtls
(
txDtls
);
TransactionReferences6
refs
=
new
TransactionReferences6
();
refs
.
setUETR
(
bankToCustomerStatement
.
getUetr
());
txDtls
.
setRefs
(
refs
);
TransactionReference
txnRef
=
bankToCustomerStatement
.
getTxnRef
();
if
(
txnRef
!=
null
)
{
refs
.
setUETR
(
txnRef
.
getUetr
());
}
refs
.
setEndToEndId
(
reportEntry
.
getEndToEndId
());
txDtls
.
setRefs
(
refs
);
ntry
.
setAcctSvcrRef
(
reportEntry
.
getAcctSvcrRef
());
txDtls
.
setAddtlTxInf
(
reportEntry
.
getAddtlTxInf
());
ntry
.
setAddtlNtryInf
(
reportEntry
.
getAddtlNtryInf
());
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mx/camt054001/v08/SwiftDto2MxCamt054001Creator.java
View file @
be410ce5
...
...
@@ -6,18 +6,18 @@ import com.brilliance.swift.swiftdto2mx.SwiftDto2MxContextIdentifier;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerDebitCreditNotification
;
import
com.brilliance.swift.vo.SwiftHeader
;
import
com.brilliance.swift.vo.common.CcyFormatAmount
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
com.prowidesoftware.swift.model.mx.BusinessAppHdrV02
;
import
com.prowidesoftware.swift.model.mx.MxCamt05400102
;
import
com.prowidesoftware.swift.model.mx.MxCamt05400108
;
import
com.prowidesoftware.swift.model.mx.dic.*
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.io.File
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author zh
...
...
@@ -31,6 +31,7 @@ public class SwiftDto2MxCamt054001Creator extends AbstractSwiftDto2MxCreator {
if
(
bankToCustomerDebitCreditNotification
==
null
)
{
return
;
}
SwiftHeader
swiftHeader
=
bankToCustomerDebitCreditNotification
.
getSwiftHeader
();
MxCamt05400108
mxCamt05400108
=
new
MxCamt05400108
();
//set AppHdr
BusinessAppHdrV02
businessAppHdrV02
=
new
BusinessAppHdrV02
();
...
...
@@ -38,7 +39,7 @@ public class SwiftDto2MxCamt054001Creator extends AbstractSwiftDto2MxCreator {
Party44Choice
fr
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
fiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
finInstnId
=
new
FinancialInstitutionIdentification18
();
finInstnId
.
setBICFI
(
bankToCustomerDebitCreditNotification
.
getSenderBic
());
finInstnId
.
setBICFI
(
swiftHeader
.
getSenderBic
());
fiId
.
setFinInstnId
(
finInstnId
);
fr
.
setFIId
(
fiId
);
businessAppHdrV02
.
setFr
(
fr
);
...
...
@@ -46,34 +47,36 @@ public class SwiftDto2MxCamt054001Creator extends AbstractSwiftDto2MxCreator {
Party44Choice
to
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
toFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
toFinInstnId
=
new
FinancialInstitutionIdentification18
();
toFinInstnId
.
setBICFI
(
bankToCustomerDebitCreditNotification
.
getReceiverBic
());
toFinInstnId
.
setBICFI
(
swiftHeader
.
getReceiverBic
());
toFiId
.
setFinInstnId
(
toFinInstnId
);
to
.
setFIId
(
toFiId
);
businessAppHdrV02
.
setTo
(
to
);
//
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
bankToCustomerDebitCreditNotification
.
getCreateDate
());
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
swiftHeader
.
getCreateDate
());
businessAppHdrV02
.
setCreDt
(
creDt
);
if
(
MessagePriority
.
NORM
.
equals
(
bankToCustomerDebitCreditNotification
.
getMessagePriority
()))
{
if
(
MessagePriority
.
NORM
.
equals
(
swiftHeader
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
NORM
.
value
());
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
bankToCustomerDebitCreditNotification
.
getMessagePriority
()))
{
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
swiftHeader
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
HIGH
.
value
());
}
businessAppHdrV02
.
setMsgDefIdr
(
"camt.054.001.08"
);
businessAppHdrV02
.
setBizMsgIdr
(
bankToCustomerDebitCreditNotification
.
getMessageId
());
businessAppHdrV02
.
setMsgDefIdr
(
swiftHeader
.
getMessageDefId
());
businessAppHdrV02
.
setBizMsgIdr
(
swiftHeader
.
getMessageId
());
businessAppHdrV02
.
setBizSvc
(
swiftHeader
.
getBusinessService
());
mxCamt05400108
.
setAppHdr
(
businessAppHdrV02
);
//grpHdr
BankToCustomerDebitCreditNotificationV08
bkToCstmrDbtCdtNtfctn
=
new
BankToCustomerDebitCreditNotificationV08
();
mxCamt05400108
.
setBkToCstmrDbtCdtNtfctn
(
bkToCstmrDbtCdtNtfctn
);
GroupHeader81
grpHdr
=
new
GroupHeader81
();
grpHdr
.
setMsgId
(
bankToCustomerDebitCreditNotification
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
bankToCustomerDebitCreditNotification
.
getCreateDate
()));
grpHdr
.
setMsgId
(
swiftHeader
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
swiftHeader
.
getCreateDate
()));
grpHdr
.
setAddtlInf
(
""
);
bkToCstmrDbtCdtNtfctn
.
setGrpHdr
(
grpHdr
);
//ntfcn
AccountNotification17
ntfctn
=
new
AccountNotification17
();
bkToCstmrDbtCdtNtfctn
.
addNtfctn
(
ntfctn
);
String
endToEndId
=
bankToCustomerDebitCreditNotification
.
getEndToEndId
();
//21
TransactionReference
txnRef
=
bankToCustomerDebitCreditNotification
.
getTxnRef
();
String
endToEndId
=
txnRef
.
getEndToEndId
();
//21
String
account
=
bankToCustomerDebitCreditNotification
.
getAccount
().
getAccount
();
//25
String
ibanAcct
=
bankToCustomerDebitCreditNotification
.
getAccount
().
getIbanAcct
();
//25
Date
valueDate
=
bankToCustomerDebitCreditNotification
.
getValueDate
();
//25a
...
...
@@ -101,7 +104,7 @@ public class SwiftDto2MxCamt054001Creator extends AbstractSwiftDto2MxCreator {
rltdPties
.
setDbtr
(
dbtr
);
TransactionReferences6
refs
=
new
TransactionReferences6
();
refs
.
setEndToEndId
(
endToEndId
);
refs
.
setUETR
(
bankToCustomerDebitCreditNotification
.
getUetr
());
refs
.
setUETR
(
txnRef
.
getUetr
());
txDtls
.
setRefs
(
refs
);
//IBAN Othr/Id
if
(
account
!=
null
||
ibanAcct
!=
null
){
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mx/pacs008001/v09/SwiftDto2MxPacs008001Creator.java
View file @
be410ce5
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.swiftdto2mx.AbstractSwiftDto2MxCreator;
import
com.brilliance.swift.swiftdto2mx.SwiftDto2MxContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.SwiftHeader
;
import
com.brilliance.swift.vo.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.common.*
;
import
com.brilliance.swift.vo.common.PurposeChoice
;
...
...
@@ -38,11 +39,12 @@ public class SwiftDto2MxPacs008001Creator extends AbstractSwiftDto2MxCreator {
PartyDto
cdtrAgtParty
=
customerCreditTransfer
.
getCreditAgtParty
();
//57
PartyDto
cdtrParty
=
customerCreditTransfer
.
getCreditParty
();
//59
//set AppHdr
SwiftHeader
swiftHeader
=
customerCreditTransfer
.
getSwiftHeader
();
BusinessAppHdrV02
businessAppHdrV02
=
new
BusinessAppHdrV02
();
Party44Choice
fr
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
frFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
frFinInstnId
=
new
FinancialInstitutionIdentification18
();
frFinInstnId
.
setBICFI
(
customerCreditTransf
er
.
getSenderBic
());
frFinInstnId
.
setBICFI
(
swiftHead
er
.
getSenderBic
());
frFiId
.
setFinInstnId
(
frFinInstnId
);
fr
.
setFIId
(
frFiId
);
businessAppHdrV02
.
setFr
(
fr
);
...
...
@@ -50,28 +52,29 @@ public class SwiftDto2MxPacs008001Creator extends AbstractSwiftDto2MxCreator {
Party44Choice
to
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
toFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
toFinInstnId
=
new
FinancialInstitutionIdentification18
();
toFinInstnId
.
setBICFI
(
customerCreditTransf
er
.
getSenderBic
());
toFinInstnId
.
setBICFI
(
swiftHead
er
.
getSenderBic
());
toFiId
.
setFinInstnId
(
toFinInstnId
);
to
.
setFIId
(
toFiId
);
businessAppHdrV02
.
setTo
(
to
);
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
customerCreditTransf
er
.
getCreateDate
());
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
swiftHead
er
.
getCreateDate
());
businessAppHdrV02
.
setCreDt
(
creDt
);
if
(
MessagePriority
.
NORM
.
equals
(
customerCreditTransf
er
.
getMessagePriority
()))
{
if
(
MessagePriority
.
NORM
.
equals
(
swiftHead
er
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
NORM
.
value
());
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
customerCreditTransf
er
.
getMessagePriority
()))
{
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
swiftHead
er
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
HIGH
.
value
());
}
businessAppHdrV02
.
setMsgDefIdr
(
"pacs.008.001.09"
);
businessAppHdrV02
.
setBizMsgIdr
(
customerCreditTransfer
.
getMessageId
());
businessAppHdrV02
.
setMsgDefIdr
(
swiftHeader
.
getMessageDefId
());
businessAppHdrV02
.
setBizMsgIdr
(
swiftHeader
.
getMessageId
());
businessAppHdrV02
.
setBizSvc
(
swiftHeader
.
getBusinessService
());
mxPacs00800109
.
setAppHdr
(
businessAppHdrV02
);
FIToFICustomerCreditTransferV09
fiToFICstmrCdtTrf
=
new
FIToFICustomerCreditTransferV09
();
mxPacs00800109
.
setFIToFICstmrCdtTrf
(
fiToFICstmrCdtTrf
);
//set GroupHeader
GroupHeader93
grpHdr
=
new
GroupHeader93
();
grpHdr
.
setMsgId
(
customerCreditTransf
er
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
customerCreditTransf
er
.
getCreateDate
()));
grpHdr
.
setMsgId
(
swiftHead
er
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
swiftHead
er
.
getCreateDate
()));
grpHdr
.
setNbOfTxs
(
"1"
);
SettlementInstruction7
sttlmInf
=
new
SettlementInstruction7
();
sttlmInf
.
setSttlmMtd
(
SettlementMethod1Code
.
INDA
);
...
...
@@ -99,10 +102,11 @@ public class SwiftDto2MxPacs008001Creator extends AbstractSwiftDto2MxCreator {
CreditTransferTransaction43
cdtTrfTxInf
=
new
CreditTransferTransaction43
();
fiToFICstmrCdtTrf
.
addCdtTrfTxInf
(
cdtTrfTxInf
);
//PmtId
TransactionReference
txnRef
=
customerCreditTransfer
.
getTxnRef
();
PaymentIdentification13
pmtId
=
new
PaymentIdentification13
();
pmtId
.
setInstrId
(
customerCreditTransfer
.
getMessage
Id
());
pmtId
.
setInstrId
(
txnRef
.
getInstruction
Id
());
pmtId
.
setEndToEndId
(
"NOTPROVIDED"
);
pmtId
.
setUETR
(
customerCreditTransfer
.
getUetr
());
pmtId
.
setUETR
(
txnRef
.
getUetr
());
cdtTrfTxInf
.
setPmtId
(
pmtId
);
//SttlmTmIndctn SttlmTmReq
...
...
@@ -241,22 +245,19 @@ public class SwiftDto2MxPacs008001Creator extends AbstractSwiftDto2MxCreator {
ChargeForEnum
chargeForEnum
=
customerCreditTransfer
.
getChargeFor
();
if
(
chargeForEnum
!=
null
)
{
cdtTrfTxInf
.
setChrgBr
(
ChargeBearerType1Code
.
fromValue
(
chargeForEnum
.
value
()));
CcyFormatAmount
cfa
=
customerCreditTransfer
.
getChargeCcyFormatAmount
();
if
(
cfa
!=
null
)
{
}
List
<
ChargeInfo
>
chargeInfos
=
customerCreditTransfer
.
getChargeInfoList
();
if
(
chargeInfos
.
size
()
>
0
)
{
for
(
ChargeInfo
chargeInfo
:
chargeInfos
)
{
Charges7
chrgsInf
=
new
Charges7
();
CcyFormatAmount
ccyFormatAmount
=
chargeInfo
.
getAmt
();
if
(
ccyFormatAmount
!=
null
)
{
ActiveOrHistoricCurrencyAndAmount
amt
=
new
ActiveOrHistoricCurrencyAndAmount
();
amt
.
setCcy
(
cfa
.
getCcy
());
amt
.
setValue
(
cfa
.
getAmt
());
chrgsInf
.
setAmt
(
amt
);
if
(
ChargeBearerType1Code
.
CRED
.
equals
(
cdtTrfTxInf
.
getChrgBr
())
||
ChargeBearerType1Code
.
SHAR
.
equals
(
cdtTrfTxInf
.
getChrgBr
()))
{
if
(
instructingReimbursementParty
!=
null
)
{
chrgsInf
.
setAgt
(
partyDtoConvertAgt
(
instructingReimbursementParty
));
}
}
else
if
(
ChargeBearerType1Code
.
DEBT
.
equals
(
cdtTrfTxInf
.
getChrgBr
()))
{
if
(
instructedReimbursementParty
!=
null
)
{
chrgsInf
.
setAgt
(
partyDtoConvertAgt
(
instructedReimbursementParty
));
}
amt
.
setCcy
(
ccyFormatAmount
.
getCcy
());
amt
.
setValue
(
ccyFormatAmount
.
getAmt
());
chrgsInf
.
setAmt
(
amt
);
}
chrgsInf
.
setAgt
(
partyDtoConvertAgt
(
chargeInfo
.
getPartyDto
()));
cdtTrfTxInf
.
addChrgsInf
(
chrgsInf
);
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mx/pacs009001/v09/SwiftDto2MxPacs009001Creator.java
View file @
be410ce5
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.swiftdto2mx.AbstractSwiftDto2MxCreator;
import
com.brilliance.swift.swiftdto2mx.SwiftDto2MxContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.SwiftHeader
;
import
com.brilliance.swift.vo.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.*
;
...
...
@@ -34,11 +35,12 @@ public class SwiftDto2MxPacs009001Creator extends AbstractSwiftDto2MxCreator {
PartyDto
cdtrAgtParty
=
financialInstitutionCreditTransfer
.
getCreditAgtParty
();
//57
PartyDto
cdtrParty
=
financialInstitutionCreditTransfer
.
getCreditParty
();
//58
//set AppHdr
SwiftHeader
swiftHeader
=
financialInstitutionCreditTransfer
.
getSwiftHeader
();
BusinessAppHdrV02
businessAppHdrV02
=
new
BusinessAppHdrV02
();
Party44Choice
fr
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
frFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
frFinInstnId
=
new
FinancialInstitutionIdentification18
();
frFinInstnId
.
setBICFI
(
financialInstitutionCreditTransf
er
.
getSenderBic
());
frFinInstnId
.
setBICFI
(
swiftHead
er
.
getSenderBic
());
frFiId
.
setFinInstnId
(
frFinInstnId
);
fr
.
setFIId
(
frFiId
);
businessAppHdrV02
.
setFr
(
fr
);
...
...
@@ -46,28 +48,29 @@ public class SwiftDto2MxPacs009001Creator extends AbstractSwiftDto2MxCreator {
Party44Choice
to
=
new
Party44Choice
();
BranchAndFinancialInstitutionIdentification6
toFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
toFinInstnId
=
new
FinancialInstitutionIdentification18
();
toFinInstnId
.
setBICFI
(
financialInstitutionCreditTransf
er
.
getSenderBic
());
toFinInstnId
.
setBICFI
(
swiftHead
er
.
getSenderBic
());
toFiId
.
setFinInstnId
(
toFinInstnId
);
to
.
setFIId
(
toFiId
);
businessAppHdrV02
.
setTo
(
to
);
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
financialInstitutionCreditTransf
er
.
getCreateDate
());
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
swiftHead
er
.
getCreateDate
());
businessAppHdrV02
.
setCreDt
(
creDt
);
if
(
MessagePriority
.
NORM
.
equals
(
financialInstitutionCreditTransf
er
.
getMessagePriority
()))
{
if
(
MessagePriority
.
NORM
.
equals
(
swiftHead
er
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
NORM
.
value
());
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
financialInstitutionCreditTransf
er
.
getMessagePriority
()))
{
}
else
if
(
MessagePriority
.
HIGH
.
equals
(
swiftHead
er
.
getMessagePriority
()))
{
businessAppHdrV02
.
setPrty
(
Priority2Code
.
HIGH
.
value
());
}
businessAppHdrV02
.
setMsgDefIdr
(
"pacs.009.001.09"
);
businessAppHdrV02
.
setBizMsgIdr
(
financialInstitutionCreditTransfer
.
getMessageId
());
businessAppHdrV02
.
setMsgDefIdr
(
swiftHeader
.
getMessageDefId
());
businessAppHdrV02
.
setBizMsgIdr
(
swiftHeader
.
getMessageId
());
businessAppHdrV02
.
setBizSvc
(
swiftHeader
.
getBusinessService
());
mxPacs00900109
.
setAppHdr
(
businessAppHdrV02
);
FinancialInstitutionCreditTransferV09
fiCdtTrf
=
new
FinancialInstitutionCreditTransferV09
();
mxPacs00900109
.
setFICdtTrf
(
fiCdtTrf
);
//set GroupHeader
GroupHeader93
grpHdr
=
new
GroupHeader93
();
grpHdr
.
setMsgId
(
financialInstitutionCreditTransf
er
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
financialInstitutionCreditTransf
er
.
getCreateDate
()));
grpHdr
.
setMsgId
(
swiftHead
er
.
getMessageId
());
grpHdr
.
setCreDtTm
(
DateUtil
.
parseXMLGregorianCalendar
(
swiftHead
er
.
getCreateDate
()));
grpHdr
.
setNbOfTxs
(
"1"
);
SettlementInstruction7
sttlmInf
=
new
SettlementInstruction7
();
sttlmInf
.
setSttlmMtd
(
SettlementMethod1Code
.
INDA
);
...
...
@@ -89,10 +92,11 @@ public class SwiftDto2MxPacs009001Creator extends AbstractSwiftDto2MxCreator {
CreditTransferTransaction44
cdtTrfTxInf
=
new
CreditTransferTransaction44
();
fiCdtTrf
.
addCdtTrfTxInf
(
cdtTrfTxInf
);
//PmtId
TransactionReference
txnRef
=
financialInstitutionCreditTransfer
.
getTxnRef
();
PaymentIdentification13
pmtId
=
new
PaymentIdentification13
();
pmtId
.
setInstrId
(
financialInstitutionCreditTransfer
.
getMessage
Id
());
pmtId
.
setEndToEndId
(
financialInstitutionCreditTransfer
.
getEndToEndId
());
pmtId
.
setUETR
(
financialInstitutionCreditTransfer
.
getUetr
());
pmtId
.
setInstrId
(
txnRef
.
getInstruction
Id
());
pmtId
.
setEndToEndId
(
txnRef
.
getEndToEndId
());
pmtId
.
setUETR
(
txnRef
.
getUetr
());
cdtTrfTxInf
.
setPmtId
(
pmtId
);
//SttlmTmIndctn SttlmTmReq
SettlementDateTimeIndication1
sttlmTmIndctn
=
null
;
...
...
swiftCore/src/main/java/com/brilliance/swift/util/XmlUtil.java
View file @
be410ce5
...
...
@@ -185,20 +185,20 @@ public class XmlUtil {
}
public
static
void
main
(
String
[]
args
)
throws
IOException
,
DocumentException
{
// File file = new File(System.getProperty("user.dir") + "\\src\\main\\resources\\swiftXml\\MxPacs0090010
2
.xml");
// File file = new File(System.getProperty("user.dir") + "\\src\\main\\resources\\swiftXml\\MxPacs0090010
9
.xml");
/* File file = new File("d:/test/test.xml");
String xmlStr = FileUtils.readFileToString(file);
Document document = DocumentHelper.parseText(xmlStr);
String value = getXmlNodeValue(document, "Document.BkToCstmrStmt.GrpHdr.MsgId");
System.out.println(value);*/
/*File file = new File(System.getProperty("user.dir") + "\\src\\main\\resources\\swiftXml\\MxPacs0080010
2
.xml");
/*File file = new File(System.getProperty("user.dir") + "\\src\\main\\resources\\swiftXml\\MxPacs0080010
9
.xml");
String xmlStr = FileUtils.readFileToString(file);
Document document = DocumentHelper.parseText(xmlStr);
String value = getXmlNodeValue(document, "Document.FIToFICstmrCdtTrf.CdtTrfTxInf.SttlmTmIndctn.DbtDtTm");
System.out.println(value);*/
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"\\src\\main\\resources\\swiftXml\\MxPacs0090010
2
.xml"
);
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"\\src\\main\\resources\\swiftXml\\MxPacs0090010
9
.xml"
);
String
xmlStr
=
FileUtils
.
readFileToString
(
file
);
Document
document
=
DocumentHelper
.
parseText
(
xmlStr
);
Map
<
String
,
String
>
maps
=
getParentElementMaps
(
document
);
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/BankToCustomerDebitCreditNotification.java
View file @
be410ce5
...
...
@@ -3,6 +3,7 @@ package com.brilliance.swift.vo;
import
com.brilliance.swift.vo.common.CcyFormatAmount
;
import
com.brilliance.swift.vo.common.PartyAccount
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.brilliance.swift.vo.common.TransactionReference
;
import
java.util.Date
;
...
...
@@ -17,7 +18,7 @@ public class BankToCustomerDebitCreditNotification extends SwiftDto{
*/
protected
String
cdtDbtCode
;
protected
String
endToEndId
;
protected
TransactionReference
txnRef
;
protected
PartyAccount
account
;
...
...
@@ -41,12 +42,12 @@ public class BankToCustomerDebitCreditNotification extends SwiftDto{
this
.
cdtDbtCode
=
cdtDbtCode
;
}
public
String
getEndToEndId
()
{
return
endToEndId
;
public
TransactionReference
getTxnRef
()
{
return
txnRef
;
}
public
void
set
EndToEndId
(
String
endToEndId
)
{
this
.
endToEndId
=
endToEndId
;
public
void
set
TxnRef
(
TransactionReference
txnRef
)
{
this
.
txnRef
=
txnRef
;
}
public
PartyAccount
getAccount
()
{
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/BankToCustomerStatement.java
View file @
be410ce5
...
...
@@ -11,7 +11,7 @@ import java.util.List;
*/
public
class
BankToCustomerStatement
extends
SwiftDto
{
protected
String
endToEndId
;
protected
TransactionReference
txnRef
;
protected
PartyAccount
account
;
...
...
@@ -55,12 +55,12 @@ public class BankToCustomerStatement extends SwiftDto{
return
this
;
}
public
String
getEndToEndId
()
{
return
endToEndId
;
public
TransactionReference
getTxnRef
()
{
return
txnRef
;
}
public
void
set
EndToEndId
(
String
endToEndId
)
{
this
.
endToEndId
=
endToEndId
;
public
void
set
TxnRef
(
TransactionReference
txnRef
)
{
this
.
txnRef
=
txnRef
;
}
public
PartyAccount
getAccount
()
{
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/SwiftDto.java
View file @
be410ce5
package
com
.
brilliance
.
swift
.
vo
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
org.apache.commons.lang3.Validate
;
...
...
@@ -11,84 +10,15 @@ import java.util.Date;
public
class
SwiftDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
2296248553989810638L
;
protected
String
messageType
;
protected
S
tring
version
;
protected
S
wiftHeader
swiftHeader
;
protected
String
senderBic
;
protected
String
receiverBic
;
protected
Date
createDate
;
protected
MessagePriority
messagePriority
;
protected
String
messageId
;
protected
String
uetr
;
public
String
getMessageType
()
{
return
messageType
;
}
public
void
setMessageType
(
String
messageType
)
{
this
.
messageType
=
messageType
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getSenderBic
()
{
return
senderBic
;
}
public
void
setSenderBic
(
String
senderBic
)
{
this
.
senderBic
=
senderBic
;
}
public
String
getReceiverBic
()
{
return
receiverBic
;
}
public
void
setReceiverBic
(
String
receiverBic
)
{
this
.
receiverBic
=
receiverBic
;
}
public
Date
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
Date
createDate
)
{
this
.
createDate
=
createDate
;
}
public
MessagePriority
getMessagePriority
()
{
return
messagePriority
;
}
public
void
setMessagePriority
(
MessagePriority
messagePriority
)
{
this
.
messagePriority
=
messagePriority
;
}
public
String
getMessageId
()
{
return
messageId
;
}
public
void
setMessageId
(
String
messageId
)
{
this
.
messageId
=
messageId
;
}
public
String
getUetr
()
{
return
uetr
;
public
SwiftHeader
getSwiftHeader
()
{
return
swiftHeader
;
}
public
void
set
Uetr
(
String
uet
r
)
{
this
.
uetr
=
uet
r
;
public
void
set
SwiftHeader
(
SwiftHeader
swiftHeade
r
)
{
this
.
swiftHeader
=
swiftHeade
r
;
}
public
String
toJson
()
{
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/SwiftDtoAdapter.java
View file @
be410ce5
...
...
@@ -11,7 +11,8 @@ public class SwiftDtoAdapter implements JsonSerializer<SwiftDto>, JsonDeserializ
@Override
public
SwiftDto
deserialize
(
JsonElement
json
,
Type
typeOfT
,
JsonDeserializationContext
context
)
throws
JsonParseException
{
JsonObject
jsonObject
=
json
.
getAsJsonObject
();
JsonPrimitive
prim
=
(
JsonPrimitive
)
jsonObject
.
get
(
MESSAGETYPE
);
JsonObject
jsonObject1
=
jsonObject
.
getAsJsonObject
(
"swiftHeader"
);
JsonPrimitive
prim
=
(
JsonPrimitive
)
jsonObject1
.
get
(
MESSAGETYPE
);
if
(
prim
==
null
)
{
throw
new
JsonParseException
(
"Missing "
+
MESSAGETYPE
+
" in JSON structure"
);
}
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/SwiftHeader.java
0 → 100644
View file @
be410ce5
package
com
.
brilliance
.
swift
.
vo
;
import
com.brilliance.swift.vo.common.MessagePriority
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
public
class
SwiftHeader
{
private
String
senderBic
;
private
String
receiverBic
;
private
String
messageId
;
private
String
messageDefId
;
private
String
messageType
;
private
String
version
;
private
String
businessService
;
private
Date
createDate
;
private
MessagePriority
messagePriority
;
private
List
<
SwiftHeader
>
relatedSwiftHeaders
;
public
String
getSenderBic
()
{
return
senderBic
;
}
public
void
setSenderBic
(
String
senderBic
)
{
this
.
senderBic
=
senderBic
;
}
public
String
getReceiverBic
()
{
return
receiverBic
;
}
public
void
setReceiverBic
(
String
receiverBic
)
{
this
.
receiverBic
=
receiverBic
;
}
public
String
getMessageId
()
{
return
messageId
;
}
public
void
setMessageId
(
String
messageId
)
{
this
.
messageId
=
messageId
;
}
public
String
getMessageDefId
()
{
return
messageDefId
;
}
public
void
setMessageDefId
(
String
messageDefId
)
{
this
.
messageDefId
=
messageDefId
;
}
public
String
getMessageType
()
{
/*if (messageDefId != null) {
if (messageDefId.split("\\.").length == 4) {
messageType = messageDefId.substring(0, messageDefId.lastIndexOf("."));
}
}*/
return
messageType
;
}
public
void
setMessageType
(
String
messageType
)
{
this
.
messageType
=
messageType
;
}
public
String
getVersion
()
{
/*if (messageDefId != null) {
if (messageDefId.split("\\.").length == 4) {
version = messageDefId.substring(messageDefId.lastIndexOf(".")+1);
}
}*/
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getBusinessService
()
{
return
businessService
;
}
public
void
setBusinessService
(
String
businessService
)
{
this
.
businessService
=
businessService
;
}
public
Date
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
Date
createDate
)
{
this
.
createDate
=
createDate
;
}
public
MessagePriority
getMessagePriority
()
{
return
messagePriority
;
}
public
void
setMessagePriority
(
MessagePriority
messagePriority
)
{
this
.
messagePriority
=
messagePriority
;
}
public
List
<
SwiftHeader
>
getRelatedSwiftHeaderList
()
{
if
(
relatedSwiftHeaders
==
null
)
{
relatedSwiftHeaders
=
new
ArrayList
<>();
}
return
this
.
relatedSwiftHeaders
;
}
public
void
addRelatedSwiftHeader
(
SwiftHeader
swiftHeader
)
{
getRelatedSwiftHeaderList
().
add
(
swiftHeader
);
}
}
swiftCore/src/main/java/com/brilliance/swift/vo/VoCustomerCreditTransfer.java
View file @
be410ce5
...
...
@@ -12,6 +12,8 @@ import java.util.List;
*/
public
class
VoCustomerCreditTransfer
extends
SwiftDto
{
protected
TransactionReference
txnRef
;
protected
Date
debitDate
;
protected
Date
creditDate
;
...
...
@@ -54,7 +56,7 @@ public class VoCustomerCreditTransfer extends SwiftDto {
protected
ChargeForEnum
chargeFor
;
protected
CcyFormatAmount
chargeCcyFormatAmount
;
protected
List
<
ChargeInfo
>
chargeInfos
;
protected
PartyDto
preInstgAgtParty
;
...
...
@@ -136,14 +138,6 @@ public class VoCustomerCreditTransfer extends SwiftDto {
this
.
chargeFor
=
chargeFor
;
}
public
CcyFormatAmount
getChargeCcyFormatAmount
()
{
return
chargeCcyFormatAmount
;
}
public
void
setChargeCcyFormatAmount
(
CcyFormatAmount
chargeCcyFormatAmount
)
{
this
.
chargeCcyFormatAmount
=
chargeCcyFormatAmount
;
}
public
List
<
String
>
getRegulatoryReportingList
()
{
if
(
regulatoryReportings
==
null
)
{
regulatoryReportings
=
new
ArrayList
<>();
...
...
@@ -156,6 +150,18 @@ public class VoCustomerCreditTransfer extends SwiftDto {
return
this
;
}
public
List
<
ChargeInfo
>
getChargeInfoList
()
{
if
(
chargeInfos
==
null
)
{
chargeInfos
=
new
ArrayList
<>();
}
return
this
.
chargeInfos
;
}
public
VoCustomerCreditTransfer
addChargeInfo
(
ChargeInfo
chargeInfo
)
{
getChargeInfoList
().
add
(
chargeInfo
);
return
this
;
}
public
PartyDto
getDebitParty
()
{
return
debitParty
;
}
...
...
@@ -275,4 +281,12 @@ public class VoCustomerCreditTransfer extends SwiftDto {
public
void
setInstForNxtAgt
(
InstructionForNextAgent
instForNxtAgt
)
{
this
.
instForNxtAgt
=
instForNxtAgt
;
}
public
TransactionReference
getTxnRef
()
{
return
txnRef
;
}
public
void
setTxnRef
(
TransactionReference
txnRef
)
{
this
.
txnRef
=
txnRef
;
}
}
swiftCore/src/main/java/com/brilliance/swift/vo/VoFinancialInstitutionCreditTransfer.java
View file @
be410ce5
...
...
@@ -9,7 +9,7 @@ import java.util.Date;
*/
public
class
VoFinancialInstitutionCreditTransfer
extends
SwiftDto
{
protected
String
endToEndId
;
protected
TransactionReference
txnRef
;
protected
Date
debitDate
;
...
...
@@ -46,14 +46,6 @@ public class VoFinancialInstitutionCreditTransfer extends SwiftDto{
*/
protected
VoCustomerCreditTransfer
underCustomerCreditTransfer
;
public
String
getEndToEndId
()
{
return
endToEndId
;
}
public
void
setEndToEndId
(
String
endToEndId
)
{
this
.
endToEndId
=
endToEndId
;
}
public
Date
getDebitDate
()
{
return
debitDate
;
}
...
...
@@ -174,6 +166,14 @@ public class VoFinancialInstitutionCreditTransfer extends SwiftDto{
this
.
instForNxtAgt
=
instForNxtAgt
;
}
public
TransactionReference
getTxnRef
()
{
return
txnRef
;
}
public
void
setTxnRef
(
TransactionReference
txnRef
)
{
this
.
txnRef
=
txnRef
;
}
public
VoCustomerCreditTransfer
getUnderCustomerCreditTransfer
()
{
return
underCustomerCreditTransfer
;
}
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/common/ChargeInfo.java
0 → 100644
View file @
be410ce5
package
com
.
brilliance
.
swift
.
vo
.
common
;
public
class
ChargeInfo
{
private
CcyFormatAmount
amt
;
private
PartyDto
partyDto
;
public
CcyFormatAmount
getAmt
()
{
return
amt
;
}
public
void
setAmt
(
CcyFormatAmount
amt
)
{
this
.
amt
=
amt
;
}
public
PartyDto
getPartyDto
()
{
return
partyDto
;
}
public
void
setPartyDto
(
PartyDto
partyDto
)
{
this
.
partyDto
=
partyDto
;
}
}
swiftCore/src/main/java/com/brilliance/swift/vo/common/TransactionReference.java
0 → 100644
View file @
be410ce5
package
com
.
brilliance
.
swift
.
vo
.
common
;
public
class
TransactionReference
{
private
String
instructionId
;
private
String
endToEndId
;
private
String
uetr
;
public
String
getInstructionId
()
{
return
instructionId
;
}
public
void
setInstructionId
(
String
instructionId
)
{
this
.
instructionId
=
instructionId
;
}
public
String
getEndToEndId
()
{
return
endToEndId
;
}
public
void
setEndToEndId
(
String
endToEndId
)
{
this
.
endToEndId
=
endToEndId
;
}
public
String
getUetr
()
{
return
uetr
;
}
public
void
setUetr
(
String
uetr
)
{
this
.
uetr
=
uetr
;
}
}
swiftCore/src/main/resources/swiftJson/BankToCustomerStatement.json
View file @
be410ce5
{
"txnRef"
:
{
"endToEndId"
:
"S100000189-735"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
},
"account"
:
{
"account"
:
"15612345678012345"
"account"
:
"
S
15612345678012345"
},
"pgNb"
:
"178"
,
"elctrncSeqNb"
:
"200"
,
...
...
@@ -17,37 +21,24 @@
{
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"bookDate"
:
"2022-03-30 00:00:00,000"
,
"cdtDbtCode"
:
"
CRD
T"
,
"cdtDbtCode"
:
"
DBI
T"
,
"amt"
:
{
"ccy"
:
"USD"
,
"amt"
:
393.17
},
"bankTransactionCodeStructure"
:
{
"domianCode"
:
"PMNT"
,
"familyCode"
:
"ICHQ"
,
"subFamilyCode"
:
"CCHQ"
},
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH WUHAN"
,
"addtlNtryInf"
:
"CHINESE BEIJING
CHINESE SHANGHAICHINESE WUHANCHINESE GUANGZHOUCHINESE HANGZHOUCHINESE SHENZHEN
"
"addtlNtryInf"
:
"CHINESE BEIJING"
},
{
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"bookDate"
:
"2022-03-30 00:00:00,000"
,
"cdtDbtCode"
:
"DBIT"
,
"reversalIndicator"
:
true
,
"amt"
:
{
"ccy"
:
"USD"
,
"amt"
:
445
},
"bankTransactionCodeStructure"
:
{
"domianCode"
:
"PMNT"
,
"familyCode"
:
"ICHQ"
,
"subFamilyCode"
:
"CCHQ"
},
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH STORITEV"
}
],
...
...
@@ -81,11 +72,14 @@
}
],
"additionalStatementInformation"
:
"HELLO WORLD"
,
"messageType"
:
"camt.053.001"
,
"senderBic"
:
"SHWHQWER123"
,
"receiverBic"
:
"BJWHS12X"
,
"createDate"
:
"2022-05-07 10:54:53,581"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"00010013800002001234"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
"swiftHeader"
:
{
"senderBic"
:
"SHWHQWER123"
,
"receiverBic"
:
"BJWHS12X"
,
"messageId"
:
"00010013800002001234"
,
"messageDefId"
:
"camt.053.001.08"
,
"messageType"
:
"camt.053.001"
,
"version"
:
"08"
,
"createDate"
:
"2022-04-28 10:23:46,048"
,
"messagePriority"
:
"NORM"
}
}
\ No newline at end of file
swiftCore/src/main/resources/swiftJson/BankToStatement.json
View file @
be410ce5
{
"txnRef"
:
{
"endToEndId"
:
"S100000189-735"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
},
"account"
:
{
"account"
:
"15612345678012345"
"account"
:
"
S
15612345678012345"
},
"pgNb"
:
"178"
,
"elctrncSeqNb"
:
"200"
,
...
...
@@ -22,13 +26,7 @@
"ccy"
:
"USD"
,
"amt"
:
393.17
},
"bankTransactionCodeStructure"
:
{
"domianCode"
:
"PMNT"
,
"familyCode"
:
"ICHQ"
,
"subFamilyCode"
:
"CCHQ"
},
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH WUHAN"
},
{
...
...
@@ -39,31 +37,18 @@
"ccy"
:
"USD"
,
"amt"
:
445
},
"bankTransactionCodeStructure"
:
{
"domianCode"
:
"PMNT"
,
"familyCode"
:
"ICHQ"
,
"subFamilyCode"
:
"CCHQ"
},
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH STORITEV"
}
],
"closingBalance"
:
{
"code"
:
"ITBD"
,
"cdtDbtCode"
:
"DBIT"
,
"date"
:
"2022-03-30 00:00:00,000"
,
"amt"
:
{
"ccy"
:
"USD"
,
"amt"
:
123456.29
}
},
"messageType"
:
"camt.053.001"
,
"version"
:
"08"
,
"senderBic"
:
"SHWHQWER123"
,
"receiverBic"
:
"BJWHS12X"
,
"createDate"
:
"2022-05-07 11:39:42,601"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"00010013800002001234"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
"swiftHeader"
:
{
"senderBic"
:
"SHWHQWER123"
,
"receiverBic"
:
"BJWHS12X"
,
"messageId"
:
"00010013800002001234"
,
"messageDefId"
:
"camt.053.001.08"
,
"messageType"
:
"camt.053.001"
,
"version"
:
"08"
,
"createDate"
:
"2022-04-28 10:24:00,960"
,
"messagePriority"
:
"NORM"
}
}
\ No newline at end of file
swiftCore/src/main/resources/swiftJson/CustomerCreditTransfer.json
View file @
be410ce5
{
"debitDate"
:
"2022-04-26 22:24:00,000"
,
"creditDate"
:
"2022-04-27 00:30:00,000"
,
"clsDate"
:
"2022-04-26 23:21:00,000"
,
"bussinessCode"
:
"SDVA"
,
"instructionCodes"
:
[
"SDVA"
,
"BNKK"
,
"GHJK/789556"
],
"txnTypeCode"
:
"GCY"
,
"txnRef"
:
{
"instructionId"
:
"GTBEXO12345"
,
"endToEndId"
:
"GTBEXO12345"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
},
"debitDate"
:
"2022-03-13 21:24:42,112"
,
"creditDate"
:
"2022-03-13 23:30:42,112"
,
"clsDate"
:
"2022-03-13 22:21:42,112"
,
"serviceLevel"
:
{
"code"
:
"SDVA"
,
"proprietary"
:
"1231234165"
},
"categoryPurpose"
:
{
"code"
:
"CASH"
},
"purposeChoice"
:
{
"proprietary"
:
"GCY"
},
"settledDate"
:
"2022-03-13 00:00:00,000"
,
"settledCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
23453.1
3
"amt"
:
23453.1
27
},
"InstructedCcyFormatAmount"
:
{
"ccy"
:
"EUR"
,
"amt"
:
1345.12
},
"exchangeRate"
:
17.4357135422
,
"settleAccount"
:
{
"account"
:
"00010013800002001234"
},
"debitParty"
:
{
"partyBic"
:
"GCYXXXXXX12"
,
"partyName"
:
"JOE PurpDOE"
,
"addressList"
:
[
"310 Field Road, NY"
,
"XXXX"
,
"PSBC"
,
"BJSH"
],
"partyAcct"
:
{
"account"
:
"
123456
"
"account"
:
"
01111001759234567890
"
}
},
"debitAgtParty"
:
{
...
...
@@ -41,11 +59,7 @@
"partyBic"
:
"FOOBARC6"
},
"creditAgtParty"
:
{
"partyBic"
:
"BANKANC7"
,
"clrSysMmb"
:
{
"code"
:
"ATBLZ"
,
"id"
:
"8193234"
}
"partyBic"
:
"BANKANC7"
},
"creditParty"
:
{
"partyName"
:
"TEST CORP"
,
...
...
@@ -56,30 +70,41 @@
"account"
:
"00013500510020179998"
}
},
"remittanceInfos"
:
[
"gechengyang"
],
"chargeFor"
:
"DEBT"
,
"chargeCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
12.43
"remittanceInfo"
:
{
"unstructured"
:
[
"gechengyang"
,
"weicong"
]
},
"chargeFor"
:
"DEBT"
,
"chargeInfos"
:
[
{
"amt"
:
{
"ccy"
:
"USD"
,
"amt"
:
12.43
}
}
],
"preInstgAgtParty"
:
{
"partyBic"
:
"FOOBARC7"
},
"instForCrdAgtInfo"
:
{
"info"
:
"789556"
"instForCrdAgt"
:
{
"code"
:
"TELB"
,
"instrInf"
:
"789556"
},
"regulatoryReportings"
:
[
"/ORDERRES/BE//MEILAAN 1, 9000 GENT"
,
"//JIANGXIAQU"
,
"//WENHUADADAO"
],
"messageType"
:
"pacs.008.001"
,
"senderBic"
:
"BANKANC0"
,
"receiverBic"
:
"FOOBARC0"
,
"createDate"
:
"2022-04-26 11:31:16,074"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"TBEXO12345"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
"swiftHeader"
:
{
"senderBic"
:
"BANKANC0XXX"
,
"receiverBic"
:
"FOOBARC0"
,
"messageId"
:
"TBEXO12345"
,
"messageDefId"
:
"pacs.008.001.09"
,
"messageType"
:
"pacs.008.001"
,
"version"
:
"09"
,
"businessService"
:
"swift.cbprplus.02"
,
"createDate"
:
"2020-09-08 10:10:47,000"
}
}
\ No newline at end of file
swiftCore/src/main/resources/swiftJson/FinancialInstitutionCreditTransfer.json
View file @
be410ce5
{
"endToEndId"
:
"NOTPROVIDED"
,
"debitDate"
:
"2022-04-25 12:35:00,000"
,
"creditDate"
:
"2022-04-25 13:35:00,000"
,
"clsDate"
:
"2022-04-25 14:35:00,000"
,
"txnRef"
:
{
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
},
"debitDate"
:
"2022-04-02 19:35:04,807"
,
"creditDate"
:
"2022-04-02 20:35:04,807"
,
"clsDate"
:
"1970-01-01 21:35:04,807"
,
"settledDate"
:
"2022-04-02 00:00:00,000"
,
"settledCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
120274.34
},
"debitParty"
:
{
"partyName"
:
"QWER"
,
"partyBic"
:
"ZASXCDFV"
,
"partyName"
:
"uiopp"
,
"addressList"
:
[
"12"
,
"234"
,
"123"
"11"
,
"22"
,
"33"
,
"44"
,
"55"
],
"partyAcct"
:
{
"ibanAcct"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"instgAgtParty"
:
{
"partyBic"
:
"DEUTNL2A"
"partyBic"
:
"DEUTNL2A"
,
"partyName"
:
"NUM123"
},
"instdAgtParty"
:
{
"partyBic"
:
"DEUTDEFF"
,
"partyName"
:
"NUM123"
,
"partyAcct"
:
{
"ibanAcct"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"intrmyAgtParty"
:
{
"partyBic"
:
"AQWSFRED"
,
"partyBic"
:
"QWERFDSA"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
,
"55"
],
"partyAcct"
:
{
"ibanAcct"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"creditAgtParty"
:
{
"partyBic"
:
"AQWSDERF"
"partyBic"
:
"ASDFEDRF"
,
"partyName"
:
"uiopp"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
,
"55"
],
"partyAcct"
:
{
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"creditParty"
:
{
"partyBic"
:
"ZXCDQWER"
},
"preInstgAgtParty"
:
{
"partyName"
:
"5555555"
"partyBic"
:
"anybic01"
,
"partyName"
:
"33333333"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
],
"partyAcct"
:
{
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"instForCrdAgt
Info
"
:
{
"code"
:
"
TEL
B"
,
"in
fo
"
:
"456"
"instForCrdAgt"
:
{
"code"
:
"
PHO
B"
,
"in
strInf
"
:
"456"
},
"instForNxtAgt
Info
"
:
{
"instForNxtAgt"
:
{
"code"
:
"TELA"
,
"info"
:
"ins123"
},
"messageType"
:
"pacs.009.001"
,
"senderBic"
:
"DEUTDEFF"
,
"receiverBic"
:
"DEUTNL2A"
,
"createDate"
:
"2022-04-25 11:21:51,614"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"00010013800002001234"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
}
\ No newline at end of file
"instrInf"
:
"ins123"
},
"swiftHeader"
:
{
"senderBic"
:
"DEUTDEFF"
,
"receiverBic"
:
"DEUTNL2A"
,
"messageId"
:
"pacs8bizmsgidr02"
,
"messageDefId"
:
"pacs.009.001.02"
,
"messageType"
:
"pacs.009.001"
,
"version"
:
"09"
,
"businessService"
:
"swift.cbprplus.02"
,
"createDate"
:
"2020-09-08 10:10:47,000"
}
}
swiftCore/src/main/resources/swiftJson/FinancialInstitutionCreditTransfer_COV.json
View file @
be410ce5
{
"endToEndId"
:
"end456"
,
"debitDate"
:
"2022-04-29 12:35:00,000"
,
"creditDate"
:
"2022-04-29 13:35:00,000"
,
"clsDate"
:
"2022-04-29 14:35:00,000"
,
"txnRef"
:
{
"endToEndId"
:
"end456"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
},
"debitDate"
:
"2022-04-02 12:35:04,807"
,
"creditDate"
:
"2022-04-02 13:35:04,807"
,
"clsDate"
:
"1970-01-01 14:35:04,807"
,
"settledDate"
:
"2022-04-02 00:00:00,000"
,
"settledCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
120274.34
},
"debitParty"
:
{
"partyName"
:
"QWER"
,
"partyBic"
:
"QWERXSAD"
,
"partyName"
:
"uiopp"
,
"addressList"
:
[
"12"
,
"234"
,
"123"
"11"
,
"22"
,
"33"
,
"44"
,
"55"
],
"partyAcct"
:
{
"account"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"instgAgtParty"
:
{
"partyBic"
:
"DEUTNL2A"
"partyBic"
:
"DEUTNL2A"
,
"partyName"
:
"NUM123"
},
"instdAgtParty"
:
{
"partyBic"
:
"DEUTDEFF"
,
"partyName"
:
"NUM123"
,
"partyAcct"
:
{
"account"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"intrmyAgtParty"
:
{
"partyBic"
:
"AQWSFRED"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
,
"55"
],
"partyAcct"
:
{
"account"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"creditAgtParty"
:
{
"partyBic"
:
"AQWSDERF"
"partyBic"
:
"AQWSDERF"
,
"partyName"
:
"uiopp"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
,
"55"
]
},
"creditParty"
:
{
"partyBic"
:
"ZXCDQWER"
},
"preInstgAgtParty"
:
{
"partyName"
:
"5555555"
"partyBic"
:
"anybic01"
,
"partyName"
:
"33333333"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
]
},
"instForCrdAgt"
:
{
"code"
:
"
TEL
B"
,
"code"
:
"
PHO
B"
,
"instrInf"
:
"456"
},
"instForNxtAgt"
:
{
...
...
@@ -54,56 +93,119 @@
"underCustomerCreditTransfer"
:
{
"InstructedCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
120274.34
"amt"
:
393.17
},
"debitParty"
:
{
"partyBic"
:
"ANYBIC01"
,
"partyName"
:
"nm01"
,
"addressList"
:
[
"ade456"
],
"partyAcct"
:
{
"account"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"debitAgtParty"
:
{
"partyBic"
:
"QWERTYUI"
,
"partyName"
:
"nm333333"
,
"addressList"
:
[
"adr789"
],
"partyAcct"
:
{
"account"
:
"S123"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S123"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"intrmyAgtParty"
:
{
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
,
"55"
],
"partyAcct"
:
{
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S123456"
,
"acctSehemeType"
:
{
"code"
:
"
CUID
"
"code"
:
"
BBAN
"
}
},
"clrSysMmb"
:
{
"code"
:
"cd02"
,
"proprietary"
:
"prtry01"
,
"id"
:
"mmbid01"
}
},
"creditAgtParty"
:
{
"partyBic"
:
"ASDFRTEW"
,
"partyName"
:
"uiopp"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
,
"44"
,
"55"
],
"partyAcct"
:
{
"account"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
},
"clrSysMmb"
:
{
"code"
:
"cd02"
,
"proprietary"
:
"prtry01"
,
"id"
:
"mmbid01"
}
},
"creditParty"
:
{
"partyBic"
:
"anybic01"
,
"partyName"
:
"33333333"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
"33"
,
"44"
],
"partyAcct"
:
{
"account"
:
"S15612345678012345"
"account"
:
"789465123132165"
,
"ibanAcct"
:
"S15612345678012345"
,
"acctSehemeType"
:
{
"code"
:
"BBAN"
}
}
},
"remittanceInfo"
:
{
"unstructured"
:
[
"1111"
]
},
"instForCrdAgt"
:
{
"code"
:
"PHOB"
,
"instrInf"
:
"789556"
},
"instForNxtAgt"
:
{
"code"
:
"PHOA"
,
"instrInf"
:
"823456"
}
},
"messageType"
:
"pacs.009.001"
,
"senderBic"
:
"DEUTDEFF"
,
"receiverBic"
:
"DEUTNL2A"
,
"createDate"
:
"2022-04-29 17:20:56,320"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"00010013800002001234"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
"swiftHeader"
:
{
"senderBic"
:
"DEUTDEFF"
,
"receiverBic"
:
"DEUTNL2A"
,
"messageId"
:
"pacs8bizmsgidr02"
,
"messageDefId"
:
"pacs.009.001.02"
,
"messageType"
:
"pacs.009.001"
,
"version"
:
"09"
,
"businessService"
:
"swift.cbprplus.02"
,
"createDate"
:
"2020-09-08 10:10:47,000"
}
}
\ No newline at end of file
swiftCore/src/main/resources/swiftXml/MxCamt05300108_940.xml
View file @
be410ce5
...
...
@@ -40,7 +40,6 @@
</Othr>
</Id>
</Acct>
<Bal></Bal>
<Bal>
<Tp>
<CdOrPrtry>
...
...
@@ -50,7 +49,7 @@
<Amt
Ccy=
"USD"
>
120274.34
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<Dt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</Dt>
</Bal>
<Bal>
...
...
@@ -62,7 +61,7 @@
<Amt
Ccy=
"USD"
>
123456.29
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<Dt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</Dt>
</Bal>
<Bal>
...
...
@@ -74,7 +73,7 @@
<Amt
Ccy=
"USD"
>
119609.29
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<Dt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</Dt>
</Bal>
<Bal>
...
...
@@ -86,18 +85,17 @@
<Amt
Ccy=
"USD"
>
120274.34
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<Dt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</Dt>
</Bal>
<Ntry></Ntry>
<Ntry>
<Amt
Ccy=
"USD"
>
393.17
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<BookgDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</BookgDt>
<ValDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</ValDt>
<AcctSvcrRef>
1309170100000390154395
</AcctSvcrRef>
<BkTxCd>
...
...
@@ -120,10 +118,10 @@
<Amt
Ccy=
"USD"
>
445
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<BookgDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</BookgDt>
<ValDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</ValDt>
<AcctSvcrRef>
1309170100000390154395
</AcctSvcrRef>
<BkTxCd>
...
...
swiftCore/src/main/resources/swiftXml/MxCamt05300108_950.xml
View file @
be410ce5
...
...
@@ -40,7 +40,6 @@
</Othr>
</Id>
</Acct>
<Bal></Bal>
<Bal>
<Tp>
<CdOrPrtry>
...
...
@@ -50,7 +49,7 @@
<Amt
Ccy=
"USD"
>
120274.34
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<Dt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</Dt>
</Bal>
<Bal>
...
...
@@ -62,18 +61,17 @@
<Amt
Ccy=
"USD"
>
123456.29
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<Dt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</Dt>
</Bal>
<Ntry></Ntry>
<Ntry>
<Amt
Ccy=
"USD"
>
393.17
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<BookgDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</BookgDt>
<ValDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</ValDt>
<AcctSvcrRef>
1309170100000390154395
</AcctSvcrRef>
<BkTxCd>
...
...
@@ -95,10 +93,10 @@
<Amt
Ccy=
"USD"
>
445
</Amt>
<CdtDbtInd>
DBIT
</CdtDbtInd>
<BookgDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</BookgDt>
<ValDt>
<Dt>
2022-03-30
+08:00
</Dt>
<Dt>
2022-03-30
</Dt>
</ValDt>
<AcctSvcrRef>
1309170100000390154395
</AcctSvcrRef>
<BkTxCd>
...
...
swiftCore/src/main/resources/swiftXml/MxPacs0080010
2
.xml
→
swiftCore/src/main/resources/swiftXml/MxPacs0080010
9
.xml
View file @
be410ce5
...
...
@@ -20,7 +20,7 @@
<BizSvc>
swift.cbprplus.02
</BizSvc>
<CreDt>
2020-09-08T10:10:47+08:00
</CreDt>
</AppHdr>
<Doc:Document
xmlns:Doc=
"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.0
2
"
>
<Doc:Document
xmlns:Doc=
"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.0
9
"
>
<Doc:FIToFICstmrCdtTrf>
<Doc:GrpHdr>
<Doc:MsgId>
TBEXO12345
</Doc:MsgId>
...
...
@@ -97,7 +97,9 @@
<Doc:InstdAmt
Ccy=
"EUR"
>
1345.12
</Doc:InstdAmt>
<Doc:XchgRate>
17.4357135422
</Doc:XchgRate>
<Doc:ChrgBr>
DEBT
</Doc:ChrgBr>
<Doc:ChrgsInf
Ccy=
"USD"
>
12.43
</Doc:ChrgsInf>
<Doc:ChrgsInf>
<Doc:Amt
Ccy=
"USD"
>
12.43
</Doc:Amt>
</Doc:ChrgsInf>
<Doc:Dbtr>
<Doc:Nm>
JOE PurpDOE
</Doc:Nm>
<Doc:PstlAdr>
...
...
swiftCore/src/main/resources/swiftXml/MxPacs0090010
2
.xml
→
swiftCore/src/main/resources/swiftXml/MxPacs0090010
9
.xml
View file @
be410ce5
...
...
@@ -20,7 +20,7 @@
<BizSvc>
swift.cbprplus.02
</BizSvc>
<CreDt>
2020-09-08T10:10:47+08:00
</CreDt>
</AppHdr>
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:pacs.009.001.0
2
"
>
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:pacs.009.001.0
9
"
>
<FinInstnCdtTrf>
<GrpHdr>
<MsgId>
00010013800002001234
</MsgId>
...
...
swiftCore/src/main/resources/swiftXml/MxPacs0090010
2
_COV.xml
→
swiftCore/src/main/resources/swiftXml/MxPacs0090010
9
_COV.xml
View file @
be410ce5
...
...
@@ -20,7 +20,7 @@
<BizSvc>
swift.cbprplus.02
</BizSvc>
<CreDt>
2020-09-08T10:10:47+08:00
</CreDt>
</AppHdr>
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:pacs.009.001.0
2
"
>
<Document
xmlns=
"urn:iso:std:iso:20022:tech:xsd:pacs.009.001.0
9
"
>
<FinInstnCdtTrf>
<GrpHdr>
<MsgId>
00010013800002001234
</MsgId>
...
...
swiftCore/src/test/java/com/brilliance/mt2mx/pacs009001/Test.java
View file @
be410ce5
...
...
@@ -22,6 +22,12 @@ public class Test {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
//test202();
test202Cov
();
//test202Cov();
String
messageId
=
"camt.053.001.08"
;
String
[]
messageIds
=
messageId
.
split
(
"\\."
);
if
(
messageIds
.
length
==
4
)
{
System
.
out
.
println
(
messageId
.
substring
(
messageId
.
lastIndexOf
(
"."
)+
1
));
System
.
out
.
println
(
messageId
.
substring
(
0
,
messageId
.
lastIndexOf
(
"."
)));
}
}
}
swiftCore/src/test/java/com/brilliance/mx2mt/mt103/TestMx2MtFor103.java
View file @
be410ce5
...
...
@@ -8,7 +8,7 @@ import java.io.File;
public
class
TestMx2MtFor103
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
mt103
=
SwiftTransfer
.
mx2Mt
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0080010
2
.xml"
),
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0080010
9
.xml"
),
"d:/test/MT103.txt"
,
null
);
System
.
out
.
println
(
mt103
);
}
...
...
swiftCore/src/test/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202.java
View file @
be410ce5
...
...
@@ -7,7 +7,7 @@ import java.io.File;
public
class
TestMx2MtFor202
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
mt202
=
SwiftTransfer
.
mx2Mt
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
2
.xml"
),
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
9
.xml"
),
"d:/test/MT202.txt"
,
null
);
System
.
out
.
println
(
mt202
);
}
...
...
swiftCore/src/test/java/com/brilliance/mx2mt/mt202/TestMx2MtFor202COV.java
View file @
be410ce5
...
...
@@ -7,7 +7,7 @@ import java.io.File;
public
class
TestMx2MtFor202COV
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
mt202Cov
=
SwiftTransfer
.
mx2Mt
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
2
_COV.xml"
),
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
9
_COV.xml"
),
"d:/test/MT202Cov.txt"
,
null
);
System
.
out
.
println
(
mt202Cov
);
}
...
...
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt103/Test.java
0 → 100644
View file @
be410ce5
package
com
.
brilliance
.
mx2mtmap
.
mt103
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.HashMap
;
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\\MxPacs00800109.xml"
));
Map
<
String
,
Object
>
extraMap
=
new
HashMap
<>();
extraMap
.
put
(
"bnkBic"
,
"BANKANC0XXX"
);
//发报
//extraMap.put("bnkBic", "FOOBARC0");//收报
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2MtMap
(
xmlStr
,
extraMap
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
"="
+
v
));
}
}
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt202/Test.java
0 → 100644
View file @
be410ce5
package
com
.
brilliance
.
mx2mtmap
.
mt202
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Test
{
private
static
void
test202
()
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00800109.xml"
));
Map
<
String
,
Object
>
extraMap
=
new
HashMap
<>();
extraMap
.
put
(
"bnkBic"
,
"BANKANC0XXX"
);
//发报
//extraMap.put("bnkBic", "FOOBARC0");//收报
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2MtMap
(
xmlStr
,
extraMap
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
"="
+
v
));
}
private
static
void
test202Cov
()
throws
IOException
{
String
xmlStr
=
FileUtils
.
readFileToString
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs00900109_COV.xml"
));
Map
<
String
,
Object
>
extraMap
=
new
HashMap
<>();
//extraMap.put("bnkBic", "DEUTDEFF");//发报
extraMap
.
put
(
"bnkBic"
,
"DEUTNL2A"
);
//收报
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2MtMap
(
xmlStr
,
extraMap
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
"="
+
v
));
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
//test202();
test202Cov
();
}
}
swiftCore/src/test/java/com/brilliance/mx2mtmap/mt950/Test.java
0 → 100644
View file @
be410ce5
package
com
.
brilliance
.
mx2mtmap
.
mt950
;
import
com.brilliance.swift.SwiftTransfer
;
import
org.apache.commons.io.FileUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.HashMap
;
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\\MxCamt05300108_950.xml"
));
Map
<
String
,
Object
>
extraMap
=
new
HashMap
<>();
//extraMap.put("bnkBic", "SHWHQWER123");//发报
extraMap
.
put
(
"bnkBic"
,
"BJWHS12X"
);
//收报
Map
<
String
,
String
>
maps
=
SwiftTransfer
.
mx2MtMap
(
xmlStr
,
extraMap
);
maps
.
forEach
((
k
,
v
)
->
System
.
out
.
println
(
k
+
"="
+
v
));
}
}
swiftCore/src/test/java/com/brilliance/mx2swiftdto/bankcusta/Test940.java
View file @
be410ce5
...
...
@@ -8,7 +8,7 @@ import java.io.File;
public
class
Test940
{
public
static
void
main
(
String
[]
args
)
{
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05300108_940.xml"
),
"D:/
MxToSwif
t/BankToCustomerStatement.json"
,
null
);
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05300108_940.xml"
),
"D:/
tes
t/BankToCustomerStatement.json"
,
null
);
System
.
out
.
println
(
swiftDto
);
}
}
swiftCore/src/test/java/com/brilliance/mx2swiftdto/bankcusta/Test950.java
View file @
be410ce5
...
...
@@ -8,7 +8,7 @@ import java.io.File;
public
class
Test950
{
public
static
void
main
(
String
[]
args
)
{
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05300108_950.xml"
),
"D:/
MxToSwif
t/BankToStatement.json"
,
null
);
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxCamt05300108_950.xml"
),
"D:/
tes
t/BankToStatement.json"
,
null
);
System
.
out
.
println
(
swiftDto
);
}
}
swiftCore/src/test/java/com/brilliance/mx2swiftdto/custcdttsf/Test.java
View file @
be410ce5
...
...
@@ -9,7 +9,7 @@ public class Test {
public
static
void
main
(
String
[]
args
)
{
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0080010
2
.xml"
),
"d:/test/CustomerCreditTransfer.json"
,
null
);
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0080010
9
.xml"
),
"d:/test/CustomerCreditTransfer.json"
,
null
);
System
.
out
.
println
(
swiftDto
);
}
}
swiftCore/src/test/java/com/brilliance/mx2swiftdto/fininstcdttsf/Test.java
View file @
be410ce5
...
...
@@ -8,17 +8,17 @@ import java.io.File;
public
class
Test
{
private
static
void
test202
()
{
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
2
.xml"
),
"d:/test/FinancialInstitutionCreditTransfer.json"
,
null
);
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
9
.xml"
),
"d:/test/FinancialInstitutionCreditTransfer.json"
,
null
);
System
.
out
.
println
(
swiftDto
);
}
private
static
void
test202Cov
()
{
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
2
_COV.xml"
),
"d:/test/FinancialInstitutionCreditTransfer.json"
,
null
);
SwiftDto
swiftDto
=
SwiftTransfer
.
mx2SwiftDto
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftXml\\MxPacs0090010
9
_COV.xml"
),
"d:/test/FinancialInstitutionCreditTransfer.json"
,
null
);
System
.
out
.
println
(
swiftDto
);
}
public
static
void
main
(
String
[]
args
)
{
//
test202();
test202Cov
();
test202
();
//
test202Cov();
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt202/Test.java
View file @
be410ce5
...
...
@@ -19,7 +19,7 @@ public class Test {
}
public
static
void
main
(
String
[]
args
)
{
//
test202();
test202Cov
();
test202
();
//
test202Cov();
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt950/Test.java
View file @
be410ce5
...
...
@@ -8,7 +8,7 @@ public class Test {
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\BankToStatement.json"
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
"D:/
SwiftToM
t/MT950.txt"
,
null
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
"D:/
tes
t/MT950.txt"
,
null
);
System
.
out
.
println
(
mtStr
);
}
}
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