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
91498bcd
Commit
91498bcd
authored
Apr 28, 2022
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成940,950,swiftDto转mt
parent
ef7af9d2
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
1123 additions
and
238 deletions
+1123
-238
Camt053001Parse20Field.java
...t/mt2SwiftDto/camt053001/impl/Camt053001Parse20Field.java
+2
-2
Camt053001Parse25aField.java
.../mt2SwiftDto/camt053001/impl/Camt053001Parse25aField.java
+7
-2
Camt053001Parse60aField.java
.../mt2SwiftDto/camt053001/impl/Camt053001Parse60aField.java
+21
-4
Camt053001Parse61Field.java
...t/mt2SwiftDto/camt053001/impl/Camt053001Parse61Field.java
+42
-25
Camt053001Parse62aField.java
.../mt2SwiftDto/camt053001/impl/Camt053001Parse62aField.java
+20
-4
Camt053001Parse64Field.java
...t/mt2SwiftDto/camt053001/impl/Camt053001Parse64Field.java
+20
-4
Camt053001Parse65Field.java
...t/mt2SwiftDto/camt053001/impl/Camt053001Parse65Field.java
+9
-1
SwiftDto2MtCreatorManager.java
...illiance/swift/swiftdto2mt/SwiftDto2MtCreatorManager.java
+5
-1
Tag20Generate.java
...liance/swift/swiftdto2mt/mt900910/impl/Tag20Generate.java
+9
-5
Tag21Generate.java
...liance/swift/swiftdto2mt/mt900910/impl/Tag21Generate.java
+9
-5
Tag25aGenerate.java
...iance/swift/swiftdto2mt/mt900910/impl/Tag25aGenerate.java
+10
-5
Tag32AGenerate.java
...iance/swift/swiftdto2mt/mt900910/impl/Tag32AGenerate.java
+15
-10
Tag50aGenerate.java
...iance/swift/swiftdto2mt/mt900910/impl/Tag50aGenerate.java
+34
-29
Tag52aGenerate.java
...iance/swift/swiftdto2mt/mt900910/impl/Tag52aGenerate.java
+34
-29
Tag56aGenerate.java
...iance/swift/swiftdto2mt/mt900910/impl/Tag56aGenerate.java
+35
-30
SwiftDto2Mt940950Creator.java
.../swift/swiftdto2mt/mt940950/SwiftDto2Mt940950Creator.java
+39
-0
Tag20Generate.java
...liance/swift/swiftdto2mt/mt940950/impl/Tag20Generate.java
+32
-0
Tag21Generate.java
...liance/swift/swiftdto2mt/mt940950/impl/Tag21Generate.java
+26
-0
Tag25aGenerate.java
...iance/swift/swiftdto2mt/mt940950/impl/Tag25aGenerate.java
+31
-0
Tag28CGenerate.java
...iance/swift/swiftdto2mt/mt940950/impl/Tag28CGenerate.java
+32
-0
Tag60aGenerate.java
...iance/swift/swiftdto2mt/mt940950/impl/Tag60aGenerate.java
+60
-0
Tag61Generate.java
...liance/swift/swiftdto2mt/mt940950/impl/Tag61Generate.java
+96
-0
Tag62aGenerate.java
...iance/swift/swiftdto2mt/mt940950/impl/Tag62aGenerate.java
+60
-0
Tag64Generate.java
...liance/swift/swiftdto2mt/mt940950/impl/Tag64Generate.java
+52
-0
Tag65Generate.java
...liance/swift/swiftdto2mt/mt940950/impl/Tag65Generate.java
+63
-0
Tag86Generate.java
...liance/swift/swiftdto2mt/mt940950/impl/Tag86Generate.java
+42
-0
BankToCustomerDebitCreditNotification.java
...iance/swift/vo/BankToCustomerDebitCreditNotification.java
+1
-0
BankToCustomerStatement.java
...java/com/brilliance/swift/vo/BankToCustomerStatement.java
+40
-39
SwiftDtoAdapter.java
...rc/main/java/com/brilliance/swift/vo/SwiftDtoAdapter.java
+2
-0
BalDto.java
.../src/main/java/com/brilliance/swift/vo/common/BalDto.java
+15
-5
statementBreakdown.java
...va/com/brilliance/swift/vo/common/statementBreakdown.java
+26
-8
BankToCustomerCreditNotification.json
...resources/swiftJson/BankToCustomerCreditNotification.json
+8
-5
BankToCustomerDebitNotification.json
.../resources/swiftJson/BankToCustomerDebitNotification.json
+6
-14
BankToCustomerStatement.json
...src/main/resources/swiftJson/BankToCustomerStatement.json
+79
-0
BankToStatement.json
swiftCore/src/main/resources/swiftJson/BankToStatement.json
+57
-0
MT910.txt
swiftCore/src/main/resources/swiftTxt/MT910.txt
+0
-2
MxCamt05300102_940.xml
swiftCore/src/main/resources/swiftXml/MxCamt05300102_940.xml
+2
-2
Test940Camt053001.java
.../brilliance/mt2swiftdto/camt053001/Test940Camt053001.java
+5
-3
Test950Camt053001.java
.../brilliance/mt2swiftdto/camt053001/Test950Camt053001.java
+15
-0
Test900Camt054001.java
.../brilliance/mt2swiftdto/camt054001/Test900Camt054001.java
+15
-0
Test910Camt054001.java
.../brilliance/mt2swiftdto/camt054001/Test910Camt054001.java
+15
-0
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt900/Test.java
+2
-2
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt910/Test.java
+2
-2
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt940/Test.java
+14
-0
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt950/Test.java
+14
-0
No files found.
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse20Field.java
View file @
91498bcd
...
...
@@ -22,14 +22,14 @@ public class Camt053001Parse20Field extends AbstractMt2SwiftDtoParseFields {
Field20
field20
=
mt940
.
getField20
();
if
(
field20
!=
null
){
bankToCustomerStatement
.
setMessageId
(
field20
.
getValue
());
bankToCustomerStatement
.
set
MtType
(
"940
"
);
bankToCustomerStatement
.
set
Cd
(
"FWAV
"
);
}
}
else
{
MT950
mt950
=
(
MT950
)
context
.
get
(
AbstractMT
.
class
);
Field20
field20
=
mt950
.
getField20
();
if
(
field20
!=
null
){
bankToCustomerStatement
.
setMessageId
(
field20
.
getValue
());
bankToCustomerStatement
.
set
MtType
(
"950
"
);
bankToCustomerStatement
.
set
Cd
(
"
"
);
}
}
}
catch
(
Exception
e
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse25aField.java
View file @
91498bcd
...
...
@@ -3,6 +3,7 @@ package com.brilliance.swift.mt2SwiftDto.camt053001.impl;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.mt2SwiftDto.AbstractMt2SwiftDtoParseFields
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.PartyAccount
;
import
com.prowidesoftware.swift.model.field.Field25
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
com.prowidesoftware.swift.model.mt9xx.MT940
;
...
...
@@ -21,13 +22,17 @@ public class Camt053001Parse25aField extends AbstractMt2SwiftDtoParseFields {
MT940
mt940
=
(
MT940
)
context
.
get
(
AbstractMT
.
class
);
Field25
field25
=
mt940
.
getField25
();
if
(
field25
!=
null
){
bankToCustomerStatement
.
setIbanId
(
field25
.
getValue
());
PartyAccount
account
=
new
PartyAccount
();
account
.
setAccount
(
field25
.
getValue
());
bankToCustomerStatement
.
setAccount
(
account
);
}
}
else
{
MT950
mt950
=
(
MT950
)
context
.
get
(
AbstractMT
.
class
);
Field25
field25
=
mt950
.
getField25
();
if
(
field25
!=
null
){
bankToCustomerStatement
.
setIbanId
(
field25
.
getValue
());
PartyAccount
account
=
new
PartyAccount
();
account
.
setAccount
(
field25
.
getValue
());
bankToCustomerStatement
.
setAccount
(
account
);
}
}
}
catch
(
Exception
e
){
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse60aField.java
View file @
91498bcd
...
...
@@ -5,6 +5,7 @@ import com.brilliance.swift.mt2SwiftDto.AbstractMt2SwiftDtoParseFields;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.BalDto
;
import
com.prowidesoftware.swift.model.field.DateContainer
;
import
com.prowidesoftware.swift.model.field.Field60M
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
com.prowidesoftware.swift.model.mt9xx.MT940
;
...
...
@@ -26,11 +27,19 @@ public class Camt053001Parse60aField extends AbstractMt2SwiftDtoParseFields {
}
else
if
(
mt940
.
getField60M
()!=
null
){
Field60M
field60M
=
mt940
.
getField60M
();
BalDto
balDto
=
new
BalDto
();
balDto
.
setBalCdtDbtInd
(
field60M
.
getDCMark
());
balDto
.
setCd
(
"ITBD"
);
String
dcMark
=
field60M
.
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)){
balDto
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
))
{
balDto
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
balDto
.
setDate
(
DateUtil
.
parseDate
(
"20"
+
field60M
.
getDate
(),
"yyyyMMdd"
));
balDto
.
setCcy
(
field60M
.
getCurrency
());
balDto
.
setAmt
(
field60M
.
amount
());
bankToCustomerStatement
.
setOpenBal
(
balDto
);
bankToCustomerStatement
.
setOpenBal
ance
(
balDto
);
}
}
else
{
MT950
mt950
=
(
MT950
)
context
.
get
(
AbstractMT
.
class
);
...
...
@@ -39,11 +48,19 @@ public class Camt053001Parse60aField extends AbstractMt2SwiftDtoParseFields {
}
else
if
(
mt950
.
getField60M
()!=
null
){
Field60M
field60M
=
mt950
.
getField60M
();
BalDto
balDto
=
new
BalDto
();
balDto
.
setBalCdtDbtInd
(
field60M
.
getDCMark
());
balDto
.
setCd
(
"ITBD"
);
String
dcMark
=
field60M
.
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)){
balDto
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
))
{
balDto
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
balDto
.
setDate
(
DateUtil
.
parseDate
(
"20"
+
field60M
.
getDate
(),
"yyyyMMdd"
));
balDto
.
setCcy
(
field60M
.
getCurrency
());
balDto
.
setAmt
(
field60M
.
amount
());
bankToCustomerStatement
.
setOpenBal
(
balDto
);
bankToCustomerStatement
.
setOpenBal
ance
(
balDto
);
}
}
}
catch
(
Exception
e
){
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse61Field.java
View file @
91498bcd
...
...
@@ -4,8 +4,9 @@ import com.brilliance.swift.exception.SwiftException;
import
com.brilliance.swift.mt2SwiftDto.AbstractMt2SwiftDtoParseFields
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.
NtryDto
;
import
com.brilliance.swift.vo.common.
statementBreakdown
;
import
com.prowidesoftware.swift.model.field.Field61
;
import
com.prowidesoftware.swift.model.field.Field86
;
import
com.prowidesoftware.swift.model.mt.AbstractMT
;
import
com.prowidesoftware.swift.model.mt9xx.MT940
;
import
com.prowidesoftware.swift.model.mt9xx.MT950
;
...
...
@@ -24,20 +25,29 @@ public class Camt053001Parse61Field extends AbstractMt2SwiftDtoParseFields {
if
(
context
.
get
(
AbstractMT
.
class
).
getMessageType
().
equals
(
"940"
)){
MT940
mt940
=
(
MT940
)
context
.
get
(
AbstractMT
.
class
);
List
<
Field61
>
field61List
=
mt940
.
getField61
();
List
<
Field86
>
field86List
=
mt940
.
getField86
();
if
(
field61List
.
size
()>
0
)
{
for
(
int
i
=
0
;
i
<
field61List
.
size
();
i
++)
{
NtryDto
ntryDto
=
new
NtryDto
();
ntryDto
.
setValDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getValueDate
(),
"yyyyMMdd"
));
ntryDto
.
setBookDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getEntryDate
(),
"yyyyMMdd"
));
ntryDto
.
setCdtDbtInd
(
field61List
.
get
(
i
).
getDCMark
());
ntryDto
.
setCcy
(
field61List
.
get
(
i
).
getFundsCode
());
ntryDto
.
setAmt
(
field61List
.
get
(
i
).
amount
());
ntryDto
.
setTransactionType
(
field61List
.
get
(
i
).
getTransactionType
());
ntryDto
.
setIdentificationCode
(
field61List
.
get
(
i
).
getIdentificationCode
());
ntryDto
.
setEndToEndId
(
field61List
.
get
(
i
).
getReferenceForTheAccountOwner
());
ntryDto
.
setAddtlTxInf
(
field61List
.
get
(
i
).
getReferenceOfTheAccountServicingInstitution
());
ntryDto
.
setAddtlNtryInf
(
field61List
.
get
(
i
).
getSupplementaryDetails
());
bankToCustomerStatement
.
addNtryDto
(
ntryDto
);
statementBreakdown
statementBreakdown
=
new
statementBreakdown
();
statementBreakdown
.
setValueDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getValueDate
(),
"yyyyMMdd"
));
statementBreakdown
.
setBookDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getEntryDate
(),
"yyyyMMdd"
));
String
dcMark
=
field61List
.
get
(
i
).
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)||
"RC"
.
equals
(
dcMark
)){
statementBreakdown
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
)||
"RD"
.
equals
(
dcMark
))
{
statementBreakdown
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
statementBreakdown
.
setCcy
(
field61List
.
get
(
i
).
getFundsCode
());
statementBreakdown
.
setAmt
(
field61List
.
get
(
i
).
amount
());
statementBreakdown
.
setTransactionType
(
field61List
.
get
(
i
).
getTransactionType
());
statementBreakdown
.
setIdentificationCode
(
field61List
.
get
(
i
).
getIdentificationCode
());
statementBreakdown
.
setEndToEndId
(
field61List
.
get
(
i
).
getReferenceForTheAccountOwner
());
statementBreakdown
.
setAcctSvcrRef
(
field61List
.
get
(
i
).
getReferenceOfTheAccountServicingInstitution
());
statementBreakdown
.
setAddtlTxInf
(
field61List
.
get
(
i
).
getSupplementaryDetails
());
statementBreakdown
.
setAddtlNtryInf
(
field86List
.
get
(
i
).
getValue
());
bankToCustomerStatement
.
addNtryDto
(
statementBreakdown
);
}
}
}
else
{
...
...
@@ -45,18 +55,25 @@ public class Camt053001Parse61Field extends AbstractMt2SwiftDtoParseFields {
List
<
Field61
>
field61List
=
mt950
.
getField61
();
if
(
field61List
.
size
()>
0
)
{
for
(
int
i
=
0
;
i
<
field61List
.
size
();
i
++)
{
NtryDto
ntryDto
=
new
NtryDto
();
ntryDto
.
setValDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getValueDate
(),
"yyyyMMdd"
));
ntryDto
.
setBookDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getEntryDate
(),
"yyyyMMdd"
));
ntryDto
.
setCdtDbtInd
(
field61List
.
get
(
i
).
getDCMark
());
ntryDto
.
setCcy
(
field61List
.
get
(
i
).
getFundsCode
());
ntryDto
.
setAmt
(
field61List
.
get
(
i
).
amount
());
ntryDto
.
setTransactionType
(
field61List
.
get
(
i
).
getTransactionType
());
ntryDto
.
setIdentificationCode
(
field61List
.
get
(
i
).
getIdentificationCode
());
ntryDto
.
setEndToEndId
(
field61List
.
get
(
i
).
getReferenceForTheAccountOwner
());
ntryDto
.
setAddtlTxInf
(
field61List
.
get
(
i
).
getReferenceOfTheAccountServicingInstitution
());
ntryDto
.
setAddtlNtryInf
(
field61List
.
get
(
i
).
getSupplementaryDetails
());
bankToCustomerStatement
.
addNtryDto
(
ntryDto
);
statementBreakdown
statementBreakdown
=
new
statementBreakdown
();
statementBreakdown
.
setValueDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getValueDate
(),
"yyyyMMdd"
));
statementBreakdown
.
setBookDate
(
DateUtil
.
parseDate
(
"20"
+
field61List
.
get
(
i
).
getEntryDate
(),
"yyyyMMdd"
));
String
dcMark
=
field61List
.
get
(
i
).
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)||
"RC"
.
equals
(
dcMark
)){
statementBreakdown
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
)||
"RD"
.
equals
(
dcMark
))
{
statementBreakdown
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
statementBreakdown
.
setCcy
(
field61List
.
get
(
i
).
getFundsCode
());
statementBreakdown
.
setAmt
(
field61List
.
get
(
i
).
amount
());
statementBreakdown
.
setTransactionType
(
field61List
.
get
(
i
).
getTransactionType
());
statementBreakdown
.
setIdentificationCode
(
field61List
.
get
(
i
).
getIdentificationCode
());
statementBreakdown
.
setEndToEndId
(
field61List
.
get
(
i
).
getReferenceForTheAccountOwner
());
statementBreakdown
.
setAcctSvcrRef
(
field61List
.
get
(
i
).
getReferenceOfTheAccountServicingInstitution
());
statementBreakdown
.
setAddtlTxInf
(
field61List
.
get
(
i
).
getSupplementaryDetails
());
bankToCustomerStatement
.
addNtryDto
(
statementBreakdown
);
}
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse62aField.java
View file @
91498bcd
...
...
@@ -26,11 +26,19 @@ public class Camt053001Parse62aField extends AbstractMt2SwiftDtoParseFields {
}
else
if
(
mt940
.
getField62M
()!=
null
){
Field62M
field62M
=
mt940
.
getField62M
();
BalDto
balDto
=
new
BalDto
();
balDto
.
setBalCdtDbtInd
(
field62M
.
getDCMark
());
balDto
.
setCd
(
"ITBD"
);
String
dcMark
=
field62M
.
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)){
balDto
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
))
{
balDto
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
balDto
.
setDate
(
DateUtil
.
parseDate
(
"20"
+
field62M
.
getDate
(),
"yyyyMMdd"
));
balDto
.
setCcy
(
field62M
.
getCurrency
());
balDto
.
setAmt
(
field62M
.
amount
());
bankToCustomerStatement
.
setClos
Bal
(
balDto
);
bankToCustomerStatement
.
setClos
ingBalance
(
balDto
);
}
}
else
{
MT950
mt950
=
(
MT950
)
context
.
get
(
AbstractMT
.
class
);
...
...
@@ -39,11 +47,19 @@ public class Camt053001Parse62aField extends AbstractMt2SwiftDtoParseFields {
}
else
if
(
mt950
.
getField62M
()!=
null
){
Field62M
field62M
=
mt950
.
getField62M
();
BalDto
balDto
=
new
BalDto
();
balDto
.
setBalCdtDbtInd
(
field62M
.
getDCMark
());
balDto
.
setCd
(
"ITBD"
);
String
dcMark
=
field62M
.
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)){
balDto
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
))
{
balDto
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
balDto
.
setDate
(
DateUtil
.
parseDate
(
"20"
+
field62M
.
getDate
(),
"yyyyMMdd"
));
balDto
.
setCcy
(
field62M
.
getCurrency
());
balDto
.
setAmt
(
field62M
.
amount
());
bankToCustomerStatement
.
setClos
Bal
(
balDto
);
bankToCustomerStatement
.
setClos
ingBalance
(
balDto
);
}
}
}
catch
(
Exception
e
){
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse64Field.java
View file @
91498bcd
...
...
@@ -24,22 +24,38 @@ public class Camt053001Parse64Field extends AbstractMt2SwiftDtoParseFields {
Field64
field64
=
mt940
.
getField64
();
if
(
field64
!=
null
)
{
BalDto
balDto
=
new
BalDto
();
balDto
.
setBalCdtDbtInd
(
field64
.
getDCMark
());
balDto
.
setCd
(
"CLAV"
);
String
dcMark
=
field64
.
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)){
balDto
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
))
{
balDto
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
balDto
.
setDate
(
DateUtil
.
parseDate
(
"20"
+
field64
.
getDate
(),
"yyyyMMdd"
));
balDto
.
setCcy
(
field64
.
getCurrency
());
balDto
.
setAmt
(
field64
.
amount
());
bankToCustomerStatement
.
setClos
AvaBal
(
balDto
);
bankToCustomerStatement
.
setClos
ingAvailableBalance
(
balDto
);
}
}
else
{
MT950
mt950
=
(
MT950
)
context
.
get
(
AbstractMT
.
class
);
Field64
field64
=
mt950
.
getField64
();
if
(
field64
!=
null
)
{
BalDto
balDto
=
new
BalDto
();
balDto
.
setBalCdtDbtInd
(
field64
.
getDCMark
());
balDto
.
setCd
(
"CLAV"
);
String
dcMark
=
field64
.
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)){
balDto
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
))
{
balDto
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
balDto
.
setDate
(
DateUtil
.
parseDate
(
"20"
+
field64
.
getDate
(),
"yyyyMMdd"
));
balDto
.
setCcy
(
field64
.
getCurrency
());
balDto
.
setAmt
(
field64
.
amount
());
bankToCustomerStatement
.
setClos
AvaBal
(
balDto
);
bankToCustomerStatement
.
setClos
ingAvailableBalance
(
balDto
);
}
}
}
catch
(
Exception
e
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/camt053001/impl/Camt053001Parse65Field.java
View file @
91498bcd
...
...
@@ -26,7 +26,15 @@ public class Camt053001Parse65Field extends AbstractMt2SwiftDtoParseFields {
if
(
field65List
.
size
()>
0
){
for
(
int
i
=
0
;
i
<
field65List
.
size
();
i
++)
{
BalDto
balDto
=
new
BalDto
();
balDto
.
setBalCdtDbtInd
(
field65List
.
get
(
i
).
getDCMark
());
balDto
.
setCd
(
"FWAV"
);
String
dcMark
=
field65List
.
get
(
i
).
getDCMark
();
if
(
"D"
.
equals
(
dcMark
)){
balDto
.
setCdtDbtInd
(
"DBIT"
);
}
else
if
(
"C"
.
equals
(
dcMark
))
{
balDto
.
setCdtDbtInd
(
"CRDT"
);
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
balDto
.
setDate
(
DateUtil
.
parseDate
(
"20"
+
field65List
.
get
(
i
).
getDate
(),
"yyyyMMdd"
));
balDto
.
setCcy
(
field65List
.
get
(
i
).
getCurrency
());
balDto
.
setAmt
(
field65List
.
get
(
i
).
amount
());
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/SwiftDto2MtCreatorManager.java
View file @
91498bcd
...
...
@@ -4,6 +4,7 @@ import com.brilliance.swift.exception.SwiftException;
import
com.brilliance.swift.swiftdto2mt.mt103.SwiftDto2Mt103Creator
;
import
com.brilliance.swift.swiftdto2mt.mt202.SwiftDto2Mt202Creator
;
import
com.brilliance.swift.swiftdto2mt.mt900910.SwiftDto2Mt900910Creator
;
import
com.brilliance.swift.swiftdto2mt.mt940950.SwiftDto2Mt940950Creator
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.SwiftDto
;
import
org.apache.commons.io.FileUtils
;
...
...
@@ -53,7 +54,10 @@ public class SwiftDto2MtCreatorManager {
return
new
SwiftDto2Mt202Creator
();
}
else
if
(
"camt.054.001"
.
equals
(
messageType
)){
return
new
SwiftDto2Mt900910Creator
();
}
else
{
}
else
if
(
"camt.053.001"
.
equals
(
messageType
)){
return
new
SwiftDto2Mt940950Creator
();
}
else
{
throw
new
SwiftException
(
"Invalid message type"
);
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag20Generate.java
View file @
91498bcd
...
...
@@ -17,11 +17,15 @@ public class Tag20Generate extends AbstractSwiftDto2MtTagGenerate {
@Override
public
void
tagGenerate
()
throws
SwiftException
{
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
()));
try
{
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
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag21Generate.java
View file @
91498bcd
...
...
@@ -17,11 +17,15 @@ public class Tag21Generate extends AbstractSwiftDto2MtTagGenerate {
@Override
public
void
tagGenerate
()
throws
SwiftException
{
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
()));
try
{
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
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag25aGenerate.java
View file @
91498bcd
...
...
@@ -16,11 +16,16 @@ public class Tag25aGenerate extends AbstractSwiftDto2MtTagGenerate {
@Override
public
void
tagGenerate
()
throws
SwiftException
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
bankToCustomerDebitCreditNotification
.
getAccount
()!=
null
){
tags
.
add
(
new
Tag
(
name
,
bankToCustomerDebitCreditNotification
.
getAccount
().
getAccount
()));
try
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
bankToCustomerDebitCreditNotification
.
getAccount
()!=
null
){
tags
.
add
(
new
Tag
(
name
,
bankToCustomerDebitCreditNotification
.
getAccount
().
getAccount
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag32AGenerate.java
View file @
91498bcd
...
...
@@ -20,17 +20,22 @@ public class Tag32AGenerate extends AbstractSwiftDto2MtTagGenerate {
@Override
public
void
tagGenerate
()
throws
SwiftException
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
Date
valueDate
=
bankToCustomerDebitCreditNotification
.
getValueDate
();
CcyFormatAmount
valueAmount
=
bankToCustomerDebitCreditNotification
.
getValueAmount
();
if
(
valueDate
!=
null
&&
valueAmount
!=
null
){
String
dateStr
=
DateUtil
.
format
(
valueDate
,
"yyMMdd"
);
String
ccy
=
valueAmount
.
getCcy
();
String
amt
=
NumberUtil
.
formatAmt
(
valueAmount
.
getAmt
(),
ccy
);
tags
.
add
(
new
Tag
(
name
,
dateStr
+
ccy
+
amt
));
try
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
Date
valueDate
=
bankToCustomerDebitCreditNotification
.
getValueDate
();
CcyFormatAmount
valueAmount
=
bankToCustomerDebitCreditNotification
.
getValueAmount
();
if
(
valueDate
!=
null
&&
valueAmount
!=
null
){
String
dateStr
=
DateUtil
.
format
(
valueDate
,
"yyMMdd"
);
String
ccy
=
valueAmount
.
getCcy
();
String
amt
=
NumberUtil
.
formatAmt
(
valueAmount
.
getAmt
(),
ccy
);
tags
.
add
(
new
Tag
(
name
,
dateStr
+
ccy
+
amt
));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag50aGenerate.java
View file @
91498bcd
...
...
@@ -23,37 +23,42 @@ public class Tag50aGenerate extends AbstractSwiftDto2MtTagGenerate {
@Override
public
void
tagGenerate
()
throws
SwiftException
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
debitParty
=
bankToCustomerDebitCreditNotification
.
getDebitParty
();
if
(
debitParty
!=
null
)
{
String
account
=
getAccount
(
debitParty
);
String
bicCode
=
debitParty
.
getPartyBic
();
String
name
=
debitParty
.
getPartyName
();
String
value
=
""
;
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
value
=
bicCode
;
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
bicCode
;
try
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
debitParty
=
bankToCustomerDebitCreditNotification
.
getDebitParty
();
if
(
debitParty
!=
null
)
{
String
account
=
getAccount
(
debitParty
);
String
bicCode
=
debitParty
.
getPartyBic
();
String
name
=
debitParty
.
getPartyName
();
String
value
=
""
;
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
value
=
bicCode
;
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
bicCode
;
}
tags
.
add
(
new
Tag
(
name_A
,
value
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
if
(
name
.
length
()
>
35
)
name
=
name
.
substring
(
0
,
35
);
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
name
;
}
else
{
value
=
name
;
}
List
<
String
>
addressList
=
debitParty
.
getAddressList
();
for
(
int
i
=
0
;
i
<
addressList
.
size
();
i
++)
{
if
(
i
==
3
)
break
;
String
address
=
addressList
.
get
(
i
);
if
(
address
.
length
()
>
35
)
address
=
address
.
substring
(
0
,
35
);
value
+=
Mx2MtConstants
.
NEW_LINE
+
address
;
}
tags
.
add
(
new
Tag
(
name_K
,
value
));
}
tags
.
add
(
new
Tag
(
name_A
,
value
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
if
(
name
.
length
()
>
35
)
name
=
name
.
substring
(
0
,
35
);
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
name
;
}
else
{
value
=
name
;
}
List
<
String
>
addressList
=
debitParty
.
getAddressList
();
for
(
int
i
=
0
;
i
<
addressList
.
size
();
i
++)
{
if
(
i
==
3
)
break
;
String
address
=
addressList
.
get
(
i
);
if
(
address
.
length
()
>
35
)
address
=
address
.
substring
(
0
,
35
);
value
+=
Mx2MtConstants
.
NEW_LINE
+
address
;
}
tags
.
add
(
new
Tag
(
name_K
,
value
));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag52aGenerate.java
View file @
91498bcd
...
...
@@ -21,37 +21,42 @@ public class Tag52aGenerate extends AbstractSwiftDto2MtTagGenerate {
@Override
public
void
tagGenerate
()
throws
SwiftException
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
debitAgtParty
=
bankToCustomerDebitCreditNotification
.
getDebitAgtParty
();
if
(
debitAgtParty
!=
null
)
{
String
account
=
getAccount
(
debitAgtParty
);
String
bicCode
=
debitAgtParty
.
getPartyBic
();
String
name
=
debitAgtParty
.
getPartyName
();
String
value
=
""
;
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
value
=
bicCode
;
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
bicCode
;
try
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
debitAgtParty
=
bankToCustomerDebitCreditNotification
.
getDebitAgtParty
();
if
(
debitAgtParty
!=
null
)
{
String
account
=
getAccount
(
debitAgtParty
);
String
bicCode
=
debitAgtParty
.
getPartyBic
();
String
name
=
debitAgtParty
.
getPartyName
();
String
value
=
""
;
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
value
=
bicCode
;
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
bicCode
;
}
tags
.
add
(
new
Tag
(
name_A
,
value
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
if
(
name
.
length
()
>
35
)
name
=
name
.
substring
(
0
,
35
);
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
name
;
}
else
{
value
=
name
;
}
List
<
String
>
addressList
=
debitAgtParty
.
getAddressList
();
for
(
int
i
=
0
;
i
<
addressList
.
size
();
i
++)
{
if
(
i
==
3
)
break
;
String
address
=
addressList
.
get
(
i
);
if
(
address
.
length
()
>
35
)
address
=
address
.
substring
(
0
,
35
);
value
+=
Mx2MtConstants
.
NEW_LINE
+
address
;
}
tags
.
add
(
new
Tag
(
name_D
,
value
));
}
tags
.
add
(
new
Tag
(
name_A
,
value
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
if
(
name
.
length
()
>
35
)
name
=
name
.
substring
(
0
,
35
);
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
name
;
}
else
{
value
=
name
;
}
List
<
String
>
addressList
=
debitAgtParty
.
getAddressList
();
for
(
int
i
=
0
;
i
<
addressList
.
size
();
i
++)
{
if
(
i
==
3
)
break
;
String
address
=
addressList
.
get
(
i
);
if
(
address
.
length
()
>
35
)
address
=
address
.
substring
(
0
,
35
);
value
+=
Mx2MtConstants
.
NEW_LINE
+
address
;
}
tags
.
add
(
new
Tag
(
name_D
,
value
));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt900910/impl/Tag56aGenerate.java
View file @
91498bcd
...
...
@@ -23,39 +23,44 @@ public class Tag56aGenerate extends AbstractSwiftDto2MtTagGenerate {
@Override
public
void
tagGenerate
()
throws
SwiftException
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
intrymyAgtParty
=
bankToCustomerDebitCreditNotification
.
getIntrmyAgtParty
();
if
(
intrymyAgtParty
!=
null
)
{
String
account
=
getAccount
(
intrymyAgtParty
);
String
bicCode
=
intrymyAgtParty
.
getPartyBic
();
String
name
=
intrymyAgtParty
.
getPartyName
();
String
value
=
""
;
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
value
=
bicCode
;
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
bicCode
;
}
tags
.
add
(
new
Tag
(
name_A
,
value
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
if
(
name
.
length
()
>
35
)
name
=
name
.
substring
(
0
,
35
);
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
name
;
try
{
BankToCustomerDebitCreditNotification
bankToCustomerDebitCreditNotification
=
(
BankToCustomerDebitCreditNotification
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
intrymyAgtParty
=
bankToCustomerDebitCreditNotification
.
getIntrmyAgtParty
();
if
(
intrymyAgtParty
!=
null
)
{
String
account
=
getAccount
(
intrymyAgtParty
);
String
bicCode
=
intrymyAgtParty
.
getPartyBic
();
String
name
=
intrymyAgtParty
.
getPartyName
();
String
value
=
""
;
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
value
=
bicCode
;
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
bicCode
;
}
tags
.
add
(
new
Tag
(
name_A
,
value
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
if
(
name
.
length
()
>
35
)
name
=
name
.
substring
(
0
,
35
);
if
(
StringUtil
.
isNotEmpty
(
account
))
{
value
=
account
+
Mx2MtConstants
.
NEW_LINE
+
name
;
}
else
{
value
=
name
;
}
List
<
String
>
addressList
=
intrymyAgtParty
.
getAddressList
();
for
(
int
i
=
0
;
i
<
addressList
.
size
();
i
++)
{
if
(
i
==
3
)
break
;
String
address
=
addressList
.
get
(
i
);
if
(
address
.
length
()
>
35
)
address
=
address
.
substring
(
0
,
35
);
value
+=
Mx2MtConstants
.
NEW_LINE
+
address
;
}
tags
.
add
(
new
Tag
(
name_D
,
value
));
}
else
{
value
=
name
;
}
List
<
String
>
addressList
=
intrymyAgtParty
.
getAddressList
();
for
(
int
i
=
0
;
i
<
addressList
.
size
();
i
++)
{
if
(
i
==
3
)
break
;
String
address
=
addressList
.
get
(
i
);
if
(
address
.
length
()
>
35
)
address
=
address
.
substring
(
0
,
35
);
value
+=
Mx2MtConstants
.
NEW_LINE
+
address
;
tags
.
add
(
new
Tag
(
name_C
,
account
));
}
tags
.
add
(
new
Tag
(
name_D
,
value
));
}
else
{
tags
.
add
(
new
Tag
(
name_C
,
account
));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/SwiftDto2Mt940950Creator.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtCreator
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.mt940950.impl.*
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
SwiftDto2Mt940950Creator
extends
AbstractSwiftDto2MtCreator
{
@Override
public
List
<
SwiftDto2MtTagGenerate
>
getGenerateTagList
()
{
List
<
SwiftDto2MtTagGenerate
>
list
=
new
ArrayList
<>();
list
.
add
(
new
Tag20Generate
());
list
.
add
(
new
Tag21Generate
());
list
.
add
(
new
Tag25aGenerate
());
list
.
add
(
new
Tag28CGenerate
());
list
.
add
(
new
Tag60aGenerate
());
list
.
add
(
new
Tag61Generate
());
list
.
add
(
new
Tag62aGenerate
());
list
.
add
(
new
Tag64Generate
());
list
.
add
(
new
Tag65Generate
());
list
.
add
(
new
Tag86Generate
());
return
list
;
}
@Override
protected
String
getMtType
()
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
if
(
bankToCustomerStatement
.
getCd
().
equals
(
"FWAV"
)||
bankToCustomerStatement
.
getAddtlStmtInf
()!=
null
){
return
"940"
;
}
else
{
return
"950"
;
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag20Generate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
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
;
import
java.util.List
;
public
class
Tag20Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"20"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
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
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag21Generate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
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.BankToCustomerStatement
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag21Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"21"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag25aGenerate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
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.BankToCustomerStatement
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag25aGenerate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"25"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
bankToCustomerStatement
.
getAccount
()!=
null
){
tags
.
add
(
new
Tag
(
name
,
bankToCustomerStatement
.
getAccount
().
getAccount
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag28CGenerate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
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.BankToCustomerStatement
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag28CGenerate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"28"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
String
elctrncSeqNb
=
bankToCustomerStatement
.
getElctrncSeqNb
();
String
pgNb
=
bankToCustomerStatement
.
getPgNb
();
String
value
=
pgNb
+
"/"
+
elctrncSeqNb
;
tags
.
add
(
new
Tag
(
name
,
value
));
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag60aGenerate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.BalDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
public
class
Tag60aGenerate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_F
=
"60F"
;
private
String
name_M
=
"60M"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
BalDto
openBalance
=
bankToCustomerStatement
.
getOpenBalance
();
if
(
openBalance
!=
null
){
String
value
=
""
;
String
dcMark
=
""
;
if
(
"PRCD"
.
equals
(
openBalance
.
getCd
())){
tags
.
add
(
new
Tag
(
name_F
,
""
));
}
else
if
(
"ITBD"
.
equals
(
openBalance
.
getCd
())){
if
(
"CRDT"
.
equals
(
openBalance
.
getCdtDbtInd
())){
dcMark
=
"C"
;
}
else
if
(
"DBIT"
.
equals
(
openBalance
.
getCdtDbtInd
())){
dcMark
=
"D"
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
Date
date
=
openBalance
.
getDate
();
String
ccy
=
openBalance
.
getCcy
();
BigDecimal
amt
=
openBalance
.
getAmt
();
if
(
date
!=
null
&&
ccy
!=
null
){
String
dateStr
=
DateUtil
.
format
(
date
,
"yyMMdd"
);
value
=
dcMark
+
dateStr
+
ccy
+
amt
;
}
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60Option."
);
}
tags
.
add
(
new
Tag
(
name_M
,
value
));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag61Generate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.statementBreakdown
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
public
class
Tag61Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"61"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
statementBreakdown
>
statementLineList
=
bankToCustomerStatement
.
getStatementLine
();
StringBuilder
sb
=
new
StringBuilder
();
if
(
statementLineList
.
size
()
>
0
){
int
count
=
0
;
for
(
statementBreakdown
statementBreakdown
:
statementLineList
)
{
if
(
count
>=
1
){
sb
.
append
(
Mx2MtConstants
.
NEW_LINE
).
append
(
":61:"
);
}
String
valueDateStr
=
""
;
String
bookDateStr
=
""
;
String
dcMark
=
""
;
Date
valueDate
=
statementBreakdown
.
getValueDate
();
Date
bookDate
=
statementBreakdown
.
getBookDate
();
if
(
valueDate
!=
null
){
valueDateStr
=
DateUtil
.
format
(
valueDate
,
"yyMMdd"
);
}
if
(
bookDate
!=
null
){
bookDateStr
=
DateUtil
.
format
(
valueDate
,
"yyMMdd"
);
}
if
(
"CRDT"
.
equals
(
statementBreakdown
.
getCdtDbtInd
())){
if
(
"true"
.
equals
(
statementBreakdown
.
getCdtDbtInd
())){
dcMark
=
"RD"
;
}
else
{
dcMark
=
"C"
;
}
}
else
if
(
"DBIT"
.
equals
(
statementBreakdown
.
getCdtDbtInd
())){
if
(
"true"
.
equals
(
statementBreakdown
.
getCdtDbtInd
())){
dcMark
=
"RC"
;
}
else
{
dcMark
=
"D"
;
}
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed61 D/C Mark."
);
}
String
ccy
=
statementBreakdown
.
getCcy
();
BigDecimal
amt
=
statementBreakdown
.
getAmt
();
String
transactionType
=
statementBreakdown
.
getTransactionType
();
String
identificationCode
=
statementBreakdown
.
getIdentificationCode
();
String
endToEndId
=
statementBreakdown
.
getEndToEndId
();
String
acctSvcrRef
=
statementBreakdown
.
getAcctSvcrRef
();
String
addtlTxInf
=
statementBreakdown
.
getAddtlTxInf
();
String
addtlNtryInf
=
statementBreakdown
.
getAddtlNtryInf
();
sb
.
append
(
valueDateStr
)
.
append
(
bookDateStr
)
.
append
(
dcMark
)
.
append
(
ccy
)
.
append
(
amt
)
.
append
(
transactionType
)
.
append
(
identificationCode
)
.
append
(
endToEndId
);
if
(
StringUtil
.
isNotEmpty
(
acctSvcrRef
))
{
sb
.
append
(
"//"
+
acctSvcrRef
);
}
if
(
StringUtil
.
isNotEmpty
(
addtlTxInf
))
{
sb
.
append
(
Mx2MtConstants
.
NEW_LINE
+
addtlTxInf
);
}
if
(
StringUtil
.
isNotEmpty
(
addtlNtryInf
)){
sb
.
append
(
Mx2MtConstants
.
NEW_LINE
).
append
(
":86:"
).
append
(
StringUtil
.
getStringByEnter
(
addtlNtryInf
,
35
,
6
));
}
count
++;
}
}
tags
.
add
(
new
Tag
(
name
,
sb
.
toString
()));
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag62aGenerate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.BalDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
public
class
Tag62aGenerate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_F
=
"62F"
;
private
String
name_M
=
"62M"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
BalDto
closingBalance
=
bankToCustomerStatement
.
getClosingBalance
();
if
(
closingBalance
!=
null
){
String
value
=
""
;
String
dcMark
=
""
;
if
(
"CLBD"
.
equals
(
closingBalance
.
getCd
())){
tags
.
add
(
new
Tag
(
name_F
,
""
));
}
else
if
(
"ITBD"
.
equals
(
closingBalance
.
getCd
())){
if
(
"CRDT"
.
equals
(
closingBalance
.
getCdtDbtInd
())){
dcMark
=
"C"
;
}
else
if
(
"DBIT"
.
equals
(
closingBalance
.
getCdtDbtInd
())){
dcMark
=
"D"
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
Date
date
=
closingBalance
.
getDate
();
String
ccy
=
closingBalance
.
getCcy
();
BigDecimal
amt
=
closingBalance
.
getAmt
();
if
(
date
!=
null
&&
ccy
!=
null
){
String
dateStr
=
DateUtil
.
format
(
date
,
"yyMMdd"
);
value
=
dcMark
+
dateStr
+
ccy
+
amt
;
}
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60Option."
);
}
tags
.
add
(
new
Tag
(
name_M
,
value
));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag64Generate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.BalDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
public
class
Tag64Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"64"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
BalDto
closingAvailableBalance
=
bankToCustomerStatement
.
getClosingAvailableBalance
();
if
(
closingAvailableBalance
!=
null
&&
"CLBD"
.
equals
(
closingAvailableBalance
.
getCd
())){
String
value
=
""
;
String
dcMark
=
""
;
if
(
"CRDT"
.
equals
(
closingAvailableBalance
.
getCdtDbtInd
())){
dcMark
=
"C"
;
}
else
if
(
"DBIT"
.
equals
(
closingAvailableBalance
.
getCdtDbtInd
())){
dcMark
=
"D"
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
Date
date
=
closingAvailableBalance
.
getDate
();
String
ccy
=
closingAvailableBalance
.
getCcy
();
BigDecimal
amt
=
closingAvailableBalance
.
getAmt
();
if
(
date
!=
null
&&
ccy
!=
null
){
String
dateStr
=
DateUtil
.
format
(
date
,
"yyMMdd"
);
value
=
dcMark
+
dateStr
+
ccy
+
amt
;
}
tags
.
add
(
new
Tag
(
name
,
value
));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag65Generate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.DateUtil
;
import
com.brilliance.swift.util.StringUtil
;
import
com.brilliance.swift.vo.BankToCustomerStatement
;
import
com.brilliance.swift.vo.common.BalDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mx.dic.Value
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
public
class
Tag65Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"65"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
BalDto
>
forwardAvailableBalanceList
=
bankToCustomerStatement
.
getForwardAvailableBalance
();
StringBuilder
sb
=
new
StringBuilder
();
if
(
forwardAvailableBalanceList
.
size
()>
0
){
int
count
=
0
;
for
(
BalDto
forwardAvailableBalance
:
forwardAvailableBalanceList
)
{
if
(
count
>=
1
){
sb
.
append
(
Mx2MtConstants
.
NEW_LINE
).
append
(
":65:"
);
}
if
(
forwardAvailableBalance
!=
null
&&
"FWAV"
.
equals
(
forwardAvailableBalance
.
getCd
())){
String
dcMark
=
""
;
if
(
"CRDT"
.
equals
(
forwardAvailableBalance
.
getCdtDbtInd
())){
dcMark
=
"C"
;
}
else
if
(
"DBIT"
.
equals
(
forwardAvailableBalance
.
getCdtDbtInd
())){
dcMark
=
"D"
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
Date
date
=
forwardAvailableBalance
.
getDate
();
String
ccy
=
forwardAvailableBalance
.
getCcy
();
BigDecimal
amt
=
forwardAvailableBalance
.
getAmt
();
if
(
date
!=
null
&&
ccy
!=
null
){
String
dateStr
=
DateUtil
.
format
(
date
,
"yyMMdd"
);
sb
.
append
(
dcMark
).
append
(
dateStr
).
append
(
ccy
).
append
(
amt
);
}
}
count
++;
}
tags
.
add
(
new
Tag
(
name
,
sb
.
toString
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt940950/impl/Tag86Generate.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt940950
.
impl
;
import
com.brilliance.swift.constants.Mx2MtConstants
;
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.BankToCustomerStatement
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag86Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"86"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
try
{
BankToCustomerStatement
bankToCustomerStatement
=
(
BankToCustomerStatement
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
String
>
addtlStmtInfList
=
bankToCustomerStatement
.
getAddtlStmtInf
();
StringBuilder
sb
=
new
StringBuilder
();
if
(
addtlStmtInfList
.
size
()>
0
){
int
count
=
0
;
for
(
String
addtlStmtInf
:
addtlStmtInfList
)
{
if
(
count
>=
1
){
sb
.
append
(
Mx2MtConstants
.
NEW_LINE
).
append
(
":86:"
);
}
sb
.
append
(
StringUtil
.
getStringByEnter
(
addtlStmtInf
,
35
,
6
));
count
++;
}
tags
.
add
(
new
Tag
(
name
,
sb
.
toString
()));
}
}
catch
(
Exception
e
){
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
}
swiftCore/src/main/java/com/brilliance/swift/vo/BankToCustomerDebitCreditNotification.java
View file @
91498bcd
...
...
@@ -104,4 +104,5 @@ public class BankToCustomerDebitCreditNotification extends SwiftDto{
public
void
setAddtlTxInf
(
String
addtlTxInf
)
{
this
.
addtlTxInf
=
addtlTxInf
;
}
}
swiftCore/src/main/java/com/brilliance/swift/vo/BankToCustomerStatement.java
View file @
91498bcd
package
com
.
brilliance
.
swift
.
vo
;
import
com.brilliance.swift.vo.common.BalDto
;
import
com.brilliance.swift.vo.common.NtryDto
;
import
com.brilliance.swift.vo.common.PartyAccount
;
import
com.brilliance.swift.vo.common.statementBreakdown
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -12,40 +13,40 @@ import java.util.List;
*/
public
class
BankToCustomerStatement
extends
SwiftDto
{
protected
String
mtType
;
protected
String
cd
;
protected
String
ibanId
;
protected
PartyAccount
account
;
protected
String
pgNb
;
protected
String
elctrncSeqNb
;
protected
BalDto
open
Bal
;
protected
BalDto
open
ingBalance
;
protected
List
<
NtryDto
>
lineNtry
;
protected
List
<
statementBreakdown
>
statementLine
;
protected
BalDto
clos
Bal
;
protected
BalDto
clos
ingBalance
;
protected
BalDto
clos
AvaBal
;
protected
BalDto
clos
ingAvailableBalance
;
protected
List
<
BalDto
>
forw
AvaBal
;
protected
List
<
BalDto
>
forw
ardAvailableBalance
;
protected
List
<
String
>
addtlStmtInf
;
public
String
get
MtType
()
{
return
mtType
;
public
String
get
Cd
()
{
return
cd
;
}
public
void
set
MtType
(
String
mtType
)
{
this
.
mtType
=
mtType
;
public
void
set
Cd
(
String
cd
)
{
this
.
cd
=
cd
;
}
public
String
getIbanId
()
{
return
ibanId
;
public
PartyAccount
getAccount
()
{
return
account
;
}
public
void
set
IbanId
(
String
ibanId
)
{
this
.
ibanId
=
ibanId
;
public
void
set
Account
(
PartyAccount
account
)
{
this
.
account
=
account
;
}
public
String
getPgNb
()
{
...
...
@@ -64,31 +65,31 @@ public class BankToCustomerStatement extends SwiftDto{
this
.
elctrncSeqNb
=
elctrncSeqNb
;
}
public
BalDto
getOpenBal
()
{
return
open
Bal
;
public
BalDto
getOpenBal
ance
()
{
return
open
ingBalance
;
}
public
void
setOpenBal
(
BalDto
openBal
)
{
this
.
open
Bal
=
openBal
;
public
void
setOpenBal
ance
(
BalDto
openBalance
)
{
this
.
open
ingBalance
=
openBalance
;
}
public
BalDto
getClos
AvaBal
()
{
return
clos
AvaBal
;
public
BalDto
getClos
ingAvailableBalance
()
{
return
clos
ingAvailableBalance
;
}
public
void
setClos
AvaBal
(
BalDto
closAvaBal
)
{
this
.
clos
AvaBal
=
closAvaBal
;
public
void
setClos
ingAvailableBalance
(
BalDto
closingAvailableBalance
)
{
this
.
clos
ingAvailableBalance
=
closingAvailableBalance
;
}
public
List
<
BalDto
>
getForw
AvaBal
()
{
if
(
forw
AvaBal
==
null
){
forw
AvaBal
=
new
ArrayList
<>();
public
List
<
BalDto
>
getForw
ardAvailableBalance
()
{
if
(
forw
ardAvailableBalance
==
null
){
forw
ardAvailableBalance
=
new
ArrayList
<>();
}
return
forw
AvaBal
;
return
forw
ardAvailableBalance
;
}
public
BankToCustomerStatement
addBalDtoSixFive
(
BalDto
balDtoSixFive
)
{
getForw
AvaBal
().
add
(
balDtoSixFive
);
getForw
ardAvailableBalance
().
add
(
balDtoSixFive
);
return
this
;
}
...
...
@@ -104,23 +105,23 @@ public class BankToCustomerStatement extends SwiftDto{
return
this
;
}
public
BankToCustomerStatement
addNtryDto
(
NtryDto
ntryDto
){
get
LineNtry
().
add
(
ntryDto
);
public
BankToCustomerStatement
addNtryDto
(
statementBreakdown
statementBreakdown
){
get
StatementLine
().
add
(
statementBreakdown
);
return
this
;
}
public
List
<
NtryDto
>
getLineNtry
()
{
if
(
lineNtry
==
null
){
lineNtry
=
new
ArrayList
<>();
public
List
<
statementBreakdown
>
getStatementLine
()
{
if
(
statementLine
==
null
){
statementLine
=
new
ArrayList
<>();
}
return
lineNtry
;
return
statementLine
;
}
public
BalDto
getClos
Bal
()
{
return
clos
Bal
;
public
BalDto
getClos
ingBalance
()
{
return
clos
ingBalance
;
}
public
void
setClos
Bal
(
BalDto
closBal
)
{
this
.
clos
Bal
=
closBal
;
public
void
setClos
ingBalance
(
BalDto
closingBalance
)
{
this
.
clos
ingBalance
=
closingBalance
;
}
}
swiftCore/src/main/java/com/brilliance/swift/vo/SwiftDtoAdapter.java
View file @
91498bcd
...
...
@@ -24,6 +24,8 @@ public class SwiftDtoAdapter implements JsonSerializer<SwiftDto>, JsonDeserializ
className
=
"com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer"
;
}
else
if
(
"camt.054.001"
.
equals
(
prim
.
getAsString
())){
className
=
"com.brilliance.swift.vo.BankToCustomerDebitCreditNotification"
;
}
else
if
(
"camt.053.001"
.
equals
(
prim
.
getAsString
())){
className
=
"com.brilliance.swift.vo.BankToCustomerStatement"
;
}
klass
=
Class
.
forName
(
className
);
}
catch
(
ClassNotFoundException
e
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/common/BalDto.java
View file @
91498bcd
...
...
@@ -9,7 +9,9 @@ import java.util.Date;
*/
public
class
BalDto
{
private
String
balCdtDbtInd
;
private
String
cd
;
private
String
CdtDbtInd
;
private
Date
date
;
...
...
@@ -17,12 +19,20 @@ public class BalDto {
private
BigDecimal
amt
=
BigDecimal
.
ZERO
;
public
String
getBalCdtDbtInd
()
{
return
balCdtDbtInd
;
public
String
getCd
()
{
return
cd
;
}
public
void
setCd
(
String
cd
)
{
this
.
cd
=
cd
;
}
public
String
getCdtDbtInd
()
{
return
CdtDbtInd
;
}
public
void
set
BalCdtDbtInd
(
String
balC
dtDbtInd
)
{
this
.
balCdtDbtInd
=
balC
dtDbtInd
;
public
void
set
CdtDbtInd
(
String
c
dtDbtInd
)
{
this
.
CdtDbtInd
=
c
dtDbtInd
;
}
public
Date
getDate
()
{
...
...
swiftCore/src/main/java/com/brilliance/swift/vo/common/
NtryDto
.java
→
swiftCore/src/main/java/com/brilliance/swift/vo/common/
statementBreakdown
.java
View file @
91498bcd
package
com
.
brilliance
.
swift
.
vo
.
common
;
import
com.sun.org.apache.bcel.internal.classfile.Code
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -9,14 +7,16 @@ import java.util.Date;
* @author zh
* @create 2022-04-21 14:08
*/
public
class
NtryDto
{
public
class
statementBreakdown
{
private
Date
Val
Date
;
private
Date
value
Date
;
private
Date
BookDate
;
private
String
cdtDbtInd
;
private
String
rvslInd
=
"false"
;
private
String
ccy
;
private
BigDecimal
amt
=
BigDecimal
.
ZERO
;
...
...
@@ -27,16 +27,18 @@ public class NtryDto {
private
String
endToEndId
;
private
String
acctSvcrRef
;
private
String
addtlTxInf
;
private
String
addtlNtryInf
;
public
Date
getValDate
()
{
return
Val
Date
;
public
Date
getVal
ue
Date
()
{
return
value
Date
;
}
public
void
setVal
Date
(
Date
val
Date
)
{
ValDate
=
val
Date
;
public
void
setVal
ueDate
(
Date
value
Date
)
{
this
.
valueDate
=
value
Date
;
}
public
Date
getBookDate
()
{
...
...
@@ -55,6 +57,14 @@ public class NtryDto {
this
.
cdtDbtInd
=
cdtDbtInd
;
}
public
String
getRvslInd
()
{
return
rvslInd
;
}
public
void
setRvslInd
(
String
rvslInd
)
{
this
.
rvslInd
=
rvslInd
;
}
public
String
getCcy
()
{
return
ccy
;
}
...
...
@@ -95,6 +105,14 @@ public class NtryDto {
this
.
endToEndId
=
endToEndId
;
}
public
String
getAcctSvcrRef
()
{
return
acctSvcrRef
;
}
public
void
setAcctSvcrRef
(
String
acctSvcrRef
)
{
this
.
acctSvcrRef
=
acctSvcrRef
;
}
public
String
getAddtlTxInf
()
{
return
addtlTxInf
;
}
...
...
swiftCore/src/main/resources/swiftJson/BankToCustomerCreditNotification.json
View file @
91498bcd
{
"cdtDbtCode"
:
"
910
"
,
"cdtDbtCode"
:
"
CRDT
"
,
"endToEndId"
:
"E2E1201"
,
"account"
:
{
"account"
:
"S15612345678012345"
},
"account"
:
{
"account"
:
"S15612345678012345"
},
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"valueAmount"
:
{
"ccy"
:
"EUR"
,
...
...
@@ -26,15 +28,15 @@
"ADDRESS 3"
],
"partyAcct"
:
{
"
ibanAcct"
:
"F
R7630588000010050000143176"
"
account"
:
"
R7630588000010050000143176"
}
},
"addtlTxInf"
:
"ENRICHED|TRUE SETT_METHOD|SEPA IAT_IND|FALSE DOMESTIC_IND|FALSE PRIORITY_IND|FALSE"
,
"messageType"
:
"camt.054.001"
,
"senderBic"
:
"DEUTDEFF"
,
"receiverBic"
:
"DEUTNL2A"
,
"createDate"
:
"2022-04-2
7 09:14:15,482
"
,
"createDate"
:
"2022-04-2
8 10:10:13,797
"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"FRDA000003421606"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
}
}
\ No newline at end of file
swiftCore/src/main/resources/swiftJson/BankToCustomerDebitNotification.json
View file @
91498bcd
{
"cdtDbtCode"
:
"DBIT"
,
"endToEndId"
:
"E2E1201"
,
"account"
:
{
"account"
:
"S15612345678012345"
},
"account"
:
{
"account"
:
"S15612345678012345"
},
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"valueAmount"
:
{
"ccy"
:
"EUR"
,
"amt"
:
126
},
"debitAgtParty"
:
{
"partyName"
:
"Creditor 1"
,
"addressList"
:
[
"TEST1"
,
"TEST2"
,
"TEST3"
],
"partyAcct"
:
{
"ibanAcct"
:
"FR7630588000010050000143176"
}
},
"addtlTxInf"
:
"ENRICHED|TRUE SETT_METHOD|SEPA IAT_IND|FALSE DOMESTIC_IND|FALSE PRIORITY_IND|FALSEENRICHED|TRUE SETT_METHOD|SEPA IAT_ENRICHED|TRUE SETT_METHOD|SEPA IAT_ENRICHED|TRUE SETT_METHOD|SEPA IAT_ENRICHED|TRUE SETT_METH"
,
"messageType"
:
"camt.054.001"
,
"senderBic"
:
"DEUTDEFF"
,
"receiverBic"
:
"DEUTNL2A"
,
"createDate"
:
"2022-04-2
7 09:37:39,97
8"
,
"createDate"
:
"2022-04-2
8 10:10:09,68
8"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"FRDA000003421606"
,
"uetr"
:
"8a562c67-ca16-48ba-b074-65581be6f001"
}
}
\ No newline at end of file
swiftCore/src/main/resources/swiftJson/BankToCustomerStatement.json
0 → 100644
View file @
91498bcd
{
"cd"
:
"FWAV"
,
"account"
:
{
"account"
:
"S15612345678012345"
},
"pgNb"
:
"178"
,
"elctrncSeqNb"
:
"200"
,
"openingBalance"
:
{
"cd"
:
"ITBD"
,
"CdtDbtInd"
:
"DBIT"
,
"date"
:
"2022-03-30 00:00:00,000"
,
"ccy"
:
"USD"
,
"amt"
:
120274.34
},
"statementLine"
:
[
{
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"BookDate"
:
"2022-03-30 00:00:00,000"
,
"cdtDbtInd"
:
"DBIT"
,
"rvslInd"
:
"false"
,
"ccy"
:
"USD"
,
"amt"
:
393.17
,
"transactionType"
:
"F"
,
"identificationCode"
:
"CHK"
,
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH WUHAN"
,
"addtlNtryInf"
:
"CHINESE BEIJING"
},
{
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"BookDate"
:
"2022-03-30 00:00:00,000"
,
"cdtDbtInd"
:
"DBIT"
,
"rvslInd"
:
"false"
,
"ccy"
:
"USD"
,
"amt"
:
445
,
"transactionType"
:
"F"
,
"identificationCode"
:
"CHK"
,
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH STORITEV"
,
"addtlNtryInf"
:
"HELLO WORLD"
}
],
"closingBalance"
:
{
"cd"
:
"ITBD"
,
"CdtDbtInd"
:
"DBIT"
,
"date"
:
"2022-03-30 00:00:00,000"
,
"ccy"
:
"USD"
,
"amt"
:
123456.29
},
"closingAvailableBalance"
:
{
"cd"
:
"CLAV"
,
"CdtDbtInd"
:
"DBIT"
,
"date"
:
"2022-03-30 00:00:00,000"
,
"ccy"
:
"USD"
,
"amt"
:
119609.29
},
"forwardAvailableBalance"
:
[
{
"cd"
:
"FWAV"
,
"CdtDbtInd"
:
"DBIT"
,
"date"
:
"2022-03-30 00:00:00,000"
,
"ccy"
:
"USD"
,
"amt"
:
120274.34
}
],
"addtlStmtInf"
:
[
"CHINESE BEIJING"
,
"HELLO WORLD"
],
"messageType"
:
"camt.053.001"
,
"senderBic"
:
"SHWHQWER123"
,
"receiverBic"
:
"BJWHS12X"
,
"createDate"
:
"2022-04-28 10:23:46,048"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"00010013800002001234"
}
\ No newline at end of file
swiftCore/src/main/resources/swiftJson/BankToStatement.json
0 → 100644
View file @
91498bcd
{
"cd"
:
""
,
"account"
:
{
"account"
:
"S15612345678012345"
},
"pgNb"
:
"178"
,
"elctrncSeqNb"
:
"200"
,
"openingBalance"
:
{
"cd"
:
"ITBD"
,
"CdtDbtInd"
:
"DBIT"
,
"date"
:
"2022-03-30 00:00:00,000"
,
"ccy"
:
"USD"
,
"amt"
:
120274.34
},
"statementLine"
:
[
{
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"BookDate"
:
"2022-03-30 00:00:00,000"
,
"cdtDbtInd"
:
"DBIT"
,
"rvslInd"
:
"false"
,
"ccy"
:
"USD"
,
"amt"
:
393.17
,
"transactionType"
:
"F"
,
"identificationCode"
:
"CHK"
,
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH WUHAN"
},
{
"valueDate"
:
"2022-03-30 00:00:00,000"
,
"BookDate"
:
"2022-03-30 00:00:00,000"
,
"cdtDbtInd"
:
"DBIT"
,
"rvslInd"
:
"false"
,
"ccy"
:
"USD"
,
"amt"
:
445
,
"transactionType"
:
"F"
,
"identificationCode"
:
"CHK"
,
"endToEndId"
:
"S100000189-735"
,
"acctSvcrRef"
:
"1309170100000390154395"
,
"addtlTxInf"
:
"PLACI LOVECNAMENSKIH STORITEV"
}
],
"closingBalance"
:
{
"cd"
:
"ITBD"
,
"CdtDbtInd"
:
"DBIT"
,
"date"
:
"2022-03-30 00:00:00,000"
,
"ccy"
:
"USD"
,
"amt"
:
123456.29
},
"messageType"
:
"camt.053.001"
,
"senderBic"
:
"SHWHQWER123"
,
"receiverBic"
:
"BJWHS12X"
,
"createDate"
:
"2022-04-28 10:24:00,960"
,
"messagePriority"
:
"NORM"
,
"messageId"
:
"00010013800002001234"
}
\ No newline at end of file
swiftCore/src/main/resources/swiftTxt/MT910.txt
View file @
91498bcd
...
...
@@ -8,8 +8,6 @@ Creditor 1
TEST1
TEST2
TEST3
:52A:/null
QWERASDF
:56D:/FR7630588000010050000143176
81939316
ADDRESS 1
...
...
swiftCore/src/main/resources/swiftXml/MxCamt05300102_940.xml
View file @
91498bcd
...
...
@@ -75,7 +75,7 @@
<Bal>
<Tp>
<CdOrPrtry>
<Cd>
ITBD
</Cd>
<Cd>
FWAV
</Cd>
</CdOrPrtry>
</Tp>
<Amt
Ccy=
"USD"
>
123456.29
</Amt>
...
...
@@ -87,7 +87,7 @@
<Bal>
<Tp>
<CdOrPrtry>
<Cd>
CL
AV
</Cd>
<Cd>
FW
AV
</Cd>
</CdOrPrtry>
</Tp>
<Amt
Ccy=
"USD"
>
119609.29
</Amt>
...
...
swiftCore/src/test/java/com/brilliance/mt2swiftdto/camt053001/Test9
0
0Camt053001.java
→
swiftCore/src/test/java/com/brilliance/mt2swiftdto/camt053001/Test9
4
0Camt053001.java
View file @
91498bcd
package
com
.
brilliance
.
mt2swiftdto
.
camt053001
;
import
com.brilliance.swift.
mt2SwiftDto.Mt2SwiftDtoCreateManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
com.brilliance.swift.vo.SwiftDto
;
import
java.io.File
;
public
class
Test9
0
0Camt053001
{
public
class
Test9
4
0Camt053001
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT900.txt"
);
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT940.txt"
);
SwiftDto
swiftDto
=
new
SwiftTransfer
().
mt2SwiftDto
(
file
,
"D:/test1/BankToCustomerStatement.json"
,
null
);
System
.
out
.
println
(
swiftDto
.
toString
());
}
}
swiftCore/src/test/java/com/brilliance/mt2swiftdto/camt053001/Test950Camt053001.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
mt2swiftdto
.
camt053001
;
import
com.brilliance.swift.SwiftTransfer
;
import
com.brilliance.swift.vo.SwiftDto
;
import
java.io.File
;
public
class
Test950Camt053001
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT950.txt"
);
SwiftDto
swiftDto
=
new
SwiftTransfer
().
mt2SwiftDto
(
file
,
"D:/test1/BankToStatement.json"
,
null
);
System
.
out
.
println
(
swiftDto
.
toString
());
}
}
swiftCore/src/test/java/com/brilliance/mt2swiftdto/camt054001/Test900Camt054001.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
mt2swiftdto
.
camt054001
;
import
com.brilliance.swift.SwiftTransfer
;
import
com.brilliance.swift.vo.SwiftDto
;
import
java.io.File
;
public
class
Test900Camt054001
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT900.txt"
);
SwiftDto
swiftDto
=
new
SwiftTransfer
().
mt2SwiftDto
(
file
,
"D:/test1/BankToCustomerDebitNotification.json"
,
null
);
System
.
out
.
println
(
swiftDto
.
toString
());
}
}
swiftCore/src/test/java/com/brilliance/mt2swiftdto/camt054001/Test910Camt054001.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
mt2swiftdto
.
camt054001
;
import
com.brilliance.swift.SwiftTransfer
;
import
com.brilliance.swift.vo.SwiftDto
;
import
java.io.File
;
public
class
Test910Camt054001
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT910.txt"
);
SwiftDto
swiftDto
=
new
SwiftTransfer
().
mt2SwiftDto
(
file
,
"D:/test1/BankToCustomerCreditNotification.json"
,
null
);
System
.
out
.
println
(
swiftDto
.
toString
());
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt900/Test.java
View file @
91498bcd
...
...
@@ -7,8 +7,8 @@ import java.io.File;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
file
,
null
,
null
);
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\
BankToCustomerDebitNotification.json
"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
file
,
"D:/test2/MT900.txt"
,
null
);
System
.
out
.
println
(
mtStr
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt910/Test.java
View file @
91498bcd
...
...
@@ -7,8 +7,8 @@ import java.io.File;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
file
,
null
,
null
);
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\
BankToCustomerCreditNotification.json
"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
file
,
"D:/test2/MT910.txt"
,
null
);
System
.
out
.
println
(
mtStr
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt940/Test.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swiftdto2mt
.
mt940
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtCreatorManager
;
import
java.io.File
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\BankToCustomerStatement.json"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
file
,
"D:/test2/MT940.txt"
,
null
);
System
.
out
.
println
(
mtStr
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt950/Test.java
0 → 100644
View file @
91498bcd
package
com
.
brilliance
.
swiftdto2mt
.
mt950
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtCreatorManager
;
import
java.io.File
;
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
=
new
SwiftDto2MtCreatorManager
().
swiftDto2Mt
(
file
,
"D:/test2/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