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
8b6ef203
Commit
8b6ef203
authored
Apr 29, 2022
by
chengzhuoshen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.pacs009001 转换成 VoFinancialInstitutionCreditTransfer.json
2.测试MT103和PACS008001之间的相互转换
parent
2aac6a0f
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1254 additions
and
131 deletions
+1254
-131
Mt2SwiftDtoCreateManager.java
...rilliance/swift/mt2SwiftDto/Mt2SwiftDtoCreateManager.java
+0
-26
Pacs009001Parse59Field.java
...2SwiftDto/pacs009001/impl/cov/Pacs009001Parse59Field.java
+1
-0
Mx2SwiftDtoCCTCreator.java
...e/swift/mx2swiftdto/custcdttsf/Mx2SwiftDtoCCTCreator.java
+4
-4
SwiftDto2MtCreatorManager.java
...illiance/swift/swiftdto2mt/SwiftDto2MtCreatorManager.java
+0
-19
SwiftDto2Mt202Creator.java
...liance/swift/swiftdto2mt/mt202/SwiftDto2Mt202Creator.java
+41
-1
Tag13CGenerate.java
...illiance/swift/swiftdto2mt/mt202/impl/Tag13CGenerate.java
+36
-0
Tag20Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag20Generate.java
+27
-0
Tag21Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag21Generate.java
+27
-0
Tag32AGenerate.java
...illiance/swift/swiftdto2mt/mt202/impl/Tag32AGenerate.java
+35
-0
Tag52Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag52Generate.java
+57
-0
Tag53Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag53Generate.java
+67
-0
Tag54Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag54Generate.java
+57
-0
Tag56Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag56Generate.java
+61
-0
Tag57Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag57Generate.java
+61
-0
Tag58Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag58Generate.java
+56
-0
Tag72Generate.java
...rilliance/swift/swiftdto2mt/mt202/impl/Tag72Generate.java
+87
-0
Tag33BGenerate.java
...ance/swift/swiftdto2mt/mt202/impl/cov/Tag33BGenerate.java
+34
-0
Tag50Generate.java
...iance/swift/swiftdto2mt/mt202/impl/cov/Tag50Generate.java
+61
-0
Tag52Generate.java
...iance/swift/swiftdto2mt/mt202/impl/cov/Tag52Generate.java
+60
-0
Tag56Generate.java
...iance/swift/swiftdto2mt/mt202/impl/cov/Tag56Generate.java
+64
-0
Tag57Generate.java
...iance/swift/swiftdto2mt/mt202/impl/cov/Tag57Generate.java
+64
-0
Tag59Generate.java
...iance/swift/swiftdto2mt/mt202/impl/cov/Tag59Generate.java
+59
-0
Tag70Generate.java
...iance/swift/swiftdto2mt/mt202/impl/cov/Tag70Generate.java
+33
-0
Tag72Generate.java
...iance/swift/swiftdto2mt/mt202/impl/cov/Tag72Generate.java
+67
-0
SwiftDto2MxPacs008001Creator.java
...ftdto2mx/pacs008001/v09/SwiftDto2MxPacs008001Creator.java
+14
-14
SwiftDto2MxPacs009001Creator.java
...ftdto2mx/pacs009001/v09/SwiftDto2MxPacs009001Creator.java
+10
-14
FinancialInstitutionCreditTransfer.json
...sources/swiftJson/FinancialInstitutionCreditTransfer.json
+1
-33
FinancialInstitutionCreditTransfer_COV.json
...ces/swiftJson/FinancialInstitutionCreditTransfer_COV.json
+110
-0
MT103.txt
swiftCore/src/main/resources/swiftTxt/MT103.txt
+9
-10
MT202_COV.txt
swiftCore/src/main/resources/swiftTxt/MT202_COV.txt
+2
-1
Test.java
...e/src/test/java/com/brilliance/mt2mx/pacs008001/Test.java
+15
-0
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt103/Test.java
+1
-1
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt202/Test.java
+25
-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
+2
-2
Test.java
.../src/test/java/com/brilliance/swiftdto2mt/mt950/Test.java
+2
-2
No files found.
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/Mt2SwiftDtoCreateManager.java
View file @
8b6ef203
...
...
@@ -23,32 +23,6 @@ public class Mt2SwiftDtoCreateManager {
}
}
/*public String mt2mx(File file, String outPutFilePath, Map<String, Object> extraMap) throws Exception {
SwiftDto swiftDto = mt2SwiftDto(file, outPutFilePath, extraMap);
return new SwiftDto2MxCreatorManager().swiftDto2Mx(swiftDto, outPutFilePath);
}
public String mt2mx(File file, String outPutFilePath) throws Exception {
return mt2mx(file, outPutFilePath, null);
}
public String mt2mx(File file) throws Exception {
return mt2mx(file, null, null);
}
public String mt2mx(String mtStr, String outPutFilePath, Map<String, Object> extraMap) throws Exception {
SwiftDto swiftDto = mt2SwiftDto(mtStr, outPutFilePath, extraMap);
return new SwiftDto2MxCreatorManager().swiftDto2Mx(swiftDto, outPutFilePath);
}
public String mt2mx(String mtStr, String outPutFilePath) throws Exception {
return mt2mx(mtStr, outPutFilePath, null);
}
public String mt2mx(String mtStr) throws Exception {
return mt2mx(mtStr, null, null);
}*/
public
SwiftDto
convert
(
String
mtStr
,
String
outPutFilePath
,
Map
<
String
,
Object
>
extraMap
)
throws
SwiftException
{
init
(
mtStr
);
AbstractMt2SwiftDtoCreator
creator
=
getMt2MxCreator
();
...
...
swiftCore/src/main/java/com/brilliance/swift/mt2SwiftDto/pacs009001/impl/cov/Pacs009001Parse59Field.java
View file @
8b6ef203
...
...
@@ -52,6 +52,7 @@ public class Pacs009001Parse59Field extends AbstractMt2SwiftDtoParseFields {
if
(
customerCreditTransfer
==
null
)
{
customerCreditTransfer
=
new
VoCustomerCreditTransfer
();
}
customerCreditTransfer
.
setCreditParty
(
partyDto
);
financialInstitutionCreditTransfer
.
setUnderCustomerCreditTransfer
(
customerCreditTransfer
);
}
}
catch
(
Exception
e
)
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2swiftdto/custcdttsf/Mx2SwiftDtoCCTCreator.java
View file @
8b6ef203
...
...
@@ -68,10 +68,10 @@ public class Mx2SwiftDtoCCTCreator extends AbstractMx2SwiftDtoCreator {
@Override
public
void
groupHeader
()
throws
SwiftException
{
PartyDto
instgAgtParty
=
agtConvertPartyDto
(
grpHdrParentElementName
,
document
,
"GrpHdr.
sttlmInf.InstgRmbrsmntAgt"
,
"s
ttlmInf.InstgRmbrsmntAgtAcct"
);
PartyDto
instdAgtParty
=
agtConvertPartyDto
(
grpHdrParentElementName
,
document
,
"GrpHdr.
sttlmInf.InstdRmbrsmntAgt"
,
"s
ttlmInf.InstdRmbrsmntAgtAcct"
);
PartyDto
thridAgtParty
=
agtConvertPartyDto
(
grpHdrParentElementName
,
document
,
"GrpHdr.
sttlmInf.ThrdRmbrsmntAgt"
,
"s
ttlmInf.ThrdRmbrsmntAgtAcct"
);
PartyAccount
settleAccount
=
acctConvertPartyAcct
(
grpHdrParentElementName
,
document
,
"GrpHdr.
s
ttlmInf.SttlmAcct"
);
PartyDto
instgAgtParty
=
agtConvertPartyDto
(
grpHdrParentElementName
,
document
,
"GrpHdr.
SttlmInf.InstgRmbrsmntAgt"
,
"GrpHdr.S
ttlmInf.InstgRmbrsmntAgtAcct"
);
PartyDto
instdAgtParty
=
agtConvertPartyDto
(
grpHdrParentElementName
,
document
,
"GrpHdr.
SttlmInf.InstdRmbrsmntAgt"
,
"GrpHdr.S
ttlmInf.InstdRmbrsmntAgtAcct"
);
PartyDto
thridAgtParty
=
agtConvertPartyDto
(
grpHdrParentElementName
,
document
,
"GrpHdr.
SttlmInf.ThrdRmbrsmntAgt"
,
"GrpHdr.S
ttlmInf.ThrdRmbrsmntAgtAcct"
);
PartyAccount
settleAccount
=
acctConvertPartyAcct
(
grpHdrParentElementName
,
document
,
"GrpHdr.
S
ttlmInf.SttlmAcct"
);
customerCreditTransfer
.
setInstgAgtParty
(
instgAgtParty
);
customerCreditTransfer
.
setInstdAgtParty
(
instdAgtParty
);
customerCreditTransfer
.
setThridAgtParty
(
thridAgtParty
);
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/SwiftDto2MtCreatorManager.java
View file @
8b6ef203
...
...
@@ -7,28 +7,9 @@ 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
;
import
java.io.File
;
import
java.io.IOException
;
public
class
SwiftDto2MtCreatorManager
{
public
String
swiftDto2Mt
(
File
file
,
String
fileOutputPath
,
String
mtIoType
)
throws
SwiftException
{
try
{
String
gsonStr
=
FileUtils
.
readFileToString
(
file
);
SwiftDto
swiftDto
=
SwiftDto
.
fromJson
(
gsonStr
);
return
swiftDto2Mt
(
swiftDto
,
fileOutputPath
,
StringUtil
.
isEmpty
(
mtIoType
)?
"O"
:
mtIoType
);
}
catch
(
IOException
e
)
{
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
}
}
public
String
swiftDto2Mt
(
String
gsonStr
,
String
fileOutputPath
,
String
mtIoType
)
throws
SwiftException
{
SwiftDto
swiftDto
=
SwiftDto
.
fromJson
(
gsonStr
);
return
swiftDto2Mt
(
swiftDto
,
fileOutputPath
,
StringUtil
.
isEmpty
(
mtIoType
)?
"O"
:
mtIoType
);
}
public
String
swiftDto2Mt
(
SwiftDto
swiftDto
,
String
fileOutputPath
,
String
mtIoType
)
throws
SwiftException
{
SwiftDto2MtContext
context
=
new
SwiftDto2MtContext
();
context
.
set
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
swiftDto
);
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/SwiftDto2Mt202Creator.java
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
;
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.mt202.impl.*
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
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
SwiftDto2Mt202Creator
extends
AbstractSwiftDto2MtCreator
{
@Override
public
void
withBlock3
()
throws
SwiftException
{
super
.
withBlock3
();
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"
));
}
}
@Override
public
List
<
SwiftDto2MtTagGenerate
>
getGenerateTagList
()
{
return
null
;
List
<
SwiftDto2MtTagGenerate
>
list
=
new
ArrayList
<>();
list
.
add
(
new
Tag20Generate
());
list
.
add
(
new
Tag21Generate
());
list
.
add
(
new
Tag13CGenerate
());
list
.
add
(
new
Tag32AGenerate
());
list
.
add
(
new
Tag52Generate
());
list
.
add
(
new
Tag53Generate
());
list
.
add
(
new
Tag54Generate
());
list
.
add
(
new
Tag56Generate
());
list
.
add
(
new
Tag57Generate
());
list
.
add
(
new
Tag58Generate
());
list
.
add
(
new
Tag72Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag50Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag52Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag56Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag57Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag59Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag70Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag72Generate
());
list
.
add
(
new
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
.
Tag33BGenerate
());
return
list
;
}
@Override
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag13CGenerate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.vo.VoFinancialInstitutionCreditTransfer
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag13CGenerate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"13C"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
financialInstitutionCreditTransfer
.
getDebitDate
()
!=
null
)
{
String
dateStr
=
DateUtil
.
format
(
financialInstitutionCreditTransfer
.
getDebitDate
(),
"HHmm"
);
tags
.
add
(
new
Tag
(
name
,
"/SNDTIME/"
+
dateStr
+
"+0800"
));
}
if
(
financialInstitutionCreditTransfer
.
getCreditDate
()
!=
null
)
{
String
dateStr
=
DateUtil
.
format
(
financialInstitutionCreditTransfer
.
getCreditDate
(),
"HHmm"
);
tags
.
add
(
new
Tag
(
name
,
"/RNCTIME/"
+
dateStr
+
"+0800"
));
}
if
(
financialInstitutionCreditTransfer
.
getClsDate
()
!=
null
)
{
String
dateStr
=
DateUtil
.
format
(
financialInstitutionCreditTransfer
.
getClsDate
(),
"HHmm"
);
tags
.
add
(
new
Tag
(
name
,
"/CLSTIME/"
+
dateStr
+
"+0800"
));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag20Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
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
{
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
()));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag21Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
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
{
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
()));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag32AGenerate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.NumberUtil
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.CcyFormatAmount
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.Date
;
import
java.util.List
;
public
class
Tag32AGenerate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"32A"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
CcyFormatAmount
settledCcyFormatAmount
=
financialInstitutionCreditTransfer
.
getSettledCcyFormatAmount
();
Date
settledDate
=
financialInstitutionCreditTransfer
.
getSettledDate
();
if
(
settledDate
!=
null
&&
settledCcyFormatAmount
!=
null
)
{
String
dateStr
=
DateUtil
.
format
(
settledDate
,
"yyMMdd"
);
String
ccy
=
settledCcyFormatAmount
.
getCcy
();
String
amt
=
NumberUtil
.
formatAmt
(
settledCcyFormatAmount
.
getAmt
(),
ccy
);
tags
.
add
(
new
Tag
(
name
,
dateStr
+
ccy
+
amt
));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag52Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag52Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"52A"
;
private
String
name_D
=
"52D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
debitAgtParty
=
financialInstitutionCreditTransfer
.
getDebitParty
();
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
));
}
}
}
}
\ No newline at end of file
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag53Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyAccount
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag53Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"53A"
;
private
String
name_B
=
"53B"
;
private
String
name_D
=
"53D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
instgAgtParty
=
financialInstitutionCreditTransfer
.
getInstgAgtParty
();
if
(
instgAgtParty
!=
null
)
{
String
account
=
getAccount
(
instgAgtParty
);
String
bicCode
=
instgAgtParty
.
getPartyBic
();
String
name
=
instgAgtParty
.
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
=
instgAgtParty
.
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
{
PartyAccount
settleAccount
=
financialInstitutionCreditTransfer
.
getSettleAccount
();
if
(
settleAccount
!=
null
)
{
PartyDto
partyDto
=
new
PartyDto
();
partyDto
.
setPartyAcct
(
settleAccount
);
String
value
=
getAccount
(
partyDto
);
tags
.
add
(
new
Tag
(
name_B
,
value
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag54Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag54Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"54A"
;
private
String
name_D
=
"54D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
instdAgtParty
=
financialInstitutionCreditTransfer
.
getInstdAgtParty
();
if
(
instdAgtParty
!=
null
)
{
String
account
=
getAccount
(
instdAgtParty
);
String
bicCode
=
instdAgtParty
.
getPartyBic
();
String
name
=
instdAgtParty
.
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
=
instdAgtParty
.
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
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag56Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag56Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"56A"
;
private
String
name_C
=
"56C"
;
private
String
name_D
=
"56D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
intrymyAgtParty
=
financialInstitutionCreditTransfer
.
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
{
tags
.
add
(
new
Tag
(
name_C
,
account
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag57Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag57Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"57A"
;
private
String
name_C
=
"57C"
;
private
String
name_D
=
"57D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
creditAgtParty
=
financialInstitutionCreditTransfer
.
getCreditAgtParty
();
if
(
creditAgtParty
!=
null
)
{
String
account
=
getAccount
(
creditAgtParty
);
String
bicCode
=
creditAgtParty
.
getPartyBic
();
String
name
=
creditAgtParty
.
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
=
creditAgtParty
.
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
{
tags
.
add
(
new
Tag
(
name_C
,
account
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag58Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag58Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"58A"
;
private
String
name_D
=
"58D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
creditParty
=
financialInstitutionCreditTransfer
.
getCreditParty
();
if
(
creditParty
!=
null
)
{
String
account
=
getAccount
(
creditParty
);
String
bicCode
=
creditParty
.
getPartyBic
();
String
name
=
creditParty
.
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
=
creditParty
.
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
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/Tag72Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
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.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.ExternalCreditorAgentInstructionCode
;
import
com.brilliance.swift.vo.common.InstructionForCreditAgent
;
import
com.brilliance.swift.vo.common.InstructionForNextAgent
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
com.prowidesoftware.swift.model.mx.dic.Instruction4Code
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Tag72Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"72"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
String
>
list
=
new
ArrayList
<>();
PartyDto
preInstgAgtParty
=
financialInstitutionCreditTransfer
.
getPreInstgAgtParty
();
if
(
preInstgAgtParty
!=
null
)
{
String
bicCode
=
preInstgAgtParty
.
getPartyBic
();
String
name
=
preInstgAgtParty
.
getPartyName
();
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
bicCode
=
Mx2MtConstants
.
INS
+
bicCode
;
list
.
addAll
(
StringUtil
.
outStringList
(
bicCode
,
35
,
"//"
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
name
=
Mx2MtConstants
.
INS
+
name
;
list
.
addAll
(
StringUtil
.
outStringList
(
name
,
35
,
"//"
));
}
}
InstructionForCreditAgent
instForCrdAgt
=
financialInstitutionCreditTransfer
.
getInstForCrdAgt
();
if
(
instForCrdAgt
!=
null
)
{
ExternalCreditorAgentInstructionCode
code
=
instForCrdAgt
.
getCode
();
if
(
code
==
null
)
{
String
instrInfo
=
Mx2MtConstants
.
ACC
+
instForCrdAgt
.
getInstrInf
();
list
.
addAll
(
StringUtil
.
outStringList
(
instrInfo
,
35
,
"//"
));
}
else
if
(
ExternalCreditorAgentInstructionCode
.
PHOB
.
equals
(
code
)
||
ExternalCreditorAgentInstructionCode
.
TELB
.
equals
(
code
))
{
String
instrInfo
=
Mx2MtConstants
.
PHONBEN
+
instForCrdAgt
.
getInstrInf
();
list
.
addAll
(
StringUtil
.
outStringList
(
instrInfo
,
35
,
"//"
));
}
}
InstructionForNextAgent
instForNxtAgt
=
financialInstitutionCreditTransfer
.
getInstForNxtAgt
();
if
(
instForNxtAgt
!=
null
)
{
Instruction4Code
code
=
instForNxtAgt
.
getCode
();
if
(
code
==
null
)
{
String
instrInfo
=
Mx2MtConstants
.
REC
+
instForNxtAgt
.
getInstrInf
();
list
.
addAll
(
StringUtil
.
outStringList
(
instrInfo
,
35
,
"//"
));
}
else
if
(
Instruction4Code
.
TELA
.
equals
(
code
))
{
String
instrInfo
=
Mx2MtConstants
.
TELE
+
instForNxtAgt
.
getInstrInf
();
list
.
addAll
(
StringUtil
.
outStringList
(
instrInfo
,
35
,
"//"
));
}
else
if
(
Instruction4Code
.
PHOA
.
equals
(
code
))
{
String
instrInfo
=
""
;
if
(
financialInstitutionCreditTransfer
.
getIntrmyAgtParty
()
!=
null
)
{
instrInfo
=
Mx2MtConstants
.
PHONIBK
+
instForNxtAgt
.
getInstrInf
();
}
else
{
instrInfo
=
Mx2MtConstants
.
PHON
+
instForNxtAgt
.
getInstrInf
();
}
list
.
addAll
(
StringUtil
.
outStringList
(
instrInfo
,
35
,
"//"
));
}
}
String
value
=
""
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
i
==
6
)
break
;
if
(
i
==
0
)
{
value
+=
list
.
get
(
i
);
}
else
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
list
.
get
(
i
);
}
}
if
(
StringUtil
.
isNotEmpty
(
value
))
{
tags
.
add
(
new
Tag
(
name
,
value
));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag33BGenerate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
import
com.brilliance.swift.exception.SwiftException
;
import
com.brilliance.swift.swiftdto2mt.AbstractSwiftDto2MtTagGenerate
;
import
com.brilliance.swift.swiftdto2mt.SwiftDto2MtContextIdentifier
;
import
com.brilliance.swift.util.NumberUtil
;
import
com.brilliance.swift.vo.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.CcyFormatAmount
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag33BGenerate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"33B"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
if
(
customerCreditTransfer
.
getInstructedCcyFormatAmount
()
!=
null
)
{
CcyFormatAmount
instructedCcyFormatAmount
=
customerCreditTransfer
.
getInstructedCcyFormatAmount
();
String
ccy
=
instructedCcyFormatAmount
.
getCcy
();
String
amt
=
NumberUtil
.
formatAmt
(
instructedCcyFormatAmount
.
getAmt
(),
ccy
);
tags
.
add
(
new
Tag
(
name
,
ccy
+
amt
));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag50Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
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.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag50Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"50A"
;
private
String
name_F
=
"50F"
;
private
String
name_K
=
"50K"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
debitParty
=
customerCreditTransfer
.
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
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag52Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
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.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag52Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"52A"
;
private
String
name_D
=
"52D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
debitAgtParty
=
customerCreditTransfer
.
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
));
}
}
}
}
\ No newline at end of file
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag56Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
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.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag56Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"56A"
;
private
String
name_C
=
"56C"
;
private
String
name_D
=
"56D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
intrymyAgtParty
=
customerCreditTransfer
.
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
{
tags
.
add
(
new
Tag
(
name_C
,
account
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag57Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
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.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag57Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"57A"
;
private
String
name_C
=
"57C"
;
private
String
name_D
=
"57D"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
creditAgtParty
=
customerCreditTransfer
.
getCreditAgtParty
();
if
(
creditAgtParty
!=
null
)
{
String
account
=
getAccount
(
creditAgtParty
);
String
bicCode
=
creditAgtParty
.
getPartyBic
();
String
name
=
creditAgtParty
.
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
=
creditAgtParty
.
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
{
tags
.
add
(
new
Tag
(
name_C
,
account
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag59Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
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.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag59Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name_A
=
"59A"
;
private
String
name_none
=
"59"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
PartyDto
creditParty
=
customerCreditTransfer
.
getCreditParty
();
if
(
creditParty
!=
null
)
{
String
account
=
getAccount
(
creditParty
);
String
bicCode
=
creditParty
.
getPartyBic
();
String
name
=
creditParty
.
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
=
creditParty
.
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_none
,
value
));
}
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag70Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
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.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.RemittanceInformation
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.List
;
public
class
Tag70Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"70"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
RemittanceInformation
remittanceInfo
=
customerCreditTransfer
.
getRemittanceInfo
();
if
(
remittanceInfo
!=
null
&&
remittanceInfo
.
getUnstructured
().
size
()
>
0
)
{
String
value
=
StringUtil
.
getStringByEnter
(
remittanceInfo
.
getUnstructured
().
get
(
0
),
35
,
4
);
tags
.
add
(
new
Tag
(
name
,
value
));
}
}
}
\ No newline at end of file
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mt/mt202/impl/cov/Tag72Generate.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swift
.
swiftdto2mt
.
mt202
.
impl
.
cov
;
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.VoCustomerCreditTransfer
;
import
com.brilliance.swift.vo.VoFinancialInstitutionCreditTransfer
;
import
com.brilliance.swift.vo.common.InstructionForCreditAgent
;
import
com.brilliance.swift.vo.common.InstructionForNextAgent
;
import
com.brilliance.swift.vo.common.PartyDto
;
import
com.prowidesoftware.swift.model.SwiftMessage
;
import
com.prowidesoftware.swift.model.Tag
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Tag72Generate
extends
AbstractSwiftDto2MtTagGenerate
{
private
String
name
=
"72"
;
@Override
public
void
tagGenerate
()
throws
SwiftException
{
VoFinancialInstitutionCreditTransfer
financialInstitutionCreditTransfer
=
(
VoFinancialInstitutionCreditTransfer
)
context
.
get
(
SwiftDto2MtContextIdentifier
.
SWIFT_DTO_OBJ
,
true
);
VoCustomerCreditTransfer
customerCreditTransfer
=
financialInstitutionCreditTransfer
.
getUnderCustomerCreditTransfer
();
if
(
customerCreditTransfer
==
null
)
return
;
SwiftMessage
swiftMessage
=
context
.
get
(
SwiftMessage
.
class
);
List
<
Tag
>
tags
=
swiftMessage
.
getBlock4
().
getTags
();
List
<
String
>
list
=
new
ArrayList
<>();
PartyDto
preInstgAgtParty
=
customerCreditTransfer
.
getPreInstgAgtParty
();
if
(
preInstgAgtParty
!=
null
)
{
String
bicCode
=
preInstgAgtParty
.
getPartyBic
();
String
name
=
preInstgAgtParty
.
getPartyName
();
if
(
StringUtil
.
isNotEmpty
(
bicCode
))
{
bicCode
=
Mx2MtConstants
.
INS
+
bicCode
;
list
.
addAll
(
StringUtil
.
outStringList
(
bicCode
,
35
,
"//"
));
}
else
if
(
StringUtil
.
isNotEmpty
(
name
))
{
name
=
Mx2MtConstants
.
INS
+
name
;
list
.
addAll
(
StringUtil
.
outStringList
(
name
,
35
,
"//"
));
}
}
InstructionForCreditAgent
instForCrdAgt
=
customerCreditTransfer
.
getInstForCrdAgt
();
if
(
instForCrdAgt
!=
null
&&
StringUtil
.
isNotEmpty
(
instForCrdAgt
.
getInstrInf
()))
{
String
instrInfo
=
Mx2MtConstants
.
ACC
+
instForCrdAgt
.
getInstrInf
();
list
.
addAll
(
StringUtil
.
outStringList
(
instrInfo
,
35
,
"//"
));
}
InstructionForNextAgent
instForNxtAgt
=
customerCreditTransfer
.
getInstForNxtAgt
();
if
(
instForNxtAgt
!=
null
&&
StringUtil
.
isNotEmpty
(
instForNxtAgt
.
getInstrInf
()))
{
String
instrInfo
=
Mx2MtConstants
.
REC
+
instForNxtAgt
.
getInstrInf
();
list
.
addAll
(
StringUtil
.
outStringList
(
instrInfo
,
35
,
"//"
));
}
String
value
=
""
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
i
==
6
)
break
;
if
(
i
==
0
)
{
value
+=
list
.
get
(
i
);
}
else
{
value
+=
Mx2MtConstants
.
NEW_LINE
+
list
.
get
(
i
);
}
}
if
(
StringUtil
.
isNotEmpty
(
value
))
{
tags
.
add
(
new
Tag
(
name
,
value
));
}
}
}
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mx/pacs008001/v09/SwiftDto2MxPacs008001Creator.java
View file @
8b6ef203
...
...
@@ -40,23 +40,19 @@ public class SwiftDto2MxPacs008001Creator extends AbstractSwiftDto2MxCreator {
//set AppHdr
BusinessAppHdrV02
businessAppHdrV02
=
new
BusinessAppHdrV02
();
Party44Choice
fr
=
new
Party44Choice
();
PartyIdentification135
frOrgId
=
new
PartyIdentification135
();
Party38Choice
frId
=
new
Party38Choice
();
OrganisationIdentification29
frIdOrgId
=
new
OrganisationIdentification29
();
frIdOrgId
.
setAnyBIC
(
customerCreditTransfer
.
getSenderBic
());
frId
.
setOrgId
(
frIdOrgId
);
frOrgId
.
setId
(
frId
);
fr
.
setOrgId
(
frOrgId
);
BranchAndFinancialInstitutionIdentification6
frFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
frFinInstnId
=
new
FinancialInstitutionIdentification18
();
frFinInstnId
.
setBICFI
(
customerCreditTransfer
.
getSenderBic
());
frFiId
.
setFinInstnId
(
frFinInstnId
);
fr
.
setFIId
(
frFiId
);
businessAppHdrV02
.
setFr
(
fr
);
Party44Choice
to
=
new
Party44Choice
();
PartyIdentification135
toOrgId
=
new
PartyIdentification135
();
Party38Choice
toId
=
new
Party38Choice
();
OrganisationIdentification29
toIdOrgId
=
new
OrganisationIdentification29
();
toIdOrgId
.
setAnyBIC
(
customerCreditTransfer
.
getReceiverBic
());
toId
.
setOrgId
(
toIdOrgId
);
toOrgId
.
setId
(
toId
);
to
.
setOrgId
(
toOrgId
);
BranchAndFinancialInstitutionIdentification6
toFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
toFinInstnId
=
new
FinancialInstitutionIdentification18
();
toFinInstnId
.
setBICFI
(
customerCreditTransfer
.
getSenderBic
());
toFiId
.
setFinInstnId
(
toFinInstnId
);
to
.
setFIId
(
toFiId
);
businessAppHdrV02
.
setTo
(
to
);
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
customerCreditTransfer
.
getCreateDate
());
...
...
@@ -253,10 +249,14 @@ public class SwiftDto2MxPacs008001Creator extends AbstractSwiftDto2MxCreator {
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
));
}
}
cdtTrfTxInf
.
addChrgsInf
(
chrgsInf
);
}
}
...
...
swiftCore/src/main/java/com/brilliance/swift/swiftdto2mx/pacs009001/v09/SwiftDto2MxPacs009001Creator.java
View file @
8b6ef203
...
...
@@ -36,23 +36,19 @@ public class SwiftDto2MxPacs009001Creator extends AbstractSwiftDto2MxCreator {
//set AppHdr
BusinessAppHdrV02
businessAppHdrV02
=
new
BusinessAppHdrV02
();
Party44Choice
fr
=
new
Party44Choice
();
PartyIdentification135
frOrgId
=
new
PartyIdentification135
();
Party38Choice
frId
=
new
Party38Choice
();
OrganisationIdentification29
frIdOrgId
=
new
OrganisationIdentification29
();
frIdOrgId
.
setAnyBIC
(
financialInstitutionCreditTransfer
.
getSenderBic
());
frId
.
setOrgId
(
frIdOrgId
);
frOrgId
.
setId
(
frId
);
fr
.
setOrgId
(
frOrgId
);
BranchAndFinancialInstitutionIdentification6
frFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
frFinInstnId
=
new
FinancialInstitutionIdentification18
();
frFinInstnId
.
setBICFI
(
financialInstitutionCreditTransfer
.
getSenderBic
());
frFiId
.
setFinInstnId
(
frFinInstnId
);
fr
.
setFIId
(
frFiId
);
businessAppHdrV02
.
setFr
(
fr
);
Party44Choice
to
=
new
Party44Choice
();
PartyIdentification135
toOrgId
=
new
PartyIdentification135
();
Party38Choice
toId
=
new
Party38Choice
();
OrganisationIdentification29
toIdOrgId
=
new
OrganisationIdentification29
();
toIdOrgId
.
setAnyBIC
(
financialInstitutionCreditTransfer
.
getReceiverBic
());
toId
.
setOrgId
(
toIdOrgId
);
toOrgId
.
setId
(
toId
);
to
.
setOrgId
(
toOrgId
);
BranchAndFinancialInstitutionIdentification6
toFiId
=
new
BranchAndFinancialInstitutionIdentification6
();
FinancialInstitutionIdentification18
toFinInstnId
=
new
FinancialInstitutionIdentification18
();
toFinInstnId
.
setBICFI
(
financialInstitutionCreditTransfer
.
getSenderBic
());
toFiId
.
setFinInstnId
(
toFinInstnId
);
to
.
setFIId
(
toFiId
);
businessAppHdrV02
.
setTo
(
to
);
XMLGregorianCalendar
creDt
=
DateUtil
.
parseXMLGregorianCalendar
(
financialInstitutionCreditTransfer
.
getCreateDate
());
...
...
swiftCore/src/main/resources/swiftJson/FinancialInstitutionCreditTransfer.json
View file @
8b6ef203
{
"endToEndId"
:
"
end456
"
,
"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"
,
...
...
@@ -51,38 +51,6 @@
"code"
:
"TELA"
,
"info"
:
"ins123"
},
"underCustomerCreditTransfer"
:
{
"InstructedCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
393.17
},
"debitParty"
:
{
"partyBic"
:
"ANYBIC01"
,
"partyAcct"
:
{
"ibanAcct"
:
"S15612345678012345"
}
},
"debitAgtParty"
:
{
"partyBic"
:
"QWERTYUI"
,
"partyAcct"
:
{
"ibanAcct"
:
"S123"
}
},
"intrmyAgtParty"
:
{
"partyAcct"
:
{
"account"
:
"789465123132165"
}
},
"creditAgtParty"
:
{
"partyBic"
:
"ASDFRTEW"
,
"partyAcct"
:
{
"ibanAcct"
:
"S15612345678012345"
}
},
"remittanceInfos"
:
[
"1111"
]
},
"messageType"
:
"pacs.009.001"
,
"senderBic"
:
"DEUTDEFF"
,
"receiverBic"
:
"DEUTNL2A"
,
...
...
swiftCore/src/main/resources/swiftJson/FinancialInstitutionCreditTransfer_COV.json
0 → 100644
View file @
8b6ef203
{
"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"
,
"settledDate"
:
"2022-04-02 00:00:00,000"
,
"settledCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
120274.34
},
"debitParty"
:
{
"partyName"
:
"QWER"
,
"addressList"
:
[
"12"
,
"234"
,
"123"
],
"partyAcct"
:
{
"account"
:
"S15612345678012345"
}
},
"instgAgtParty"
:
{
"partyBic"
:
"DEUTNL2A"
},
"instdAgtParty"
:
{
"partyBic"
:
"DEUTDEFF"
,
"partyAcct"
:
{
"account"
:
"S15612345678012345"
}
},
"intrmyAgtParty"
:
{
"partyBic"
:
"AQWSFRED"
,
"partyAcct"
:
{
"account"
:
"S15612345678012345"
}
},
"creditAgtParty"
:
{
"partyBic"
:
"AQWSDERF"
},
"creditParty"
:
{
"partyBic"
:
"ZXCDQWER"
},
"preInstgAgtParty"
:
{
"partyName"
:
"5555555"
},
"instForCrdAgt"
:
{
"code"
:
"TELB"
,
"instrInf"
:
"456"
},
"instForNxtAgt"
:
{
"code"
:
"TELA"
,
"instrInf"
:
"ins123"
},
"underCustomerCreditTransfer"
:
{
"InstructedCcyFormatAmount"
:
{
"ccy"
:
"USD"
,
"amt"
:
120274.34
},
"debitParty"
:
{
"partyBic"
:
"ANYBIC01"
,
"partyAcct"
:
{
"account"
:
"S15612345678012345"
}
},
"debitAgtParty"
:
{
"partyBic"
:
"QWERTYUI"
,
"partyAcct"
:
{
"account"
:
"S123"
}
},
"intrmyAgtParty"
:
{
"partyAcct"
:
{
"account"
:
"789465123132165"
,
"acctSehemeType"
:
{
"code"
:
"CUID"
}
}
},
"creditAgtParty"
:
{
"partyBic"
:
"ASDFRTEW"
,
"partyAcct"
:
{
"account"
:
"S15612345678012345"
}
},
"creditParty"
:
{
"partyName"
:
"33333333"
,
"addressList"
:
[
"11"
,
"22"
,
"33"
],
"partyAcct"
:
{
"account"
:
"S15612345678012345"
}
},
"remittanceInfo"
:
{
"unstructured"
:
[
"1111"
]
}
},
"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"
}
\ No newline at end of file
swiftCore/src/main/resources/swiftTxt/MT103.txt
View file @
8b6ef203
{1:F01FOOBARC0AXXX
0146815888}{2:O1031010200908BANKANC0AXXX12032828262204210951N}{3:
{121:8a562c67-ca16-48ba-b074-65581be6f001}}{4:
{1:F01FOOBARC0AXXX
4402221388}{2:O1031010200908BANKANC0AXXX50363658012204281624U}{3:{108:2204281624270851}
{121:8a562c67-ca16-48ba-b074-65581be6f001}}{4:
:20:TBEXO12345
:13C:/SNDTIME/2124+0
7
00
:13C:/RNCTIME/2330+0
7
00
:13C:/CLSTIME/2221+0
7
00
:13C:/SNDTIME/2124+0
8
00
:13C:/RNCTIME/2330+0
8
00
:13C:/CLSTIME/2221+0
8
00
:23B:CRED
:23E:SDVA
:23E:
BNKK
:23E:
GHJK
/789556
:23E:
CASH
:23E:
TELB
/789556
:26T:GCY
:32A:220313USD23453,13
:33B:EUR1345,12
:36:17,4357135422
:50A:/
123456
:50A:/
01111001759234567890
GCYXXXXXX12
:52A:FOOBARC0
:53A:FOOBARC1
:54A:FOOBARC3
:55A:FOOBARC4
:56A:FOOBARC6
:57A://AT8193234
BANKANC7
:57A:BANKANC7
:59:/00013500510020179998
TEST CORP
Nellis ABC, NV
...
...
@@ -32,4 +31,3 @@ Nellis ABC, NV
//JIANGXIAQU
//WENHUADADAO
-}
\ No newline at end of file
swiftCore/src/main/resources/swiftTxt/MT202_COV.txt
View file @
8b6ef203
...
...
@@ -33,5 +33,5 @@ ASDFRTEW
22
33
:70:1111
:33B:USD
393,17
:33B:USD
120274,34
-}
\ No newline at end of file
swiftCore/src/test/java/com/brilliance/mt2mx/pacs008001/Test.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
mt2mx
.
pacs008001
;
import
com.brilliance.swift.SwiftTransfer
;
import
java.io.File
;
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
mt103
=
SwiftTransfer
.
mt2Mx
(
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftTxt\\Mt103.txt"
),
"d:/test/pacs00800109.xml"
,
null
);
System
.
out
.
println
(
mt103
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt103/Test.java
View file @
8b6ef203
...
...
@@ -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\\CustomerCreditTransfer.json"
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
null
,
null
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
null
,
"I"
);
System
.
out
.
println
(
mtStr
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt202/Test.java
0 → 100644
View file @
8b6ef203
package
com
.
brilliance
.
swiftdto2mt
.
mt202
;
import
com.brilliance.swift.SwiftTransfer
;
import
java.io.File
;
public
class
Test
{
public
static
void
test202
()
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\FinancialInstitutionCreditTransfer.json"
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
null
,
"O"
);
System
.
out
.
println
(
mtStr
);
}
public
static
void
test202Cov
()
{
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
)+
"\\swiftCore\\src\\main\\resources\\swiftJson\\FinancialInstitutionCreditTransfer_COV.json"
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
null
,
"O"
);
System
.
out
.
println
(
mtStr
);
}
public
static
void
main
(
String
[]
args
)
{
//test202();
test202Cov
();
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt900/Test.java
View file @
8b6ef203
package
com
.
brilliance
.
swiftdto2mt
.
mt900
;
import
com.brilliance.swift.
swiftdto2mt.SwiftDto2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
java.io.File
;
...
...
@@ -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\\BankToCustomerDebitNotification.json"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
()
.
swiftDto2Mt
(
file
,
"D:/test2/MT900.txt"
,
null
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
"D:/test2/MT900.txt"
,
null
);
System
.
out
.
println
(
mtStr
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt910/Test.java
View file @
8b6ef203
package
com
.
brilliance
.
swiftdto2mt
.
mt910
;
import
com.brilliance.swift.
swiftdto2mt.SwiftDto2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
java.io.File
;
...
...
@@ -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\\BankToCustomerCreditNotification.json"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
()
.
swiftDto2Mt
(
file
,
"D:/test2/MT910.txt"
,
null
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
"D:/test2/MT910.txt"
,
null
);
System
.
out
.
println
(
mtStr
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt940/Test.java
View file @
8b6ef203
package
com
.
brilliance
.
swiftdto2mt
.
mt940
;
import
com.brilliance.swift.
swiftdto2mt.SwiftDto2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
java.io.File
;
...
...
@@ -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\\BankToCustomerStatement.json"
);
String
mtStr
=
new
SwiftDto2MtCreatorManager
()
.
swiftDto2Mt
(
file
,
"D:/test2/MT940.txt"
,
null
);
String
mtStr
=
SwiftTransfer
.
swiftDto2Mt
(
file
,
"D:/test2/MT940.txt"
,
null
);
System
.
out
.
println
(
mtStr
);
}
}
swiftCore/src/test/java/com/brilliance/swiftdto2mt/mt950/Test.java
View file @
8b6ef203
package
com
.
brilliance
.
swiftdto2mt
.
mt950
;
import
com.brilliance.swift.
swiftdto2mt.SwiftDto2MtCreatorManag
er
;
import
com.brilliance.swift.
SwiftTransf
er
;
import
java.io.File
;
...
...
@@ -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
=
new
SwiftDto2MtCreatorManager
()
.
swiftDto2Mt
(
file
,
"D:/test2/MT950.txt"
,
null
);
String
mtStr
=
SwiftTransfer
.
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