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
59f3e49a
Commit
59f3e49a
authored
Apr 19, 2022
by
zhanghou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了枚举和字符串的比较,和修改了940和950报文的部分代码
parent
c66ce0aa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
43 deletions
+43
-43
Field71AGenerate.java
...m/brilliance/swift/mx2mt/mt103/impl/Field71AGenerate.java
+3
-3
Field72Generate.java
...lliance/swift/mx2mt/mt202cov202/impl/Field72Generate.java
+4
-4
Field60Generate.java
...brilliance/swift/mx2mt/mt940950/impl/Field60Generate.java
+32
-28
Field62Generate.java
...brilliance/swift/mx2mt/mt940950/impl/Field62Generate.java
+3
-3
Field64Generate.java
...brilliance/swift/mx2mt/mt940950/impl/Field64Generate.java
+0
-2
Field65Generate.java
...brilliance/swift/mx2mt/mt940950/impl/Field65Generate.java
+1
-3
No files found.
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt103/impl/Field71AGenerate.java
View file @
59f3e49a
...
...
@@ -32,11 +32,11 @@ public class Field71AGenerate extends AbstractMx2MtFieldsGenerate {
Document
document
=
(
Document
)
map
.
get
(
Mx2MtConstants
.
MX_XML_DOCUMENT
);
String
chrgBr
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"CdtTrfTxInf.ChrgBr"
);
if
(
StringUtil
.
isNotEmpty
(
chrgBr
))
{
if
(
ChargeBearerType1Code
.
valueOf
(
chrgBr
).
equals
(
ChargeBearerType1Code
.
CRED
))
{
if
(
ChargeBearerType1Code
.
CRED
.
value
().
equals
(
chrgBr
))
{
field71Option
=
"BEN"
;
}
else
if
(
ChargeBearerType1Code
.
valueOf
(
chrgBr
).
equals
(
ChargeBearerType1Code
.
DEBT
))
{
}
else
if
(
ChargeBearerType1Code
.
DEBT
.
value
().
equals
(
chrgBr
))
{
field71Option
=
"OUR"
;
}
else
if
(
ChargeBearerType1Code
.
valueOf
(
chrgBr
).
equals
(
ChargeBearerType1Code
.
SHAR
))
{
}
else
if
(
ChargeBearerType1Code
.
SHAR
.
value
().
equals
(
chrgBr
))
{
field71Option
=
"SHA"
;
}
String
amt
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"CdtTrfTxInf.ChrgsInf"
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt202cov202/impl/Field72Generate.java
View file @
59f3e49a
...
...
@@ -61,10 +61,10 @@ public class Field72Generate extends AbstractMx2MtFieldsGenerate {
if
(
instrForCdtrAgtCard
==
null
&&
StringUtil
.
isNotEmpty
(
instrForCdtrAgtInstrInf
))
{
String
cdtrAgtCode
=
Mx2MtConstants
.
ACC
+
instrForCdtrAgtInstrInf
;
field72TmpList
.
addAll
(
StringUtil
.
outStringList
(
cdtrAgtCode
,
35
,
"//"
));
}
else
if
(
Instruction5Code
.
PHOB
.
equals
(
Instruction5Code
.
valueOf
(
instrForCdtrAgtCard
)
)
&&
StringUtil
.
isNotEmpty
(
instrForCdtrAgtInstrInf
))
{
}
else
if
(
Instruction5Code
.
PHOB
.
value
().
equals
(
instrForCdtrAgtCard
)
&&
StringUtil
.
isNotEmpty
(
instrForCdtrAgtInstrInf
))
{
String
cdtrAgtCode
=
Mx2MtConstants
.
PHONBEN
+
instrForCdtrAgtInstrInf
;
field72TmpList
.
addAll
(
StringUtil
.
outStringList
(
cdtrAgtCode
,
35
,
"//"
));
}
else
if
(
Instruction5Code
.
TELB
.
equals
(
Instruction5Code
.
valueOf
(
instrForCdtrAgtCard
)
)
&&
StringUtil
.
isNotEmpty
(
instrForCdtrAgtInstrInf
))
{
}
else
if
(
Instruction5Code
.
TELB
.
value
().
equals
(
instrForCdtrAgtCard
)
&&
StringUtil
.
isNotEmpty
(
instrForCdtrAgtInstrInf
))
{
String
cdtrAgtCode
=
Mx2MtConstants
.
PHONBEN
+
instrForCdtrAgtInstrInf
;
field72TmpList
.
addAll
(
StringUtil
.
outStringList
(
cdtrAgtCode
,
35
,
"//"
));
}
...
...
@@ -73,10 +73,10 @@ public class Field72Generate extends AbstractMx2MtFieldsGenerate {
if
(
StringUtil
.
isEmpty
(
instrForNxtAgtCard
)
&&
StringUtil
.
isNotEmpty
(
instrForNxtAgtInstrInf
))
{
String
nextAgentCode
=
Mx2MtConstants
.
REC
+
instrForNxtAgtInstrInf
;
field72TmpList
.
addAll
(
StringUtil
.
outStringList
(
nextAgentCode
,
35
,
"//"
));
}
else
if
(
Instruction4Code
.
TELA
.
equals
(
Instruction4Code
.
valueOf
(
instrForNxtAgtCard
)
)
&&
StringUtil
.
isNotEmpty
(
instrForNxtAgtInstrInf
))
{
}
else
if
(
Instruction4Code
.
TELA
.
value
().
equals
(
instrForNxtAgtCard
)
&&
StringUtil
.
isNotEmpty
(
instrForNxtAgtInstrInf
))
{
String
nextAgentCode
=
Mx2MtConstants
.
TELE
+
instrForNxtAgtInstrInf
;
field72TmpList
.
addAll
(
StringUtil
.
outStringList
(
nextAgentCode
,
35
,
"//"
));
}
else
if
(
Instruction4Code
.
PHOA
.
equals
(
Instruction4Code
.
valueOf
(
instrForNxtAgtCard
)
)
&&
StringUtil
.
isNotEmpty
(
instrForNxtAgtInstrInf
))
{
}
else
if
(
Instruction4Code
.
PHOA
.
value
().
equals
(
instrForNxtAgtCard
)
&&
StringUtil
.
isNotEmpty
(
instrForNxtAgtInstrInf
))
{
String
field56Option
=
(
String
)
map
.
get
(
"field56Option"
);
String
nextAgentCode
=
""
;
if
(
StringUtil
.
isEmpty
(
field56Option
))
{
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/impl/Field60Generate.java
View file @
59f3e49a
...
...
@@ -30,41 +30,45 @@ public class Field60Generate extends AbstractMx2MtFieldsGenerate{
@Override
public
void
fieldsGenerate
()
throws
SwiftException
{
try
{
map
.
put
(
"field60"
,
""
);
String
filed60Option
=
""
;
String
crdr
=
""
;
String
dt
=
""
;
String
ccy
=
""
;
String
amt
=
""
;
Document
document
=
(
Document
)
map
.
get
(
Mx2MtConstants
.
MX_XML_DOCUMENT
);
String
cd
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Tp.CdOrPrtry.Cd"
);
if
(
BalanceType12Code
.
PRCD
.
value
().
equals
(
cd
))
{
filed60Option
=
"F"
;
}
else
if
(
BalanceType12Code
.
ITBD
.
value
().
equals
(
cd
))
{
filed60Option
=
"M"
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60Option."
);
int
balCounts
=
getXmlNodeCounts
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal"
);
if
(
balCounts
>
0
){
String
cd
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Tp.CdOrPrtry.Cd"
);
if
(
BalanceType12Code
.
PRCD
.
value
().
equals
(
cd
))
{
filed60Option
=
"F"
;
}
else
if
(
BalanceType12Code
.
ITBD
.
value
().
equals
(
cd
))
{
filed60Option
=
"M"
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60Option."
);
}
map
.
put
(
"field60Option"
,
filed60Option
);
String
cdtDbtInd
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.CdtDbtInd"
);
if
(
CreditDebitCode
.
CRDT
.
value
().
equals
(
cdtDbtInd
))
{
crdr
=
Mx2MtConstants
.
DRCRMARK_C
;
}
else
if
(
CreditDebitCode
.
DBIT
.
value
().
equals
(
cdtDbtInd
))
{
crdr
=
Mx2MtConstants
.
DRCRMARK_D
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
String
dateStr
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Dt.Dt"
);
if
(
StringUtil
.
isNotEmpty
(
dateStr
)){
XMLGregorianCalendar
XmlDt
=
DatatypeFactory
.
newInstance
().
newXMLGregorianCalendar
(
dateStr
);
dt
=
DateUtil
.
format
(
XmlDt
,
"yyMMdd"
);
}
String
amtStr
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Amt"
);
String
ccyStr
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
amtStr
)
&&
StringUtil
.
isNotEmpty
(
ccyStr
))
{
amt
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
amtStr
),
ccyStr
);
ccy
=
ccyStr
;
}
map
.
put
(
"field60"
,
crdr
+
dt
+
ccy
+
amt
);
}
map
.
put
(
"field60Option"
,
filed60Option
);
String
cdtDbtInd
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.CdtDbtInd"
);
if
(
CreditDebitCode
.
CRDT
.
value
().
equals
(
cdtDbtInd
))
{
crdr
=
Mx2MtConstants
.
DRCRMARK_C
;
}
else
if
(
CreditDebitCode
.
DBIT
.
value
().
equals
(
cdtDbtInd
))
{
crdr
=
Mx2MtConstants
.
DRCRMARK_D
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed60 D/C Mark."
);
}
String
dateStr
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Dt.Dt"
);
if
(
StringUtil
.
isNotEmpty
(
dateStr
)){
XMLGregorianCalendar
XmlDt
=
DatatypeFactory
.
newInstance
().
newXMLGregorianCalendar
(
dateStr
);
dt
=
DateUtil
.
format
(
XmlDt
,
"yyMMdd"
);
}
String
amtStr
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Amt"
);
String
ccyStr
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal.Amt@Ccy"
);
if
(
StringUtil
.
isNotEmpty
(
amtStr
)
&&
StringUtil
.
isNotEmpty
(
ccyStr
))
{
amt
=
NumberUtil
.
formatAmt
(
new
BigDecimal
(
amtStr
),
ccyStr
);
ccy
=
ccyStr
;
}
map
.
put
(
"field60"
,
crdr
+
dt
+
ccy
+
amt
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
throw
new
SwiftException
(
"ERROR"
,
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/impl/Field62Generate.java
View file @
59f3e49a
...
...
@@ -32,12 +32,12 @@ public class Field62Generate extends AbstractMx2MtFieldsGenerate{
try
{
Document
document
=
(
Document
)
map
.
get
(
Mx2MtConstants
.
MX_XML_DOCUMENT
);
int
balCounts
=
getXmlNodeCounts
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal"
);
if
(
balCounts
>
=
1
){
if
(
balCounts
>
1
){
String
filed62Option
=
""
;
String
cd
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal(1).Tp.CdOrPrtry.Cd"
);
if
(
BalanceType12Code
.
CLBD
.
equals
(
BalanceType12Code
.
valueOf
(
cd
)
))
{
if
(
BalanceType12Code
.
CLBD
.
value
().
equals
(
cd
))
{
filed62Option
=
"F"
;
}
else
if
(
BalanceType12Code
.
ITBD
.
equals
(
BalanceType12Code
.
valueOf
(
cd
)
))
{
}
else
if
(
BalanceType12Code
.
ITBD
.
value
().
equals
(
cd
))
{
filed62Option
=
"M"
;
}
else
{
throw
new
SwiftException
(
"ERROR"
,
"cannot find filed62Option."
);
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/impl/Field64Generate.java
View file @
59f3e49a
...
...
@@ -64,8 +64,6 @@ public class Field64Generate extends AbstractMx2MtFieldsGenerate{
map
.
put
(
"field64"
,
crdr
+
dateStr
+
ccy
+
amt
);
}
}
}
else
{
map
.
put
(
"field64"
,
" "
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
...
...
swiftCore/src/main/java/com/brilliance/swift/mx2mt/mt940950/impl/Field65Generate.java
View file @
59f3e49a
...
...
@@ -37,7 +37,7 @@ public class Field65Generate extends AbstractMx2MtFieldsGenerate {
if
(
balCounts
>
0
){
for
(
int
i
=
0
;
i
<
balCounts
;
i
++)
{
String
cd
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal("
+
i
+
").Tp.CdOrPrtry.Cd"
);
if
(
BalanceType12Code
.
FWAV
.
equals
(
BalanceType12Code
.
valueOf
(
cd
)
)){
if
(
BalanceType12Code
.
FWAV
.
value
().
equals
(
cd
)){
String
cdtDbtInd
=
getXmlNodeValue
(
Mx2MtConstants
.
MAINBODY_PARENT_ELEMENT_NAME
,
document
,
"Stmt.Bal("
+
i
+
").CdtDbtInd"
);
String
crdr
=
""
;
if
(
CreditDebitCode
.
CRDT
.
value
().
equals
(
cdtDbtInd
))
{
...
...
@@ -64,8 +64,6 @@ public class Field65Generate extends AbstractMx2MtFieldsGenerate {
map
.
put
(
"field65"
,
crdr
+
dateStr
+
ccy
+
amt
);
}
}
}
else
{
map
.
put
(
"field65"
,
""
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
...
...
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